Eric Christopher | cdf218d | 2012-12-10 19:51:21 +0000 | [diff] [blame] | 1 | ; RUN: llc -split-dwarf=Enable -O0 %s -mtriple=x86_64-unknown-linux-gnu -filetype=obj -o %t |
Eric Christopher | 9c2ecd9 | 2012-11-30 23:59:06 +0000 | [diff] [blame] | 2 | ; RUN: llvm-dwarfdump %t | FileCheck %s |
| 3 | |
| 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] |
| 9 | !1 = metadata !{metadata !2} |
| 10 | !2 = metadata !{i32 0} |
| 11 | !3 = metadata !{metadata !4} |
| 12 | !4 = metadata !{metadata !5} |
| 13 | !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] |
| 14 | !6 = metadata !{i32 786473, metadata !"baz.c", metadata !"/usr/local/google/home/echristo/tmp", null} ; [ DW_TAG_file_type ] |
| 15 | !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] |
| 16 | |
| 17 | ; Check that the skeleton compile unit contains the proper attributes: |
| 18 | ; This DIE has the following attributes: DW_AT_comp_dir, DW_AT_stmt_list, |
| 19 | ; DW_AT_low_pc, DW_AT_high_pc, DW_AT_ranges, DW_AT_dwo_name, DW_AT_dwo_id, |
| 20 | ; DW_AT_ranges_base, DW_AT_addr_base. |
| 21 | |
Eric Christopher | da4b219 | 2013-01-02 23:52:13 +0000 | [diff] [blame] | 22 | ; CHECK: .debug_info contents: |
Eric Christopher | c8a310e | 2012-12-10 23:34:43 +0000 | [diff] [blame] | 23 | ; CHECK: DW_TAG_compile_unit |
Eric Christopher | 4c7765f | 2013-01-17 03:00:04 +0000 | [diff] [blame^] | 24 | ; CHECK: DW_AT_GNU_dwo_name [DW_FORM_strp] ( .debug_str[0x00000000] = "baz.dwo") |
| 25 | ; CHECK: DW_AT_GNU_addr_base [DW_FORM_sec_offset] (0x00000000) |
Eric Christopher | 9c2ecd9 | 2012-11-30 23:59:06 +0000 | [diff] [blame] | 26 | ; CHECK: DW_AT_low_pc [DW_FORM_addr] (0x0000000000000000) |
Eric Christopher | 4c7765f | 2013-01-17 03:00:04 +0000 | [diff] [blame^] | 27 | ; CHECK: DW_AT_stmt_list [DW_FORM_sec_offset] (0x00000000) |
| 28 | ; CHECK: DW_AT_comp_dir [DW_FORM_strp] ( .debug_str[0x00000008] = "/usr/local/google/home/echristo/tmp") |
| 29 | |
| 30 | ; CHECK: .debug_str contents: |
| 31 | ; CHECK: 0x00000000: "baz.dwo" |
| 32 | ; CHECK: 0x00000008: "/usr/local/google/home/echristo/tmp" |
Eric Christopher | 3c5a191 | 2012-12-19 22:02:53 +0000 | [diff] [blame] | 33 | |
Eric Christopher | 962c908 | 2013-01-15 23:56:56 +0000 | [diff] [blame] | 34 | ; Check that we're using the right forms. |
| 35 | ; CHECK: .debug_abbrev.dwo contents: |
| 36 | ; CHECK: Abbrev table for offset: 0x00000000 |
| 37 | ; CHECK: [1] DW_TAG_compile_unit DW_CHILDREN_yes |
| 38 | ; CHECK: DW_AT_producer DW_FORM_GNU_str_index |
| 39 | ; CHECK: DW_AT_language DW_FORM_data2 |
| 40 | ; CHECK: DW_AT_name DW_FORM_GNU_str_index |
| 41 | ; CHECK: DW_AT_low_pc DW_FORM_GNU_addr_index |
| 42 | ; CHECK: DW_AT_stmt_list DW_FORM_data4 |
| 43 | ; CHECK: DW_AT_comp_dir DW_FORM_GNU_str_index |
| 44 | |
| 45 | ; CHECK: [2] DW_TAG_base_type DW_CHILDREN_no |
| 46 | ; CHECK: DW_AT_name DW_FORM_GNU_str_index |
| 47 | ; CHECK: DW_AT_encoding DW_FORM_data1 |
| 48 | ; CHECK: DW_AT_byte_size DW_FORM_data1 |
| 49 | |
| 50 | ; CHECK: [3] DW_TAG_variable DW_CHILDREN_no |
| 51 | ; CHECK: DW_AT_name DW_FORM_GNU_str_index |
| 52 | ; CHECK: DW_AT_type DW_FORM_ref4 |
| 53 | ; CHECK: DW_AT_external DW_FORM_flag_present |
| 54 | ; CHECK: DW_AT_decl_file DW_FORM_data1 |
| 55 | ; CHECK: DW_AT_decl_line DW_FORM_data1 |
| 56 | ; CHECK: DW_AT_location DW_FORM_block1 |
| 57 | |
Eric Christopher | da4b219 | 2013-01-02 23:52:13 +0000 | [diff] [blame] | 58 | ; Check that the rest of the compile units have information. |
Eric Christopher | da4b219 | 2013-01-02 23:52:13 +0000 | [diff] [blame] | 59 | ; CHECK: .debug_info.dwo contents: |
| 60 | ; CHECK: DW_TAG_compile_unit |
Eric Christopher | 2cbd576 | 2013-01-07 19:32:41 +0000 | [diff] [blame] | 61 | ; CHECK: DW_AT_producer [DW_FORM_GNU_str_index] ( indexed (00000000) string = "clang version 3.3 (trunk 169021) (llvm/trunk 169020)") |
Eric Christopher | da4b219 | 2013-01-02 23:52:13 +0000 | [diff] [blame] | 62 | ; CHECK: DW_AT_language [DW_FORM_data2] (0x000c) |
Eric Christopher | 2cbd576 | 2013-01-07 19:32:41 +0000 | [diff] [blame] | 63 | ; CHECK: DW_AT_name [DW_FORM_GNU_str_index] ( indexed (00000001) string = "baz.c") |
Eric Christopher | 962c908 | 2013-01-15 23:56:56 +0000 | [diff] [blame] | 64 | ; CHECK: DW_AT_low_pc [DW_FORM_GNU_addr_index] ( indexed (00000000) address = 0x0000000000000000) |
Eric Christopher | da4b219 | 2013-01-02 23:52:13 +0000 | [diff] [blame] | 65 | ; CHECK: DW_TAG_base_type |
Eric Christopher | 2cbd576 | 2013-01-07 19:32:41 +0000 | [diff] [blame] | 66 | ; CHECK: DW_AT_name [DW_FORM_GNU_str_index] ( indexed (00000004) string = "int") |
Eric Christopher | da4b219 | 2013-01-02 23:52:13 +0000 | [diff] [blame] | 67 | ; CHECK: DW_TAG_variable |
Eric Christopher | 2cbd576 | 2013-01-07 19:32:41 +0000 | [diff] [blame] | 68 | ; CHECK: DW_AT_name [DW_FORM_GNU_str_index] ( indexed (00000003) string = "a") |
Eric Christopher | 962c908 | 2013-01-15 23:56:56 +0000 | [diff] [blame] | 69 | |
| 70 | ; CHECK: .debug_str.dwo contents: |
| 71 | ; CHECK: 0x00000000: "clang version 3.3 (trunk 169021) (llvm/trunk 169020)" |
| 72 | ; CHECK: 0x00000035: "baz.c" |
| 73 | ; CHECK: 0x0000003b: "/usr/local/google/home/echristo/tmp" |
| 74 | ; CHECK: 0x0000005f: "a" |
| 75 | ; CHECK: 0x00000061: "int" |
| 76 | |
| 77 | ; CHECK: .debug_str_offsets.dwo contents: |
| 78 | ; CHECK: 0x00000000: 00000000 |
| 79 | ; CHECK: 0x00000004: 00000035 |
| 80 | ; CHECK: 0x00000008: 0000003b |
| 81 | ; CHECK: 0x0000000c: 0000005f |
| 82 | ; CHECK: 0x00000010: 00000061 |