79 lines · plain
1; RUN: llc -mtriple=s390x-linux-gnu -frame-pointer=all < %s | FileCheck %s2; RUN: llc -mtriple=s390x-linux-gnu -frame-pointer=all -filetype=obj < %s \3; RUN: | llvm-dwarfdump -v -debug-info - | FileCheck --check-prefix=DEBUG %s4;5; This is a regression test making sure the location of variables is correct in6; debugging information, even if they're addressed via the frame pointer.7; Originally a copy of the AArch64 test, commandeered for SystemZ.8;9; First make sure main_arr is where we expect it: %r11 + 16410;11; CHECK: main:12; CHECK: aghi %r15, -56813; CHECK: la %r2, 168(%r11)14; CHECK: brasl %r14, populate_array@PLT15 16; DEBUG: DW_TAG_variable17; DEBUG-NOT: DW_TAG18; DEBUG: DW_AT_location {{.*}}(DW_OP_fbreg +168)19; DEBUG-NOT: DW_TAG20; DEBUG: DW_AT_name {{.*}} "main_arr"21 22 23@.str = private unnamed_addr constant [13 x i8] c"Total is %d\0A\00", align 224 25declare void @populate_array(ptr, i32) nounwind26 27declare void @llvm.dbg.declare(metadata, metadata, metadata) nounwind readnone28 29declare i32 @sum_array(ptr, i32) nounwind30 31define i32 @main() nounwind !dbg !14 {32entry:33 %retval = alloca i32, align 434 %main_arr = alloca [100 x i32], align 435 %val = alloca i32, align 436 store volatile i32 0, ptr %retval37 call void @llvm.dbg.declare(metadata ptr %main_arr, metadata !17, metadata !DIExpression()), !dbg !2238 call void @llvm.dbg.declare(metadata ptr %val, metadata !23, metadata !DIExpression()), !dbg !2439 call void @populate_array(ptr %main_arr, i32 100), !dbg !2540 %call = call i32 @sum_array(ptr %main_arr, i32 100), !dbg !2641 store i32 %call, ptr %val, align 4, !dbg !2642 %0 = load i32, ptr %val, align 4, !dbg !2743 %call2 = call i32 (ptr, ...) @printf(ptr @.str, i32 %0), !dbg !2744 ret i32 0, !dbg !2845}46 47declare i32 @printf(ptr, ...)48 49!llvm.dbg.cu = !{!0}50!llvm.module.flags = !{!30}51 52!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.2 ", isOptimized: false, emissionKind: FullDebug, file: !29, enums: !1, retainedTypes: !1, globals: !1, imports: !1)53!1 = !{}54!5 = distinct !DISubprogram(name: "populate_array", line: 4, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, unit: !0, scopeLine: 4, file: !29, scope: !6, type: !7, retainedNodes: !1)55!6 = !DIFile(filename: "simple.c", directory: "/home/timnor01/a64-trunk/build")56!7 = !DISubroutineType(types: !8)57!8 = !{null, !9, !10}58!9 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, baseType: !10)59!10 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed)60!11 = distinct !DISubprogram(name: "sum_array", line: 9, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, unit: !0, scopeLine: 9, file: !29, scope: !6, type: !12, retainedNodes: !1)61!12 = !DISubroutineType(types: !13)62!13 = !{!10, !9, !10}63!14 = distinct !DISubprogram(name: "main", line: 18, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, unit: !0, scopeLine: 18, file: !29, scope: !6, type: !15, retainedNodes: !1)64!15 = !DISubroutineType(types: !16)65!16 = !{!10}66!17 = !DILocalVariable(name: "main_arr", line: 19, scope: !18, file: !6, type: !19)67!18 = distinct !DILexicalBlock(line: 18, column: 16, file: !29, scope: !14)68!19 = !DICompositeType(tag: DW_TAG_array_type, size: 3200, align: 32, baseType: !10, elements: !{!20})69!20 = !DISubrange(count: 99)70!22 = !DILocation(line: 19, column: 7, scope: !18)71!23 = !DILocalVariable(name: "val", line: 20, scope: !18, file: !6, type: !10)72!24 = !DILocation(line: 20, column: 7, scope: !18)73!25 = !DILocation(line: 22, column: 3, scope: !18)74!26 = !DILocation(line: 23, column: 9, scope: !18)75!27 = !DILocation(line: 24, column: 3, scope: !18)76!28 = !DILocation(line: 26, column: 3, scope: !18)77!29 = !DIFile(filename: "simple.c", directory: "/home/timnor01/a64-trunk/build")78!30 = !{i32 1, !"Debug Info Version", i32 3}79