1 RUN: llvm-dsymutil -f -o - -oso-prepend-path=%p/.. %p/../Inputs/basic-lto-dw4.macho.x86_64 | llvm-dwarfdump - | FileCheck %s 2 3 CHECK: file format Mach-O 64-bit x86-64 4 5 CHECK: debug_info contents 6 7 CHECK: Compile Unit: {{.*}} version = 0x0004 8 CHECK: DW_TAG_compile_unit [1] * 9 CHECK: DW_AT_producer [DW_FORM_strp] ( .debug_str[0x00000001] = "clang version 3.7.0 ") 10 CHECK: DW_AT_language [DW_FORM_data2] (DW_LANG_C99) 11 CHECK: DW_AT_name [DW_FORM_strp] ( .debug_str[0x00000016] = "basic1.c") 12 CHECK: DW_AT_stmt_list [DW_FORM_sec_offset] (0x00000000) 13 CHECK: DW_AT_comp_dir [DW_FORM_strp] ( .debug_str[0x0000001f] = "/Inputs") 14 CHECK: DW_AT_low_pc [DW_FORM_addr] (0x0000000100000f40) 15 CHECK: DW_AT_high_pc [DW_FORM_data4] (0x0000000b) 16 CHECK: DW_TAG_subprogram [2] * 17 CHECK: DW_AT_low_pc [DW_FORM_addr] (0x0000000100000f40) 18 CHECK: DW_AT_high_pc [DW_FORM_data4] (0x0000000b) 19 CHECK: DW_AT_frame_base [DW_FORM_exprloc] (<0x1> 56 ) 20 CHECK: DW_AT_name [DW_FORM_strp] ( .debug_str[0x00000027] = "main") 21 CHECK: DW_AT_decl_file [DW_FORM_data1] ("/Inputs{{[/\\]}}basic1.c") 22 CHECK: DW_AT_prototyped [DW_FORM_flag_present] (true) 23 CHECK: DW_AT_type [DW_FORM_ref_addr] (0x00000000000000a1) 24 CHECK: DW_AT_external [DW_FORM_flag_present] (true) 25 CHECK: DW_TAG_formal_parameter [3] 26 CHECK: DW_AT_location [DW_FORM_exprloc] (<0x3> 55 93 04 ) 27 CHECK: DW_AT_name [DW_FORM_strp] ( .debug_str[0x0000002c] = "argc") 28 CHECK: DW_AT_decl_file [DW_FORM_data1] ("/Inputs{{[/\\]}}basic1.c") 29 CHECK: DW_AT_type [DW_FORM_ref_addr] (0x00000000000000a1) 30 CHECK: DW_TAG_formal_parameter [4] 31 CHECK: DW_AT_location [DW_FORM_exprloc] (<0x1> 54 ) 32 CHECK: DW_AT_name [DW_FORM_strp] ( .debug_str[0x00000031] = "argv") 33 CHECK: DW_AT_type [DW_FORM_ref4] (cu + 0x0060 => {0x00000060}) 34 CHECK: NULL 35 CHECK: DW_TAG_pointer_type [5] 36 CHECK: DW_AT_type [DW_FORM_ref4] (cu + 0x0065 => {0x00000065}) 37 CHECK: DW_TAG_pointer_type [5] 38 CHECK: DW_TAG_const_type [6] 39 CHECK: DW_TAG_base_type [7] 40 CHECK: DW_AT_name [DW_FORM_strp] ( .debug_str[0x00000036] = "char") 41 CHECK: DW_AT_encoding [DW_FORM_data1] (DW_ATE_signed_char) 42 CHECK: DW_AT_byte_size [DW_FORM_data1] (0x01) 43 CHECK: NULL 44 45 CHECK: Compile Unit:{{.*}} version = 0x0004 46 47 CHECK: DW_TAG_compile_unit [1] * 48 CHECK: DW_AT_producer [DW_FORM_strp] ( .debug_str[0x00000001] = "clang version 3.7.0 ") 49 CHECK: DW_AT_language [DW_FORM_data2] (DW_LANG_C99) 50 CHECK: DW_AT_name [DW_FORM_strp] ( .debug_str[0x0000003b] = "basic2.c") 51 CHECK: DW_AT_stmt_list [DW_FORM_sec_offset] (0x00000044) 52 CHECK: DW_AT_low_pc [DW_FORM_addr] (0x0000000100000f50) 53 CHECK: DW_AT_high_pc [DW_FORM_data4] (0x00000037) 54 CHECK: DW_TAG_base_type [7] 55 CHECK: DW_AT_name [DW_FORM_strp] ( .debug_str[0x00000044] = "int") 56 CHECK: DW_TAG_variable [8] 57 CHECK: DW_AT_name [DW_FORM_strp] ( .debug_str[0x00000048] = "baz") 58 CHECK: DW_AT_location [DW_FORM_exprloc] (<0x9> 03 00 10 00 00 01 00 00 00 ) 59 CHECK: DW_TAG_variable [8] 60 CHECK: DW_AT_name [DW_FORM_strp] ( .debug_str[0x0000004c] = "private_int") 61 CHECK: DW_AT_decl_file [DW_FORM_data1] ("/Inputs{{[/\\]}}basic2.c") 62 CHECK: DW_AT_location [DW_FORM_exprloc] (<0x9> 03 08 10 00 00 01 00 00 00 ) 63 CHECK: DW_TAG_subprogram [9] 64 CHECK: DW_AT_name [DW_FORM_strp] ( .debug_str[0x00000058] = "inc") 65 CHECK: DW_AT_type [DW_FORM_ref4] (cu + 0x002a => {0x000000a1}) 66 CHECK: DW_AT_inline [DW_FORM_data1] (DW_INL_inlined) 67 CHECK: DW_TAG_subprogram [10] * 68 CHECK: DW_AT_low_pc [DW_FORM_addr] (0x0000000100000f50) 69 CHECK: DW_AT_high_pc [DW_FORM_data4] (0x00000037) 70 CHECK: DW_AT_frame_base [DW_FORM_exprloc] (<0x1> 56 ) 71 CHECK: DW_AT_name [DW_FORM_strp] ( .debug_str[0x0000005c] = "foo") 72 CHECK: DW_AT_decl_file [DW_FORM_data1] ("/Inputs{{[/\\]}}basic2.c") 73 CHECK: DW_AT_prototyped [DW_FORM_flag_present] (true) 74 CHECK: DW_AT_type [DW_FORM_ref4] (cu + 0x002a => {0x000000a1}) 75 CHECK: DW_TAG_formal_parameter [11] 76 CHECK: DW_AT_location [DW_FORM_sec_offset] (0x00000000) 77 CHECK: DW_AT_name [DW_FORM_strp] ( .debug_str[0x00000060] = "arg") 78 CHECK: DW_AT_type [DW_FORM_ref4] (cu + 0x002a => {0x000000a1}) 79 CHECK: DW_TAG_inlined_subroutine [12] 80 CHECK: DW_AT_abstract_origin [DW_FORM_ref4] (cu + 0x005b => {0x000000d2} "inc") 81 CHECK: DW_AT_low_pc [DW_FORM_addr] (0x0000000100000f61) 82 CHECK: DW_AT_high_pc [DW_FORM_data4] (0x0000000f) 83 CHECK: NULL 84 CHECK: NULL 85 86 CHECK: Compile Unit: {{.*}} version = 0x0004 87 88 CHECK: DW_TAG_compile_unit [1] * 89 CHECK: DW_AT_producer [DW_FORM_strp] ( .debug_str[0x00000001] = "clang version 3.7.0 ") 90 CHECK: DW_AT_name [DW_FORM_strp] ( .debug_str[0x00000064] = "basic3.c") 91 CHECK: DW_AT_stmt_list [DW_FORM_sec_offset] (0x0000009a) 92 CHECK: DW_AT_low_pc [DW_FORM_addr] (0x0000000100000f90) 93 CHECK: DW_AT_high_pc [DW_FORM_data4] (0x00000024) 94 CHECK: DW_TAG_variable [13] 95 CHECK: DW_AT_name [DW_FORM_strp] ( .debug_str[0x0000006d] = "val") 96 CHECK: DW_AT_decl_file [DW_FORM_data1] ("/Inputs{{[/\\]}}basic3.c") 97 CHECK: DW_AT_location [DW_FORM_exprloc] (<0x9> 03 04 10 00 00 01 00 00 00 ) 98 CHECK: DW_TAG_volatile_type [14] 99 CHECK: DW_TAG_subprogram [15] 100 CHECK: DW_AT_name [DW_FORM_strp] ( .debug_str[0x00000058] = "inc") 101 CHECK: DW_AT_inline [DW_FORM_data1] (DW_INL_inlined) 102 CHECK: DW_TAG_subprogram [2] * 103 CHECK: DW_AT_low_pc [DW_FORM_addr] (0x0000000100000f90) 104 CHECK: DW_AT_high_pc [DW_FORM_data4] (0x00000024) 105 CHECK: DW_AT_frame_base [DW_FORM_exprloc] (<0x1> 56 ) 106 CHECK: DW_AT_name [DW_FORM_strp] ( .debug_str[0x00000071] = "bar") 107 CHECK: DW_TAG_formal_parameter [16] 108 CHECK: DW_AT_location [DW_FORM_sec_offset] (0x00000025) 109 CHECK: DW_AT_name [DW_FORM_strp] ( .debug_str[0x00000060] = "arg") 110 CHECK: DW_TAG_inlined_subroutine [17] 111 CHECK: DW_AT_abstract_origin [DW_FORM_ref4] (cu + 0x0044 => {0x0000015f} "inc") 112 CHECK: DW_AT_ranges [DW_FORM_sec_offset] (0x00000000 113 CHECK: [0x0000000100000f94 - 0x0000000100000f9a) 114 CHECK: [0x0000000100000f9f - 0x0000000100000fa7)) 115 116 CHECK: NULL 117 CHECK: NULL 118 119 120 CHECK: .debug_loc contents: 121 CHECK-NEXT: 0x00000000: Beginning address offset: 0x0000000000000000 122 CHECK-NEXT: Ending address offset: 0x000000000000000c 123 CHECK-NEXT: Location description: 55 93 04 124 CHECK-NEXT: {{^$}} 125 CHECK-NEXT: 0x00000025: Beginning address offset: 0x0000000000000000 126 CHECK-NEXT: Ending address offset: 0x000000000000000f 127 CHECK-NEXT: Location description: 55 93 04 128 CHECK-NEXT: {{^$}} 129 CHECK-NEXT: Beginning address offset: 0x0000000000000019 130 CHECK-NEXT: Ending address offset: 0x000000000000001d 131 CHECK-NEXT: Location description: 55 93 04 132 133 CHECK: .debug_aranges contents: 134 CHECK-NEXT: Address Range Header: length = 0x0000002c, version = 0x0002, cu_offset = 0x00000000, addr_size = 0x08, seg_size = 0x00 135 CHECK-NEXT: [0x0000000100000f40 - 0x0000000100000f4b) 136 CHECK-NEXT: Address Range Header: length = 0x0000002c, version = 0x0002, cu_offset = 0x00000077, addr_size = 0x08, seg_size = 0x00 137 CHECK-NEXT: [0x0000000100000f50 - 0x0000000100000f87) 138 CHECK-NEXT: Address Range Header: length = 0x0000002c, version = 0x0002, cu_offset = 0x0000011b, addr_size = 0x08, seg_size = 0x00 139 CHECK-NEXT: [0x0000000100000f90 - 0x0000000100000fb4) 140 141 CHECK: .debug_line contents: 142 CHECK: Dir Mod Time File Len File Name 143 CHECK-NEXT: ---- ---------- ---------- --------------------------- 144 CHECK-NEXT: file_names[ 1] 0 0x00000000 0x00000000 basic1.c 145 CHECK: Address Line Column File ISA Discriminator Flags 146 CHECK-NEXT: ------------------ ------ ------ ------ --- ------------- ------------- 147 CHECK-NEXT: 0x0000000100000f40 26 0 1 0 0 is_stmt 148 CHECK-NEXT: 0x0000000100000f44 27 10 1 0 0 is_stmt prologue_end 149 CHECK-NEXT: 0x0000000100000f49 27 3 1 0 0 150 CHECK-NEXT: 0x0000000100000f4b 27 3 1 0 0 end_sequence 151 152 CHECK: Dir Mod Time File Len File Name 153 CHECK-NEXT: ---- ---------- ---------- --------------------------- 154 CHECK-NEXT: file_names[ 1] 0 0x00000000 0x00000000 basic2.c 155 CHECK: Address Line Column File ISA Discriminator Flags 156 CHECK-NEXT: ------------------ ------ ------ ------ --- ------------- ------------- 157 CHECK-NEXT: 0x0000000100000f50 19 0 1 0 0 is_stmt 158 CHECK-NEXT: 0x0000000100000f54 20 18 1 0 0 is_stmt prologue_end 159 CHECK-NEXT: 0x0000000100000f5a 20 17 1 0 0 160 CHECK-NEXT: 0x0000000100000f5c 20 10 1 0 0 161 CHECK-NEXT: 0x0000000100000f61 15 10 1 0 0 is_stmt 162 CHECK-NEXT: 0x0000000100000f70 20 23 1 0 0 is_stmt 163 CHECK-NEXT: 0x0000000100000f74 20 36 1 0 0 164 CHECK-NEXT: 0x0000000100000f83 20 31 1 0 0 165 CHECK-NEXT: 0x0000000100000f85 20 3 1 0 0 166 CHECK-NEXT: 0x0000000100000f87 20 3 1 0 0 end_sequence 167 168 CHECK: Dir Mod Time File Len File Name 169 CHECK-NEXT: ---- ---------- ---------- --------------------------- 170 CHECK-NEXT: file_names[ 1] 0 0x00000000 0x00000000 basic3.c 171 CHECK: Address Line Column File ISA Discriminator Flags 172 CHECK-NEXT: ------------------ ------ ------ ------ --- ------------- ------------- 173 CHECK-NEXT: 0x0000000100000f90 16 0 1 0 0 is_stmt 174 CHECK-NEXT: 0x0000000100000f94 12 10 1 0 0 is_stmt prologue_end 175 CHECK-NEXT: 0x0000000100000f9a 17 7 1 0 0 is_stmt 176 CHECK-NEXT: 0x0000000100000f9f 12 10 1 0 0 is_stmt 177 CHECK-NEXT: 0x0000000100000fa7 20 1 1 0 0 is_stmt 178 CHECK-NEXT: 0x0000000100000fa9 19 18 1 0 0 is_stmt 179 CHECK-NEXT: 0x0000000100000fab 19 10 1 0 0 180 CHECK-NEXT: 0x0000000100000fb2 20 1 1 0 0 is_stmt 181 CHECK-NEXT: 0x0000000100000fb4 20 1 1 0 0 is_stmt end_sequence 182 183 CHECK: .debug_pubnames contents: 184 CHECK-NEXT: length = 0x00000017 version = 0x0002 unit_offset = 0x00000000 unit_size = 0x00000077 185 CHECK-NEXT: Offset Name 186 CHECK-NEXT: 0x0000002a "main" 187 CHECK-NEXT: length = 0x0000002e version = 0x0002 unit_offset = 0x00000077 unit_size = 0x000000a4 188 CHECK-NEXT: Offset Name 189 CHECK-NEXT: 0x00000031 "baz" 190 CHECK-NEXT: 0x00000046 "private_int" 191 CHECK-NEXT: 0x00000067 "foo" 192 CHECK-NEXT: length = 0x0000001e version = 0x0002 unit_offset = 0x0000011b unit_size = 0x00000085 193 CHECK-NEXT: Offset Name 194 CHECK-NEXT: 0x0000002a "val" 195 CHECK-NEXT: 0x00000050 "bar" 196 197 CHECK: .debug_pubtypes contents: 198 CHECK-NEXT: length = 0x00000017 version = 0x0002 unit_offset = 0x00000000 unit_size = 0x00000077 199 CHECK-NEXT: Offset Name 200 CHECK-NEXT: 0x0000006f "char" 201 CHECK-NEXT: length = 0x00000016 version = 0x0002 unit_offset = 0x00000077 unit_size = 0x000000a4 202 CHECK-NEXT: Offset Name 203 CHECK-NEXT: 0x0000002a "int" 204