]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - opencl/llvm.git/blob - test/DebugInfo/X86/fission-cu.ll
Debug info: Teach SROA how to update debug info for fragmented variables.
[opencl/llvm.git] / test / DebugInfo / X86 / fission-cu.ll
1 ; RUN: llc -split-dwarf=Enable -O0 %s -mtriple=x86_64-unknown-linux-gnu -filetype=obj -o %t
2 ; RUN: llvm-dwarfdump -debug-dump=all %t | FileCheck %s
3 ; RUN: llvm-readobj --relocations %t | FileCheck --check-prefix=OBJ %s
4 ; RUN: llvm-objdump -h %t | FileCheck --check-prefix=HDR %s
6 @a = common global i32 0, align 4
8 !llvm.dbg.cu = !{!0}
9 !llvm.module.flags = !{!9}
11 !0 = !{!"0x11\0012\00clang version 3.3 (trunk 169021) (llvm/trunk 169020)\000\00\000\00baz.dwo\000", !8, !1, !1, !1, !3,  !1} ; [ DW_TAG_compile_unit ] [/usr/local/google/home/echristo/tmp/baz.c] [DW_LANG_C99]
12 !1 = !{}
13 !3 = !{!5}
14 !5 = !{!"0x34\00a\00a\00\001\000\001", null, !6, !7, i32* @a, null} ; [ DW_TAG_variable ] [a] [line 1] [def]
15 !6 = !{!"0x29", !8} ; [ DW_TAG_file_type ]
16 !7 = !{!"0x24\00int\000\0032\0032\000\000\005", null, null} ; [ DW_TAG_base_type ] [int] [line 0, size 32, align 32, offset 0, enc DW_ATE_signed]
17 !8 = !{!"baz.c", !"/usr/local/google/home/echristo/tmp"}
19 ; Check that the skeleton compile unit contains the proper attributes:
20 ; This DIE has the following attributes: DW_AT_comp_dir, DW_AT_stmt_list,
21 ; DW_AT_low_pc, DW_AT_high_pc, DW_AT_ranges, DW_AT_dwo_name, DW_AT_dwo_id,
22 ; DW_AT_ranges_base, DW_AT_addr_base.
24 ; CHECK: .debug_abbrev contents:
25 ; CHECK: Abbrev table for offset: 0x00000000
26 ; CHECK: [1] DW_TAG_compile_unit DW_CHILDREN_no
27 ; CHECK: DW_AT_stmt_list DW_FORM_sec_offset
28 ; CHECK: DW_AT_GNU_dwo_name      DW_FORM_strp
29 ; CHECK: DW_AT_comp_dir  DW_FORM_strp
30 ; CHECK: DW_AT_GNU_dwo_id        DW_FORM_data8
32 ; Check that we're using the right forms.
33 ; CHECK: .debug_abbrev.dwo contents:
34 ; CHECK: Abbrev table for offset: 0x00000000
35 ; CHECK: [1] DW_TAG_compile_unit DW_CHILDREN_yes
36 ; CHECK: DW_AT_producer  DW_FORM_GNU_str_index
37 ; CHECK: DW_AT_language  DW_FORM_data2
38 ; CHECK: DW_AT_name      DW_FORM_GNU_str_index
39 ; CHECK-NOT: DW_AT_low_pc
40 ; CHECK-NOT: DW_AT_stmt_list
41 ; CHECK-NOT: DW_AT_comp_dir
42 ; CHECK: DW_AT_GNU_dwo_id        DW_FORM_data8
44 ; CHECK: [2] DW_TAG_variable     DW_CHILDREN_no
45 ; CHECK: DW_AT_name      DW_FORM_GNU_str_index
46 ; CHECK: DW_AT_type      DW_FORM_ref4
47 ; CHECK: DW_AT_external  DW_FORM_flag_present
48 ; CHECK: DW_AT_decl_file DW_FORM_data1
49 ; CHECK: DW_AT_decl_line DW_FORM_data1
50 ; CHECK: DW_AT_location  DW_FORM_exprloc
52 ; CHECK: [3] DW_TAG_base_type    DW_CHILDREN_no
53 ; CHECK: DW_AT_name      DW_FORM_GNU_str_index
54 ; CHECK: DW_AT_encoding  DW_FORM_data1
55 ; CHECK: DW_AT_byte_size DW_FORM_data1
57 ; CHECK: .debug_info contents:
58 ; CHECK: DW_TAG_compile_unit
59 ; CHECK-NEXT: DW_AT_stmt_list [DW_FORM_sec_offset]   (0x00000000)
60 ; CHECK-NEXT: DW_AT_GNU_dwo_name [DW_FORM_strp] ( .debug_str[0x00000000] = "baz.dwo")
61 ; CHECK-NEXT: DW_AT_comp_dir [DW_FORM_strp]     ( .debug_str[0x00000008] = "/usr/local/google/home/echristo/tmp")
62 ; CHECK-NEXT: DW_AT_GNU_dwo_id [DW_FORM_data8]  (0x1f1f859683d49324)
64 ; Check that the rest of the compile units have information.
65 ; CHECK: .debug_info.dwo contents:
66 ; CHECK: DW_TAG_compile_unit
67 ; CHECK: DW_AT_producer [DW_FORM_GNU_str_index] ( indexed (00000000) string = "clang version 3.3 (trunk 169021) (llvm/trunk 169020)")
68 ; CHECK: DW_AT_language [DW_FORM_data2]        (DW_LANG_C99)
69 ; CHECK: DW_AT_name [DW_FORM_GNU_str_index]    ( indexed (00000001) string = "baz.c")
70 ; CHECK-NOT: DW_AT_low_pc
71 ; CHECK-NOT: DW_AT_stmt_list
72 ; CHECK-NOT: DW_AT_comp_dir
73 ; CHECK: DW_AT_GNU_dwo_id [DW_FORM_data8]  (0x1f1f859683d49324)
74 ; CHECK: DW_TAG_variable
75 ; CHECK: DW_AT_name [DW_FORM_GNU_str_index]     ( indexed (00000002) string = "a")
76 ; CHECK: DW_AT_type [DW_FORM_ref4]       (cu + 0x{{[0-9a-f]*}} => {[[TYPE:0x[0-9a-f]*]]})
77 ; CHECK: DW_AT_external [DW_FORM_flag_present]   (true)
78 ; CHECK: DW_AT_decl_file [DW_FORM_data1] (0x01)
79 ; CHECK: DW_AT_decl_line [DW_FORM_data1] (1)
80 ; CHECK: DW_AT_location [DW_FORM_exprloc] (<0x2> fb 00 )
81 ; CHECK: [[TYPE]]: DW_TAG_base_type
82 ; CHECK: DW_AT_name [DW_FORM_GNU_str_index]     ( indexed (00000003) string = "int")
84 ; CHECK: .debug_str contents:
85 ; CHECK: 0x00000000: "baz.dwo"
86 ; CHECK: 0x00000008: "/usr/local/google/home/echristo/tmp"
88 ; CHECK: .debug_str.dwo contents:
89 ; CHECK: 0x00000000: "clang version 3.3 (trunk 169021) (llvm/trunk 169020)"
90 ; CHECK: 0x00000035: "baz.c"
91 ; CHECK: 0x0000003b: "a"
92 ; CHECK: 0x0000003d: "int"
94 ; CHECK: .debug_str_offsets.dwo contents:
95 ; CHECK: 0x00000000: 00000000
96 ; CHECK: 0x00000004: 00000035
97 ; CHECK: 0x00000008: 0000003b
98 ; CHECK: 0x0000000c: 0000003d
100 ; Object file checks
101 ; For x86-64-linux we should have this set of relocations for the debug info section
103 ; OBJ: .debug_info
104 ; OBJ-NEXT: R_X86_64_32 .debug_abbrev
105 ; OBJ-NEXT: R_X86_64_32 .debug_line
106 ; OBJ-NEXT: R_X86_64_32 .debug_str
107 ; OBJ-NEXT: R_X86_64_32 .debug_str
108 ; OBJ-NEXT: R_X86_64_32 .debug_addr
109 ; OBJ-NEXT: }
111 ; HDR-NOT: .debug_aranges
112 ; HDR-NOT: .rela.{{.*}}.dwo
114 !9 = !{i32 1, !"Debug Info Version", i32 2}