1; RUN: llc -filetype=asm < %s | FileCheck %s
2; RUN: llc -filetype=obj < %s \
3; RUN:   | llvm-dwarfdump -debug-info - | FileCheck %s --check-prefix=DWARF
4;
5; CHECK: @DEBUG_VALUE: h:x <- [DW_OP_plus_uconst {{.*}}] [$r{{.*}}+0]
6; DWARF: DW_TAG_formal_parameter
7; DWARF:       DW_AT_location
8; DWARF-NEXT:    DW_OP_reg0 R0
9; DWARF: DW_TAG_formal_parameter
10; DWARF:       DW_AT_location
11; DWARF-NEXT:    DW_OP_reg1 R1
12; DWARF: DW_TAG_formal_parameter
13; DWARF:       DW_AT_location
14; DWARF-NEXT:    DW_OP_reg2 R2
15; DWARF: DW_TAG_formal_parameter
16; DWARF:       DW_AT_location
17; DWARF-NEXT:    DW_OP_reg3 R3
18; DWARF: DW_TAG_formal_parameter
19; DWARF: DW_AT_location
20; DWARF-NEXT: DW_OP_breg7 R7+8
21; generated from:
22; clang -cc1 -triple  thumbv7 -S -O1 arm.cpp  -g
23;
24; int f();
25; void g(float);
26; void h(int, int, int, int, float x) {
27;    g(x = f());
28; }
29;
30target datalayout = "e-p:32:32:32-i1:8:32-i8:8:32-i16:16:32-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:64:128-a0:0:32-n32-S64"
31target triple = "thumbv7-apple-ios"
32
33; Function Attrs: nounwind
34define arm_aapcscc void @_Z1hiiiif(i32, i32, i32, i32, float %x) #0 "no-frame-pointer-elim"="true" !dbg !4 {
35entry:
36  tail call void @llvm.dbg.value(metadata i32 %0, metadata !12, metadata !DIExpression()), !dbg !18
37  tail call void @llvm.dbg.value(metadata i32 %1, metadata !13, metadata !DIExpression()), !dbg !18
38  tail call void @llvm.dbg.value(metadata i32 %2, metadata !14, metadata !DIExpression()), !dbg !18
39  tail call void @llvm.dbg.value(metadata i32 %3, metadata !15, metadata !DIExpression()), !dbg !18
40  tail call void @llvm.dbg.value(metadata float %x, metadata !16, metadata !DIExpression()), !dbg !18
41  %call = tail call arm_aapcscc i32 @_Z1fv() #3, !dbg !19
42  %conv = sitofp i32 %call to float, !dbg !19
43  tail call void @llvm.dbg.value(metadata float %conv, metadata !16, metadata !DIExpression()), !dbg !19
44  tail call arm_aapcscc void @_Z1gf(float %conv) #3, !dbg !19
45  ret void, !dbg !20
46}
47
48declare arm_aapcscc void @_Z1gf(float)
49
50declare arm_aapcscc i32 @_Z1fv()
51
52; Function Attrs: nounwind readnone
53declare void @llvm.dbg.value(metadata, metadata, metadata) #2
54
55attributes #0 = { nounwind  }
56attributes #2 = { nounwind readnone }
57attributes #3 = { nounwind }
58
59!llvm.dbg.cu = !{!0}
60!llvm.module.flags = !{!17, !21}
61
62!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.4 (trunk 190804) (llvm/trunk 190797)", isOptimized: true, emissionKind: FullDebug, file: !1, enums: !2, retainedTypes: !2, globals: !2, imports: !2)
63!1 = !DIFile(filename: "/<unknown>", directory: "")
64!2 = !{}
65!4 = distinct !DISubprogram(name: "h", linkageName: "_Z1hiiiif", line: 3, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, unit: !0, scopeLine: 3, file: !5, scope: !6, type: !7, retainedNodes: !11)
66!5 = !DIFile(filename: "/arm.cpp", directory: "")
67!6 = !DIFile(filename: "/arm.cpp", directory: "")
68!7 = !DISubroutineType(types: !8)
69!8 = !{null, !9, !9, !9, !9, !10}
70!9 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
71!10 = !DIBasicType(tag: DW_TAG_base_type, name: "float", size: 32, align: 32, encoding: DW_ATE_float)
72!11 = !{!12, !13, !14, !15, !16}
73!12 = !DILocalVariable(name: "", line: 3, arg: 1, scope: !4, file: !6, type: !9)
74!13 = !DILocalVariable(name: "", line: 3, arg: 2, scope: !4, file: !6, type: !9)
75!14 = !DILocalVariable(name: "", line: 3, arg: 3, scope: !4, file: !6, type: !9)
76!15 = !DILocalVariable(name: "", line: 3, arg: 4, scope: !4, file: !6, type: !9)
77!16 = !DILocalVariable(name: "x", line: 3, arg: 5, scope: !4, file: !6, type: !10)
78!17 = !{i32 2, !"Dwarf Version", i32 4}
79!18 = !DILocation(line: 3, scope: !4)
80!19 = !DILocation(line: 4, scope: !4)
81!20 = !DILocation(line: 5, scope: !4)
82!21 = !{i32 1, !"Debug Info Version", i32 3}
83