[llvm-dwp] Emit a rather fictional debug_cu_index
[oota-llvm.git] / test / tools / llvm-dwp / X86 / simple.test
1 RUN: llvm-dwp %p/../Inputs/simple/a.dwo %p/../Inputs/simple/b.dwo -o %t
2 RUN: llvm-dwarfdump %t | FileCheck %s
3
4 FIXME: For some reason, piping straight from llvm-dwp to llvm-dwarfdump doesn't behave well - looks like dwarfdump is reading/closes before dwp has finished.
5
6 DWP from non-type-unit debug info for these two translation units:
7 a.cpp:
8   struct foo { };
9   foo a;
10
11 b.cpp:
12   struct bar { };
13   void b(bar) {
14   }
15
16 CHECK: .debug_abbrev.dwo contents:
17 CHECK: Abbrev table for offset: 0x00000000
18 CHECK: DW_TAG_compile_unit
19 CHECK: DW_TAG_variable
20 CHECK: DW_TAG_structure_type
21 CHECK: Abbrev table for offset: 0x00000031
22 CHECK: DW_TAG_compile_unit
23 CHECK: DW_TAG_structure_type
24 CHECK: DW_TAG_subprogram
25 CHECK: DW_TAG_formal_parameter
26
27 CHECK: .debug_info.dwo contents:
28 CHECK: 0x00000000: Compile Unit: length = 0x00000025 version = 0x0004 abbr_offset = 0x0000 addr_size = 0x08 (next unit at 0x00000029)
29 CHECK: DW_TAG_compile_unit
30 CHECK:   DW_AT_name {{.*}} "a.cpp"
31 CHECK:   DW_TAG_variable
32 CHECK:     DW_AT_name {{.*}} "a"
33 CHECK:   DW_TAG_structure_type
34 CHECK:     DW_AT_name {{.*}} "foo"
35
36 CHECK: 0x00000029: Compile Unit: length = 0x00000031 version = 0x0004 abbr_offset = 0x0031 addr_size = 0x08 (next unit at 0x0000005e)
37 CHECK:   DW_AT_name {{.*}} "b.cpp"
38 CHECK:   DW_TAG_structure_type
39 CHECK:     DW_AT_name {{.*}} "bar"
40 CHECK:   DW_TAG_subprogram
41 CHECK:     DW_AT_name {{.*}} "b"
42 CHECK:     DW_TAG_formal_parameter
43
44 CHECK: .debug_cu_index contents:
45 FIXME: Emit and verify the cu_index contents
46
47 CHECK: .debug_str.dwo contents:
48 CHECK: "clang version
49 CHECK: 0x[[ACPP:.*]]: "a.cpp"
50 CHECK-NOT: "clang version
51 CHECK: 0x[[BCPP:.*]]: "b.cpp"
52
53 CHECK: .debug_str_offsets.dwo contents:
54 CHECK: : 00000000
55 CHECK: : [[ACPP]]
56 CHECK: : 00000000
57 CHECK: : [[BCPP]]