xref: /llvm-project/llvm/test/DebugInfo/ARM/float-args.ll (revision d59ce7d0eaada995e1a8f262f1ff33888575332c)
1; RUN: llc -mtriple=armv7--none-eabi -filetype=obj -mattr=+vfp2 -float-abi=hard < %s | llvm-dwarfdump -debug-info - | FileCheck %s
2; RUN: llc -mtriple=armv7--none-eabi -filetype=obj -mattr=-vfp2 -float-abi=soft < %s | llvm-dwarfdump -debug-info - | FileCheck %s
3
4; Generated by clang -O1 -g from the following C source:
5; float foo(float p) {
6;   return p;
7; }
8
9; When using the soft-float calling convention, we have to look through a
10; bitcast to find the register which contains the argument.
11
12; CHECK:     0x{{[0-9a-f]*}}:  DW_TAG_formal_parameter
13; CHECK-NEXT:                      DW_AT_location
14
15define float @foo(float %p) !dbg !4 {
16entry:
17  tail call void @llvm.dbg.value(metadata float %p, metadata !9, metadata !15), !dbg !16
18  ret float %p, !dbg !18
19}
20
21declare void @llvm.dbg.value(metadata, metadata, metadata)
22
23!llvm.dbg.cu = !{!0}
24!llvm.module.flags = !{!10, !11}
25
26!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 3.8.0", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !2)
27!1 = !DIFile(filename: "test.c", directory: "")
28!2 = !{}
29!4 = distinct !DISubprogram(name: "foo", scope: !1, file: !1, line: 1, type: !5, isLocal: false, isDefinition: true, scopeLine: 1, flags: DIFlagPrototyped, isOptimized: true, unit: !0, retainedNodes: !8)
30!5 = !DISubroutineType(types: !6)
31!6 = !{!7, !7}
32!7 = !DIBasicType(name: "float", size: 32, align: 32, encoding: DW_ATE_float)
33!8 = !{!9}
34!9 = !DILocalVariable(name: "p", arg: 1, scope: !4, file: !1, line: 1, type: !7)
35!10 = !{i32 2, !"Dwarf Version", i32 4}
36!11 = !{i32 2, !"Debug Info Version", i32 3}
37!15 = !DIExpression()
38!16 = !DILocation(line: 1, column: 17, scope: !4)
39!17 = !DILocation(line: 2, column: 12, scope: !4)
40!18 = !DILocation(line: 2, column: 3, scope: !4)
41