48 lines · plain
1; RUN: llc -O0 %s -stop-after=livedebugvars -o - | FileCheck %s2; This is a hand-crafted example modified after some Swift compiler output.3; Test that SelectionDAG legalization of DAG nodes with two results4; transfers debug info correctly.5 6source_filename = "/tmp/sincos.ll"7target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"8target triple = "x86_64-apple-macosx10.13.0"9 10declare float @llvm.cos.f32(float)11declare float @llvm.sin.f32(float)12declare void @llvm.dbg.value(metadata, metadata, metadata)13declare swiftcc void @g(float, float)14 15; CHECK: ![[RCOS:.*]] = !DILocalVariable(name: "rcos"16; CHECK: ![[RSIN:.*]] = !DILocalVariable(name: "rsin"17 18define hidden swiftcc void @f() #0 !dbg !8 {19entry:20 ; CHECK: CALL64pcrel32 &__sincosf_stret21 %0 = call float @llvm.cos.f32(float 1.500000e+00), !dbg !1322 ; CHECK: $xmm1 = MOVAPSrr $xmm023 call void @llvm.dbg.value(metadata float %0, metadata !15, metadata !DIExpression()), !dbg !1324 ; CHECK: DBG_VALUE {{.*}}$xmm1, {{.*}}, ![[RSIN]], !DIExpression(),25 %1 = call float @llvm.sin.f32(float 1.500000e+00), !dbg !1326 call void @llvm.dbg.value(metadata float %1, metadata !11, metadata !DIExpression()), !dbg !1327 ; CHECK: DBG_VALUE {{.*}}$xmm0, {{.*}}, ![[RCOS]], !DIExpression(),28 call void @g(float %0, float %1), !dbg !1329 ret void, !dbg !1330}31 32attributes #0 = { noinline nounwind optnone ssp uwtable "target-features"="+sse,+sse2,+sse3,+sse4.1,+ssse3,+x87" }33 34!llvm.dbg.cu = !{!0}35!llvm.module.flags = !{!3, !4}36 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)43!10 = !{null}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)48