xref: /llvm-project/llvm/test/DebugInfo/ARM/float-stack-arg.ll (revision 6531a78ac4b5b229bce272706593a0bc873877d7)
19cac4e6dSMatt Arsenault; RUN: llc -mtriple=armv4t-unknown-unknown -start-after=codegenprepare -stop-before=finalize-isel -o - %s | FileCheck %s
28a2e4af7SDavid Stenberg
38a2e4af7SDavid Stenberg; Verify that a stack-referencing DBG_VALUE is emitted for p5 at the start of
48a2e4af7SDavid Stenberg; the function.
58a2e4af7SDavid Stenberg;
68a2e4af7SDavid Stenberg; Reproducer for PR40777.
78a2e4af7SDavid Stenberg;
88a2e4af7SDavid Stenberg; Based on the following C reproducer:
98a2e4af7SDavid Stenberg;
108a2e4af7SDavid Stenberg;   float fn1(int p1, int p2, int p3, int p4, float p5) {
118a2e4af7SDavid Stenberg;    return p5;
128a2e4af7SDavid Stenberg;   }
138a2e4af7SDavid Stenberg;
148a2e4af7SDavid Stenberg; that was compiled using -O1 -g -S -emit-llvm.
158a2e4af7SDavid Stenberg;
168a2e4af7SDavid Stenberg; Irrelevant metadata, e.g. information about %p[1-4], has been stripped.
178a2e4af7SDavid Stenberg
188a2e4af7SDavid Stenberg; CHECK: ![[P5:[0-9]*]] = !DILocalVariable(name: "p5"
198a2e4af7SDavid Stenberg
208a2e4af7SDavid Stenbergdefine arm_aapcscc float @fn1(i32 %p1, i32 %p2, i32 %p3, i32 %p4, float returned %p5) #0 !dbg !7 {
218a2e4af7SDavid Stenberg; CHECK-LABEL: bb.0.entry:
22*6531a78aSJeremy Morse; CHECK-NEXT: DBG_VALUE %fixed-stack.0, 0, ![[P5]]
238a2e4af7SDavid Stenbergentry:
248a2e4af7SDavid Stenberg  call void @llvm.dbg.value(metadata float %p5, metadata !17, metadata !DIExpression()), !dbg !18
258a2e4af7SDavid Stenberg  ret float %p5, !dbg !19
268a2e4af7SDavid Stenberg}
278a2e4af7SDavid Stenberg
288a2e4af7SDavid Stenberg; Function Attrs: nounwind readnone speculatable
298a2e4af7SDavid Stenbergdeclare void @llvm.dbg.value(metadata, metadata, metadata) #1
308a2e4af7SDavid Stenberg
318a2e4af7SDavid Stenbergattributes #0 = { norecurse nounwind readnone }
328a2e4af7SDavid Stenbergattributes #1 = { nounwind readnone speculatable }
338a2e4af7SDavid Stenberg
348a2e4af7SDavid Stenberg!llvm.dbg.cu = !{!0}
358a2e4af7SDavid Stenberg!llvm.module.flags = !{!3, !4, !5}
368a2e4af7SDavid Stenberg!llvm.ident = !{!6}
378a2e4af7SDavid Stenberg
388a2e4af7SDavid Stenberg!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 9.0.0", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, nameTableKind: None)
398a2e4af7SDavid Stenberg!1 = !DIFile(filename: "float.c", directory: "/")
408a2e4af7SDavid Stenberg!2 = !{}
418a2e4af7SDavid Stenberg!3 = !{i32 2, !"Dwarf Version", i32 4}
428a2e4af7SDavid Stenberg!4 = !{i32 2, !"Debug Info Version", i32 3}
438a2e4af7SDavid Stenberg!5 = !{i32 1, !"min_enum_size", i32 4}
448a2e4af7SDavid Stenberg!6 = !{!"clang version 9.0.0"}
458a2e4af7SDavid Stenberg!7 = distinct !DISubprogram(name: "fn1", scope: !1, file: !1, line: 1, type: !8, scopeLine: 1, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !0, retainedNodes: !12)
468a2e4af7SDavid Stenberg!8 = !DISubroutineType(types: !9)
478a2e4af7SDavid Stenberg!9 = !{!10, !11, !11, !11, !11, !10}
488a2e4af7SDavid Stenberg!10 = !DIBasicType(name: "float", size: 32, encoding: DW_ATE_float)
498a2e4af7SDavid Stenberg!11 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
508a2e4af7SDavid Stenberg!12 = !{!17}
518a2e4af7SDavid Stenberg!17 = !DILocalVariable(name: "p5", arg: 5, scope: !7, file: !1, line: 1, type: !10)
528a2e4af7SDavid Stenberg!18 = !DILocation(line: 1, scope: !7)
538a2e4af7SDavid Stenberg!19 = !DILocation(line: 2, scope: !7)
54