xref: /aosp_15_r20/external/llvm/test/DebugInfo/dwarfdump-dwp.test (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard WorkerRUN: llvm-dwarfdump %p/Inputs/dwarfdump-dwp.x86_64.o | FileCheck %s
2*9880d681SAndroid Build Coastguard Worker
3*9880d681SAndroid Build Coastguard Worker; Testing the following simple dwp file:
4*9880d681SAndroid Build Coastguard Worker; a.cpp:
5*9880d681SAndroid Build Coastguard Worker;   struct foo { };
6*9880d681SAndroid Build Coastguard Worker;   foo a;
7*9880d681SAndroid Build Coastguard Worker; b.cpp:
8*9880d681SAndroid Build Coastguard Worker;   struct bar { };
9*9880d681SAndroid Build Coastguard Worker;   bar b() {
10*9880d681SAndroid Build Coastguard Worker;   }
11*9880d681SAndroid Build Coastguard Worker
12*9880d681SAndroid Build Coastguard Worker; CHECK-LABEL: .debug_info.dwo contents:
13*9880d681SAndroid Build Coastguard Worker; CHECK: Compile Unit
14*9880d681SAndroid Build Coastguard Worker
15*9880d681SAndroid Build Coastguard Worker; Verify that the second CU uses the index for its abbrev offset
16*9880d681SAndroid Build Coastguard Worker; CHECK: Compile Unit
17*9880d681SAndroid Build Coastguard Worker; CHECK-SAME: abbr_offset = 0x0043
18*9880d681SAndroid Build Coastguard Worker; CHECK: DW_TAG_compile_unit
19*9880d681SAndroid Build Coastguard Worker; CHECK-NOT: DW_TAG
20*9880d681SAndroid Build Coastguard Worker; CHECK:   DW_AT_name {{.*}} "b.cpp"
21*9880d681SAndroid Build Coastguard Worker
22*9880d681SAndroid Build Coastguard Worker; Verify that abbreviations are decoded using the abbrev offset in the index
23*9880d681SAndroid Build Coastguard Worker; CHECK:   DW_TAG_structure_type
24*9880d681SAndroid Build Coastguard Worker; CHECK:   DW_TAG_subprogram
25*9880d681SAndroid Build Coastguard Worker
26*9880d681SAndroid Build Coastguard Worker; CHECK-LABEL: .debug_types.dwo contents:
27*9880d681SAndroid Build Coastguard Worker; CHECK: Type Unit
28*9880d681SAndroid Build Coastguard Worker; CHECK:   DW_TAG_type_unit
29*9880d681SAndroid Build Coastguard Worker; CHECK:     DW_AT_stmt_list {{.*}}(0x00000000)
30*9880d681SAndroid Build Coastguard Worker; CHECK:     DW_TAG_structure_type
31*9880d681SAndroid Build Coastguard Worker; CHECK:       DW_AT_decl_file {{.*}} ("a.cpp")
32*9880d681SAndroid Build Coastguard Worker; CHECK: Type Unit
33*9880d681SAndroid Build Coastguard Worker; CHECK:   DW_TAG_type_unit
34*9880d681SAndroid Build Coastguard Worker; CHECK:     DW_AT_stmt_list {{.*}}(0x00000000)
35*9880d681SAndroid Build Coastguard Worker; CHECK:     DW_TAG_structure_type
36*9880d681SAndroid Build Coastguard Worker; CHECK:       DW_AT_decl_file {{.*}} ("b.cpp")
37*9880d681SAndroid Build Coastguard Worker
38*9880d681SAndroid Build Coastguard Worker; CHECK: .debug_cu_index contents:
39*9880d681SAndroid Build Coastguard Worker; CHECK-NEXT: version = 2 slots = 16
40*9880d681SAndroid Build Coastguard Worker; CHECK:      Index Signature          INFO                     ABBREV                   LINE                     STR_OFFSETS
41*9880d681SAndroid Build Coastguard Worker; CHECK-NEXT: ----- ------------------ ------------------------ ------------------------ ------------------------ ------------------------
42*9880d681SAndroid Build Coastguard Worker; CHECK-NEXT:     3 0xfef104c25502f092 [0x0000002d, 0x0000005f) [0x00000043, 0x0000008e) [0x0000001a, 0x00000034) [0x00000010, 0x00000024)
43*9880d681SAndroid Build Coastguard Worker; CHECK-NEXT:     9 0x03c30756e2d45008 [0x00000000, 0x0000002d) [0x00000000, 0x00000043) [0x00000000, 0x0000001a) [0x00000000, 0x00000010)
44*9880d681SAndroid Build Coastguard Worker
45*9880d681SAndroid Build Coastguard Worker; CHECK: .debug_tu_index contents:
46*9880d681SAndroid Build Coastguard Worker; CHECK-NEXT: version = 2 slots = 16
47*9880d681SAndroid Build Coastguard Worker; CHECK:      Index Signature          TYPES                    ABBREV                   LINE                     STR_OFFSETS
48*9880d681SAndroid Build Coastguard Worker; CHECK-NEXT: ----- ------------------ ------------------------ ------------------------ ------------------------ ------------------------
49*9880d681SAndroid Build Coastguard Worker; CHECK-NEXT:     9 0x1d02f3be30cc5688 [0x00000024, 0x00000048) [0x00000043, 0x0000008e) [0x0000001a, 0x00000034) [0x00000010, 0x00000024)
50*9880d681SAndroid Build Coastguard Worker; CHECK-NEXT:    13 0x3875c0e21cda63fc [0x00000000, 0x00000024) [0x00000000, 0x00000043) [0x00000000, 0x0000001a) [0x00000000, 0x00000010)
51*9880d681SAndroid Build Coastguard Worker
52*9880d681SAndroid Build Coastguard Worker; TODO: use the index section offset info to correctly dump strings in debug info
53*9880d681SAndroid Build Coastguard Worker; TODO: use the index section offset info to correctly dump file names in debug info
54