1 ; RUN: llc -O0 %s -stop-after=livedebugvars -o - | FileCheck %s
2 ; This is a hand-crafted example modified after some Swift compiler output.
3 ; Test that SelectionDAG legalization of DAG nodes with two results
4 ; transfers debug info correctly.
6 source_filename = "/tmp/sincos.ll"
7 target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
8 target triple = "x86_64-apple-macosx10.13.0"
10 declare float @llvm.cos.f32(float)
11 declare float @llvm.sin.f32(float)
12 declare void @llvm.dbg.value(metadata, metadata, metadata)
13 declare swiftcc void @g(float, float)
15 ; CHECK: ![[RCOS:.*]] = !DILocalVariable(name: "rcos"
16 ; CHECK: ![[RSIN:.*]] = !DILocalVariable(name: "rsin"
18 define hidden swiftcc void @f() #0 !dbg !8 {
20 ; CHECK: CALL64pcrel32 &__sincosf_stret
21 %0 = call float @llvm.cos.f32(float 1.500000e+00), !dbg !13
22 ; CHECK: $xmm1 = MOVAPSrr $xmm0
23 call void @llvm.dbg.value(metadata float %0, metadata !15, metadata !DIExpression()), !dbg !13
24 ; CHECK: DBG_VALUE {{.*}}$xmm1, {{.*}}, ![[RSIN]], !DIExpression(),
25 %1 = call float @llvm.sin.f32(float 1.500000e+00), !dbg !13
26 call void @llvm.dbg.value(metadata float %1, metadata !11, metadata !DIExpression()), !dbg !13
27 ; CHECK: DBG_VALUE {{.*}}$xmm0, {{.*}}, ![[RCOS]], !DIExpression(),
28 call void @g(float %0, float %1), !dbg !13
32 attributes #0 = { noinline nounwind optnone ssp uwtable "target-features"="+sse,+sse2,+sse3,+sse4.1,+ssse3,+x87" }
35 !llvm.module.flags = !{!3, !4}
37 !0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, emissionKind: FullDebug)
38 !1 = !DIFile(filename: "sincos.ll", directory: "/")
39 !3 = !{i32 2, !"Dwarf Version", i32 4}
40 !4 = !{i32 2, !"Debug Info Version", i32 3}
41 !8 = distinct !DISubprogram(name: "f", scope: !1, file: !1, line: 2, type: !9, isLocal: false, isDefinition: true, scopeLine: 2, isOptimized: false, unit: !0)
42 !9 = !DISubroutineType(types: !10)
44 !11 = !DILocalVariable(name: "rsin", scope: !8, file: !1, line: 3, type: !12)
45 !12 = !DIBasicType(name: "float", size: 32, encoding: DW_ATE_float)
46 !13 = !DILocation(line: 3, scope: !8)
47 !15 = !DILocalVariable(name: "rcos", scope: !8, file: !1, line: 4, type: !12)