dwarfdump: Use the index to find the right abbrev offset in DWP files
[oota-llvm.git] / test / DebugInfo / dwarfdump-dwp.test
1 RUN: llvm-dwarfdump %p/Inputs/dwarfdump-dwp.x86_64.o | FileCheck %s
2
3 ; Testing the following simple dwp file:
4 ; a.cpp:
5 ;   struct foo { };
6 ;   foo a;
7 ; b.cpp:
8 ;   struct bar { };
9 ;   bar b() {
10 ;   }
11
12 ; CHECK: .debug_info.dwo contents:
13 ; CHECK: Compile Unit
14
15 ; Verify that the second CU uses the index for its abbrev offset
16 ; CHECK: Compile Unit
17 ; CHECK-SAME: abbr_offset = 0x0043
18 ; CHECK: DW_TAG_compile_unit
19 ; CHECK-NOT: DW_TAG
20 ; FIXME: Implement str_offsets support so we find b.cpp here \/
21 ; CHECK:   DW_AT_name {{.*}} "a.cpp"
22
23 ; Verify that abbreviations are decoded using the abbrev offset in the index
24 ; CHECK:   DW_TAG_subprogram
25 ; CHECK:   DW_TAG_structure_type
26
27 ; CHECK: .debug_cu_index contents:
28 ; CHECK-NEXT: version = 2 slots = 16
29 ; CHECK:      Index Signature          INFO                     ABBREV                   LINE                     STR_OFFSETS
30 ; CHECK-NEXT: ----- ------------------ ------------------------ ------------------------ ------------------------ ------------------------
31 ; CHECK-NEXT:     2 0xfef104c25502f092 [0x0000002d, 0x0000005f) [0x00000043, 0x0000008e) [0x0000001a, 0x00000034) [0x00000010, 0x00000024)
32 ; CHECK-NEXT:     8 0x03c30756e2d45008 [0x00000000, 0x0000002d) [0x00000000, 0x00000043) [0x00000000, 0x0000001a) [0x00000000, 0x00000010)
33
34 ; CHECK: .debug_tu_index contents:
35 ; CHECK-NEXT: version = 2 slots = 16
36 ; CHECK:      Index Signature          TYPES                    ABBREV                   LINE                     STR_OFFSETS
37 ; CHECK-NEXT: ----- ------------------ ------------------------ ------------------------ ------------------------ ------------------------
38 ; CHECK-NEXT:     8 0x1d02f3be30cc5688 [0x00000024, 0x00000048) [0x00000043, 0x0000008e) [0x0000001a, 0x00000034) [0x00000010, 0x00000024)
39 ; CHECK-NEXT:    12 0x3875c0e21cda63fc [0x00000000, 0x00000024) [0x00000000, 0x00000043) [0x00000000, 0x0000001a) [0x00000000, 0x00000010)
40
41 ; TODO: use the index section offset info to correctly dump strings in debug info
42 ; TODO: use the index section offset info to correctly dump file names in debug info