279 lines · plain
1# Regression test for:2# - Instructions at DW_AT_high_pc of a scope incorrectly included in the scope3 4# clang test.cpp --target=i686-pc-linux -g -O05# 16# 2 int main(void) {7# 3 float ret = 0;8# 4 for (int i = 0; i < 10; i++) {9# 5 ret += i;10# 6 }11# 7 return ret;12# 8 }13# 914 15# REQUIRES: x86-registered-target16 17# RUN: llvm-mc %s -triple=i686-pc-linux -filetype=obj -o - | \18# RUN: llvm-debuginfo-analyzer --attribute=all \19# RUN: --print=all \20# RUN: --output-sort=offset \21# RUN: - | \22# RUN: FileCheck %s23 24# Make sure the line mapping at 0x3c does not show up at the scope level 00425# CHECK-NOT: [0x000000003c][004] 7 {Line}26 27# Make sure it *does* appear at scope level 00328# CHECK: [0x000000003c][003] 7 {Line}29 30 .file "compile.cpp"31 .text32 .globl main # -- Begin function main33 .p2align 434 .type main,@function35main: # @main36.Lfunc_begin0:37 .file 0 "test.cpp"38 .loc 0 2 039 .cfi_startproc40# %bb.0: # %entry41 pushl %ebp42 .cfi_def_cfa_offset 843 .cfi_offset %ebp, -844 movl %esp, %ebp45 .cfi_def_cfa_register %ebp46 subl $12, %esp47 movl $0, -4(%ebp)48.Ltmp0:49 .loc 0 3 15 prologue_end50 xorps %xmm0, %xmm051 movss %xmm0, -8(%ebp)52.Ltmp1:53 .loc 0 4 1854 movl $0, -12(%ebp)55.LBB0_1: # %for.cond56 # =>This Inner Loop Header: Depth=157.Ltmp2:58 .loc 0 4 27 is_stmt 059 cmpl $10, -12(%ebp)60.Ltmp3:61 .loc 0 4 962 jge .LBB0_463# %bb.2: # %for.body64 # in Loop: Header=BB0_1 Depth=165.Ltmp4:66 .loc 0 5 18 is_stmt 167 cvtsi2ssl -12(%ebp), %xmm068 .loc 0 5 15 is_stmt 069 addss -8(%ebp), %xmm070 movss %xmm0, -8(%ebp)71.Ltmp5:72# %bb.3: # %for.inc73 # in Loop: Header=BB0_1 Depth=174 .loc 0 4 34 is_stmt 175 movl -12(%ebp), %eax76 addl $1, %eax77 movl %eax, -12(%ebp)78 .loc 0 4 9 is_stmt 079 jmp .LBB0_180.Ltmp6:81.LBB0_4: # %for.end82 .loc 0 7 16 is_stmt 183 cvttss2si -8(%ebp), %eax84 .loc 0 7 9 epilogue_begin is_stmt 085 addl $12, %esp86 popl %ebp87 .cfi_def_cfa %esp, 488 retl89.Ltmp7:90.Lfunc_end0:91 .size main, .Lfunc_end0-main92 .cfi_endproc93 # -- End function94 .section .debug_abbrev,"",@progbits95 .byte 1 # Abbreviation Code96 .byte 17 # DW_TAG_compile_unit97 .byte 1 # DW_CHILDREN_yes98 .byte 37 # DW_AT_producer99 .byte 37 # DW_FORM_strx1100 .byte 19 # DW_AT_language101 .byte 5 # DW_FORM_data2102 .byte 3 # DW_AT_name103 .byte 37 # DW_FORM_strx1104 .byte 114 # DW_AT_str_offsets_base105 .byte 23 # DW_FORM_sec_offset106 .byte 16 # DW_AT_stmt_list107 .byte 23 # DW_FORM_sec_offset108 .byte 27 # DW_AT_comp_dir109 .byte 37 # DW_FORM_strx1110 .byte 17 # DW_AT_low_pc111 .byte 27 # DW_FORM_addrx112 .byte 18 # DW_AT_high_pc113 .byte 6 # DW_FORM_data4114 .byte 115 # DW_AT_addr_base115 .byte 23 # DW_FORM_sec_offset116 .byte 0 # EOM(1)117 .byte 0 # EOM(2)118 .byte 2 # Abbreviation Code119 .byte 46 # DW_TAG_subprogram120 .byte 1 # DW_CHILDREN_yes121 .byte 17 # DW_AT_low_pc122 .byte 27 # DW_FORM_addrx123 .byte 18 # DW_AT_high_pc124 .byte 6 # DW_FORM_data4125 .byte 64 # DW_AT_frame_base126 .byte 24 # DW_FORM_exprloc127 .byte 3 # DW_AT_name128 .byte 37 # DW_FORM_strx1129 .byte 58 # DW_AT_decl_file130 .byte 11 # DW_FORM_data1131 .byte 59 # DW_AT_decl_line132 .byte 11 # DW_FORM_data1133 .byte 73 # DW_AT_type134 .byte 19 # DW_FORM_ref4135 .byte 63 # DW_AT_external136 .byte 25 # DW_FORM_flag_present137 .byte 0 # EOM(1)138 .byte 0 # EOM(2)139 .byte 3 # Abbreviation Code140 .byte 52 # DW_TAG_variable141 .byte 0 # DW_CHILDREN_no142 .byte 2 # DW_AT_location143 .byte 24 # DW_FORM_exprloc144 .byte 3 # DW_AT_name145 .byte 37 # DW_FORM_strx1146 .byte 58 # DW_AT_decl_file147 .byte 11 # DW_FORM_data1148 .byte 59 # DW_AT_decl_line149 .byte 11 # DW_FORM_data1150 .byte 73 # DW_AT_type151 .byte 19 # DW_FORM_ref4152 .byte 0 # EOM(1)153 .byte 0 # EOM(2)154 .byte 4 # Abbreviation Code155 .byte 11 # DW_TAG_lexical_block156 .byte 1 # DW_CHILDREN_yes157 .byte 17 # DW_AT_low_pc158 .byte 27 # DW_FORM_addrx159 .byte 18 # DW_AT_high_pc160 .byte 6 # DW_FORM_data4161 .byte 0 # EOM(1)162 .byte 0 # EOM(2)163 .byte 5 # Abbreviation Code164 .byte 36 # DW_TAG_base_type165 .byte 0 # DW_CHILDREN_no166 .byte 3 # DW_AT_name167 .byte 37 # DW_FORM_strx1168 .byte 62 # DW_AT_encoding169 .byte 11 # DW_FORM_data1170 .byte 11 # DW_AT_byte_size171 .byte 11 # DW_FORM_data1172 .byte 0 # EOM(1)173 .byte 0 # EOM(2)174 .byte 0 # EOM(3)175 .section .debug_info,"",@progbits176.Lcu_begin0:177 .long .Ldebug_info_end0-.Ldebug_info_start0 # Length of Unit178.Ldebug_info_start0:179 .short 5 # DWARF version number180 .byte 1 # DWARF Unit Type181 .byte 4 # Address Size (in bytes)182 .long .debug_abbrev # Offset Into Abbrev. Section183 .byte 1 # Abbrev [1] 0xc:0x4d DW_TAG_compile_unit184 .byte 0 # DW_AT_producer185 .short 33 # DW_AT_language186 .byte 1 # DW_AT_name187 .long .Lstr_offsets_base0 # DW_AT_str_offsets_base188 .long .Lline_table_start0 # DW_AT_stmt_list189 .byte 2 # DW_AT_comp_dir190 .byte 0 # DW_AT_low_pc191 .long .Lfunc_end0-.Lfunc_begin0 # DW_AT_high_pc192 .long .Laddr_table_base0 # DW_AT_addr_base193 .byte 2 # Abbrev [2] 0x23:0x2d DW_TAG_subprogram194 .byte 0 # DW_AT_low_pc195 .long .Lfunc_end0-.Lfunc_begin0 # DW_AT_high_pc196 .byte 1 # DW_AT_frame_base197 .byte 85198 .byte 3 # DW_AT_name199 .byte 0 # DW_AT_decl_file200 .byte 2 # DW_AT_decl_line201 .long 80 # DW_AT_type202 # DW_AT_external203 .byte 3 # Abbrev [3] 0x32:0xb DW_TAG_variable204 .byte 2 # DW_AT_location205 .byte 145206 .byte 120207 .byte 5 # DW_AT_name208 .byte 0 # DW_AT_decl_file209 .byte 3 # DW_AT_decl_line210 .long 84 # DW_AT_type211 .byte 4 # Abbrev [4] 0x3d:0x12 DW_TAG_lexical_block212 .byte 1 # DW_AT_low_pc213 .long .Ltmp6-.Ltmp1 # DW_AT_high_pc214 .byte 3 # Abbrev [3] 0x43:0xb DW_TAG_variable215 .byte 2 # DW_AT_location216 .byte 145217 .byte 116218 .byte 7 # DW_AT_name219 .byte 0 # DW_AT_decl_file220 .byte 4 # DW_AT_decl_line221 .long 80 # DW_AT_type222 .byte 0 # End Of Children Mark223 .byte 0 # End Of Children Mark224 .byte 5 # Abbrev [5] 0x50:0x4 DW_TAG_base_type225 .byte 4 # DW_AT_name226 .byte 5 # DW_AT_encoding227 .byte 4 # DW_AT_byte_size228 .byte 5 # Abbrev [5] 0x54:0x4 DW_TAG_base_type229 .byte 6 # DW_AT_name230 .byte 4 # DW_AT_encoding231 .byte 4 # DW_AT_byte_size232 .byte 0 # End Of Children Mark233.Ldebug_info_end0:234 .section .debug_str_offsets,"",@progbits235 .long 36 # Length of String Offsets Set236 .short 5237 .short 0238.Lstr_offsets_base0:239 .section .debug_str,"MS",@progbits,1240.Linfo_string0:241 .asciz "clang version 22.0.0" # string offset=0242.Linfo_string1:243 .asciz "test.cpp" # string offset=113244.Linfo_string2:245 .asciz "F:\\llvm-project" # string offset=142246.Linfo_string3:247 .asciz "main" # string offset=158248.Linfo_string4:249 .asciz "int" # string offset=163250.Linfo_string5:251 .asciz "ret" # string offset=167252.Linfo_string6:253 .asciz "float" # string offset=171254.Linfo_string7:255 .asciz "i" # string offset=177256 .section .debug_str_offsets,"",@progbits257 .long .Linfo_string0258 .long .Linfo_string1259 .long .Linfo_string2260 .long .Linfo_string3261 .long .Linfo_string4262 .long .Linfo_string5263 .long .Linfo_string6264 .long .Linfo_string7265 .section .debug_addr,"",@progbits266 .long .Ldebug_addr_end0-.Ldebug_addr_start0 # Length of contribution267.Ldebug_addr_start0:268 .short 5 # DWARF version number269 .byte 4 # Address size270 .byte 0 # Segment selector size271.Laddr_table_base0:272 .long .Lfunc_begin0273 .long .Ltmp1274.Ldebug_addr_end0:275 .ident "clang version 22.0.0"276 .section ".note.GNU-stack","",@progbits277 .section .debug_line,"",@progbits278.Lline_table_start0:279