83 lines · plain
1; REQUIRES: asserts2; RUN: llc -global-isel -mtriple=aarch64 %s -stop-after=irtranslator -o - | FileCheck %s3; RUN: llc -mtriple=aarch64 -global-isel --global-isel-abort=0 %s -o /dev/null4; RUN: llc -mtriple=aarch64 -global-isel --global-isel-abort=0 %s -o /dev/null -debug5;6 7; CHECK-LABEL: name: debug_declare8; CHECK: stack:9; CHECK: - { id: {{.*}}, name: in.addr, type: default, offset: 0, size: {{.*}}, alignment: {{.*}},10; CHECK-NEXT: callee-saved-register: '', callee-saved-restored: true,11; CHECK-NEXT: debug-info-variable: '!11', debug-info-expression: '!DIExpression()',12define void @debug_declare(i32 %in) #0 !dbg !7 {13entry:14 %in.addr = alloca i32, align 415 store i32 %in, ptr %in.addr, align 416 call void @llvm.dbg.declare(metadata ptr %in.addr, metadata !11, metadata !DIExpression()), !dbg !1217 ret void, !dbg !1218}19 20; CHECK-LABEL: name: debug_declare_vla21; CHECK: DBG_VALUE %{{[0-9]+}}(p0), 0, !14, !DIExpression(), debug-location !1522define void @debug_declare_vla(i32 %in) #0 !dbg !13 {23entry:24 %vla.addr = alloca i32, i32 %in25 call void @llvm.dbg.declare(metadata ptr %vla.addr, metadata !14, metadata !DIExpression()), !dbg !1526 ret void, !dbg !1527}28 29@gv = global i32 zeroinitializer30 31; CHECK-LABEL: name: debug_value32; CHECK: stack:33; CHECK: - { id: {{.*}}, name: addr34; CHECK: [[IN:%[0-9]+]]:_(s32) = COPY $w035define void @debug_value(i32 %in) #0 !dbg !16 {36; CHECK: G_FRAME_INDEX %[[stack_slot:.*]]37 %addr = alloca i3238; CHECK: DBG_VALUE [[IN]](s32), $noreg, !17, !DIExpression(), debug-location !1839 call void @llvm.dbg.value(metadata i32 %in, i64 0, metadata !17, metadata !DIExpression()), !dbg !1840 store i32 %in, ptr %addr41; CHECK: DBG_VALUE %[[stack_slot]], 0, !17, !DIExpression(), debug-location !1842 call void @llvm.dbg.value(metadata ptr %addr, i64 0, metadata !17, metadata !DIExpression(DW_OP_deref)), !dbg !1843; CHECK: DBG_VALUE 123, 0, !17, !DIExpression(), debug-location !1844 call void @llvm.dbg.value(metadata i32 123, i64 0, metadata !17, metadata !DIExpression()), !dbg !1845; CHECK: DBG_VALUE float 1.000000e+00, 0, !17, !DIExpression(), debug-location !1846 call void @llvm.dbg.value(metadata float 1.000000e+00, i64 0, metadata !17, metadata !DIExpression()), !dbg !1847; CHECK: DBG_VALUE 0, 0, !17, !DIExpression(), debug-location !1848 call void @llvm.dbg.value(metadata ptr null, i64 0, metadata !17, metadata !DIExpression()), !dbg !1849; CHECK: DBG_VALUE $noreg, 0, !17, !DIExpression(), debug-location !1850 call void @llvm.dbg.value(metadata ptr @gv, i64 0, metadata !17, metadata !DIExpression()), !dbg !1851; CHECK: DBG_VALUE 42, 0, !17, !DIExpression(), debug-location !1852 call void @llvm.dbg.value(metadata ptr inttoptr (i64 42 to ptr), i64 0, metadata !17, metadata !DIExpression()), !dbg !1853 ret void54}55 56; Function Attrs: nounwind readnone57declare void @llvm.dbg.declare(metadata, metadata, metadata)58declare void @llvm.dbg.value(metadata, i64, metadata, metadata)59 60!llvm.dbg.cu = !{!0}61!llvm.module.flags = !{!3, !4, !5}62!llvm.ident = !{!6}63 64!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 4.0.0 (trunk 289075) (llvm/trunk 289080)", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !2)65!1 = !DIFile(filename: "tmp.c", directory: "/Users/tim/llvm/build")66!2 = !{}67!3 = !{i32 2, !"Dwarf Version", i32 4}68!4 = !{i32 2, !"Debug Info Version", i32 3}69!5 = !{i32 1, !"PIC Level", i32 2}70!6 = !{!"clang version 4.0.0 (trunk 289075) (llvm/trunk 289080)"}71!7 = distinct !DISubprogram(name: "foo", scope: !1, file: !1, line: 1, type: !8, isLocal: false, isDefinition: true, scopeLine: 1, flags: DIFlagPrototyped, isOptimized: false, unit: !0, retainedNodes: !2)72!8 = !DISubroutineType(types: !9)73!9 = !{null, !10}74!10 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)75!11 = !DILocalVariable(name: "in", arg: 1, scope: !7, file: !1, line: 1, type: !10)76!12 = !DILocation(line: 1, column: 14, scope: !7)77!13 = distinct !DISubprogram(name: "foo", scope: !1, file: !1, line: 1, type: !8, isLocal: false, isDefinition: true, scopeLine: 1, flags: DIFlagPrototyped, isOptimized: false, unit: !0, retainedNodes: !2)78!14 = !DILocalVariable(name: "in", arg: 1, scope: !13, file: !1, line: 1, type: !10)79!15 = !DILocation(line: 1, column: 14, scope: !13)80!16 = distinct !DISubprogram(name: "foo", scope: !1, file: !1, line: 1, type: !8, isLocal: false, isDefinition: true, scopeLine: 1, flags: DIFlagPrototyped, isOptimized: false, unit: !0, retainedNodes: !2)81!17 = !DILocalVariable(name: "in", arg: 1, scope: !16, file: !1, line: 1, type: !10)82!18 = !DILocation(line: 1, column: 14, scope: !16)83