blob: 853eb6c727c5e11536892634d140dd8040d415c5 [file] [log] [blame]
Eric Christophercdf218d2012-12-10 19:51:21 +00001; RUN: llc -split-dwarf=Enable -O0 %s -mtriple=x86_64-unknown-linux-gnu -filetype=obj -o %t
Eli Benderskye6abe832013-01-25 21:44:53 +00002; RUN: llvm-dwarfdump -debug-dump=all %t | FileCheck %s
Eric Christopher9c2ecd92012-11-30 23:59:06 +00003
4@a = common global i32 0, align 4
5
6!llvm.dbg.cu = !{!0}
7
8!0 = metadata !{i32 786449, i32 0, i32 12, metadata !"baz.c", metadata !"/usr/local/google/home/echristo/tmp", metadata !"clang version 3.3 (trunk 169021) (llvm/trunk 169020)", i1 true, i1 false, metadata !"", i32 0, metadata !1, metadata !1, metadata !1, metadata !3} ; [ DW_TAG_compile_unit ] [/usr/local/google/home/echristo/tmp/baz.c] [DW_LANG_C99]
David Blaikie33111df2013-02-02 05:56:24 +00009!1 = metadata !{i32 0}
10!3 = metadata !{metadata !5}
Eric Christopher9c2ecd92012-11-30 23:59:06 +000011!5 = metadata !{i32 786484, i32 0, null, metadata !"a", metadata !"a", metadata !"", metadata !6, i32 1, metadata !7, i32 0, i32 1, i32* @a} ; [ DW_TAG_variable ] [a] [line 1] [def]
12!6 = metadata !{i32 786473, metadata !"baz.c", metadata !"/usr/local/google/home/echristo/tmp", null} ; [ DW_TAG_file_type ]
13!7 = metadata !{i32 786468, null, metadata !"int", null, i32 0, i64 32, i64 32, i64 0, i32 0, i32 5} ; [ DW_TAG_base_type ] [int] [line 0, size 32, align 32, offset 0, enc DW_ATE_signed]
14
15; Check that the skeleton compile unit contains the proper attributes:
16; This DIE has the following attributes: DW_AT_comp_dir, DW_AT_stmt_list,
17; DW_AT_low_pc, DW_AT_high_pc, DW_AT_ranges, DW_AT_dwo_name, DW_AT_dwo_id,
18; DW_AT_ranges_base, DW_AT_addr_base.
19
Eric Christopherda4b2192013-01-02 23:52:13 +000020; CHECK: .debug_info contents:
Eric Christopherc8a310e2012-12-10 23:34:43 +000021; CHECK: DW_TAG_compile_unit
Eric Christopher4c7765f2013-01-17 03:00:04 +000022; CHECK: DW_AT_GNU_dwo_name [DW_FORM_strp] ( .debug_str[0x00000000] = "baz.dwo")
23; CHECK: DW_AT_GNU_addr_base [DW_FORM_sec_offset] (0x00000000)
Eric Christopher9c2ecd92012-11-30 23:59:06 +000024; CHECK: DW_AT_low_pc [DW_FORM_addr] (0x0000000000000000)
Eric Christopher4c7765f2013-01-17 03:00:04 +000025; CHECK: DW_AT_stmt_list [DW_FORM_sec_offset] (0x00000000)
26; CHECK: DW_AT_comp_dir [DW_FORM_strp] ( .debug_str[0x00000008] = "/usr/local/google/home/echristo/tmp")
27
28; CHECK: .debug_str contents:
29; CHECK: 0x00000000: "baz.dwo"
30; CHECK: 0x00000008: "/usr/local/google/home/echristo/tmp"
Eric Christopher3c5a1912012-12-19 22:02:53 +000031
Eric Christopher962c9082013-01-15 23:56:56 +000032; 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: DW_AT_low_pc DW_FORM_GNU_addr_index
40; CHECK: DW_AT_stmt_list DW_FORM_data4
41; CHECK: DW_AT_comp_dir DW_FORM_GNU_str_index
42
43; CHECK: [2] DW_TAG_base_type DW_CHILDREN_no
44; CHECK: DW_AT_name DW_FORM_GNU_str_index
45; CHECK: DW_AT_encoding DW_FORM_data1
46; CHECK: DW_AT_byte_size DW_FORM_data1
47
48; CHECK: [3] DW_TAG_variable DW_CHILDREN_no
49; CHECK: DW_AT_name DW_FORM_GNU_str_index
50; CHECK: DW_AT_type DW_FORM_ref4
51; CHECK: DW_AT_external DW_FORM_flag_present
52; CHECK: DW_AT_decl_file DW_FORM_data1
53; CHECK: DW_AT_decl_line DW_FORM_data1
54; CHECK: DW_AT_location DW_FORM_block1
55
Eric Christopherda4b2192013-01-02 23:52:13 +000056; Check that the rest of the compile units have information.
Eric Christopherda4b2192013-01-02 23:52:13 +000057; CHECK: .debug_info.dwo contents:
58; CHECK: DW_TAG_compile_unit
Eric Christopher2cbd5762013-01-07 19:32:41 +000059; CHECK: DW_AT_producer [DW_FORM_GNU_str_index] ( indexed (00000000) string = "clang version 3.3 (trunk 169021) (llvm/trunk 169020)")
Eric Christopherda4b2192013-01-02 23:52:13 +000060; CHECK: DW_AT_language [DW_FORM_data2] (0x000c)
Eric Christopher2cbd5762013-01-07 19:32:41 +000061; CHECK: DW_AT_name [DW_FORM_GNU_str_index] ( indexed (00000001) string = "baz.c")
Eric Christopher962c9082013-01-15 23:56:56 +000062; CHECK: DW_AT_low_pc [DW_FORM_GNU_addr_index] ( indexed (00000000) address = 0x0000000000000000)
Eric Christopherda4b2192013-01-02 23:52:13 +000063; CHECK: DW_TAG_base_type
Eric Christopher2cbd5762013-01-07 19:32:41 +000064; CHECK: DW_AT_name [DW_FORM_GNU_str_index] ( indexed (00000004) string = "int")
Eric Christopherda4b2192013-01-02 23:52:13 +000065; CHECK: DW_TAG_variable
Eric Christopher2cbd5762013-01-07 19:32:41 +000066; CHECK: DW_AT_name [DW_FORM_GNU_str_index] ( indexed (00000003) string = "a")
Eric Christophere9ec2452013-01-18 22:11:33 +000067; CHECK: DW_AT_type [DW_FORM_ref4] (cu + 0x0016 => {0x00000016})
68; CHECK: DW_AT_external [DW_FORM_flag_present] (true)
69; CHECK: DW_AT_decl_file [DW_FORM_data1] (0x01)
70; CHECK: DW_AT_decl_line [DW_FORM_data1] (0x01)
71; CHECK: DW_AT_location [DW_FORM_block1] (<0x02> fb 01 )
72
Eric Christopher962c9082013-01-15 23:56:56 +000073
74; CHECK: .debug_str.dwo contents:
75; CHECK: 0x00000000: "clang version 3.3 (trunk 169021) (llvm/trunk 169020)"
76; CHECK: 0x00000035: "baz.c"
77; CHECK: 0x0000003b: "/usr/local/google/home/echristo/tmp"
78; CHECK: 0x0000005f: "a"
79; CHECK: 0x00000061: "int"
80
81; CHECK: .debug_str_offsets.dwo contents:
82; CHECK: 0x00000000: 00000000
83; CHECK: 0x00000004: 00000035
84; CHECK: 0x00000008: 0000003b
85; CHECK: 0x0000000c: 0000005f
86; CHECK: 0x00000010: 00000061