94 lines · plain
1# RUN: llc -start-before=prologepilog -filetype=obj -o %t %s2# RUN: llvm-dwarfdump --name=obj1 %t | FileCheck %s --check-prefix=CHECKDWARF13# RUN: llvm-dwarfdump --name=obj2 %t | FileCheck %s --check-prefix=CHECKDWARF24# RUN: llvm-objdump --no-print-imm-hex -d %t | FileCheck %s --check-prefix=CHECKASM5#6# Test that the location for obj1 and obj2 in the debug information is7# the same as the location used by load instructions.8#9# CHECKDWARF1: DW_AT_location (DW_OP_fbreg -1)10# CHECKDWARF2: DW_AT_location (DW_OP_fbreg -2)11# CHECKASM: ldurb w0, [x29, #-1]12# CHECKASM: ldurb w1, [x29, #-2]13--- |14 ; ModuleID = 'wrong-callee-save-size-after-livedebugvariables.c'15 source_filename = "wrong-callee-save-size-after-livedebugvariables.c"16 target datalayout = "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128"17 target triple = "aarch64-unknown-linux-gnu"18 19 ; Function Attrs: noinline nounwind optnone20 define dso_local i8 @foo() #0 !dbg !7 {21 entry:22 %obj1 = alloca i8, align 123 %obj2 = alloca i8, align 124 %obj3 = alloca [238 x i8], align 125 ret i8 undef, !dbg !2426 }27 28 declare dso_local i8 @bar(i8, i8, ptr) #029 30 attributes #0 = { noinline nounwind optnone "frame-pointer"="all" }31 32 !llvm.dbg.cu = !{!0}33 !llvm.module.flags = !{!3, !4, !5}34 !llvm.ident = !{!6}35 36 !0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 10.0.0", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, nameTableKind: None)37 !1 = !DIFile(filename: "wrong-callee-save-size-after-livedebugvariables.c", directory: "")38 !2 = !{}39 !3 = !{i32 2, !"Dwarf Version", i32 4}40 !4 = !{i32 2, !"Debug Info Version", i32 3}41 !5 = !{i32 1, !"wchar_size", i32 4}42 !6 = !{!"clang version 10.0.0"}43 !7 = distinct !DISubprogram(name: "foo", scope: !1, file: !1, line: 3, type: !8, scopeLine: 3, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !2)44 !8 = !DISubroutineType(types: !9)45 !9 = !{!10}46 !10 = !DIBasicType(name: "char", size: 8, encoding: DW_ATE_unsigned_char)47 !11 = !DILocalVariable(name: "obj1", scope: !7, file: !1, line: 4, type: !10)48 !12 = !DILocation(line: 4, column: 8, scope: !7)49 !13 = !DILocalVariable(name: "obj2", scope: !7, file: !1, line: 5, type: !10)50 !14 = !DILocation(line: 5, column: 8, scope: !7)51 !15 = !DILocalVariable(name: "obj3", scope: !7, file: !1, line: 6, type: !16)52 !16 = !DICompositeType(tag: DW_TAG_array_type, baseType: !10, size: 1904, elements: !17)53 !17 = !{!18}54 !18 = !DISubrange(count: 238)55 !19 = !DILocation(line: 6, column: 8, scope: !7)56 !20 = !DILocation(line: 7, column: 14, scope: !7)57 !21 = !DILocation(line: 7, column: 20, scope: !7)58 !22 = !DILocation(line: 7, column: 27, scope: !7)59 !23 = !DILocation(line: 7, column: 10, scope: !7)60 !24 = !DILocation(line: 7, column: 3, scope: !7)61 62...63---64name: foo65tracksRegLiveness: true66frameInfo:67 adjustsStack: true68 hasCalls: true69fixedStack: []70stack:71 - { id: 0, name: obj1, type: default, offset: 0, size: 1, alignment: 1,72 stack-id: default, callee-saved-register: '', callee-saved-restored: true,73 local-offset: -1, debug-info-variable: '!11', debug-info-expression: '!DIExpression()',74 debug-info-location: '!12' }75 - { id: 1, name: obj2, type: default, offset: 0, size: 1, alignment: 1,76 stack-id: default, callee-saved-register: '', callee-saved-restored: true,77 local-offset: -2, debug-info-variable: '!13', debug-info-expression: '!DIExpression()',78 debug-info-location: '!14' }79 - { id: 2, name: obj3, type: default, offset: 0, size: 238, alignment: 1,80 stack-id: default, callee-saved-register: '', callee-saved-restored: true,81 local-offset: -240, debug-info-variable: '!15', debug-info-expression: '!DIExpression()',82 debug-info-location: '!19' }83body: |84 bb.1.entry:85 renamable $x2 = ADDXri %stack.2.obj3, 0, 086 renamable $w0 = LDRBBui %stack.0.obj1, 0, debug-location !20 :: (load (s8) from %ir.obj1)87 renamable $w1 = LDRBBui %stack.1.obj2, 0, debug-location !21 :: (load (s8) from %ir.obj2)88 ADJCALLSTACKDOWN 0, 0, implicit-def $sp, implicit $sp, debug-location !2389 BL @bar, csr_aarch64_aapcs, implicit-def $lr, implicit $sp, implicit killed $w0, implicit killed $w1, implicit killed $x2, implicit-def $w0, debug-location !2390 ADJCALLSTACKUP 0, 0, implicit-def $sp, implicit $sp, debug-location !2391 RET_ReallyLR implicit killed $w0, debug-location !2492 93...94