• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; RUN: llc -simplify-mir -stop-after=machine-sink < %s -o - | FileCheck %s
2
3; ModuleID = 'test-sink-debug.cpp'
4source_filename = "test-sink-debug.cpp"
5target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
6target triple = "x86_64-unknown-linux-gnu"
7
8; Function Attrs: nounwind readnone uwtable
9define double @_Z3fooddb(double %x, double %y, i1 zeroext %c) local_unnamed_addr !dbg !7 {
10  tail call void @llvm.dbg.value(metadata double %x, metadata !13, metadata !DIExpression()), !dbg !16
11  tail call void @llvm.dbg.value(metadata double %y, metadata !14, metadata !DIExpression()), !dbg !17
12  tail call void @llvm.dbg.value(metadata i1 %c, metadata !15, metadata !DIExpression()), !dbg !18
13  %a = fdiv double %x, 3.000000e+00
14  %b = fdiv double %y, 5.000000e+00, !dbg !19
15  %cond = select i1 %c,  double %a, double %b
16; CHECK-NOT: debug-location !19
17  ret double %cond, !dbg !20
18}
19
20; Function Attrs: nounwind readnone speculatable
21declare void @llvm.dbg.value(metadata, metadata, metadata) #1
22
23attributes #1 = { nounwind readnone speculatable }
24
25!llvm.dbg.cu = !{!0}
26!llvm.module.flags = !{!3, !4, !5}
27!llvm.ident = !{!6}
28
29!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !1, producer: "clang version 6.0.0 (trunk 313291)", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !2)
30!1 = !DIFile(filename: "test-sink-debug.cpp", directory: "/tmp")
31!2 = !{}
32!3 = !{i32 2, !"Dwarf Version", i32 4}
33!4 = !{i32 2, !"Debug Info Version", i32 3}
34!5 = !{i32 1, !"wchar_size", i32 4}
35!6 = !{!"clang version 6.0.0 (trunk 313291)"}
36!7 = distinct !DISubprogram(name: "foo", linkageName: "_Z3fooddb", scope: !1, file: !1, line: 1, type: !8, isLocal: false, isDefinition: true, scopeLine: 1, flags: DIFlagPrototyped, isOptimized: true, unit: !0, retainedNodes: !12)
37!8 = !DISubroutineType(types: !9)
38!9 = !{!10, !10, !10, !11}
39!10 = !DIBasicType(name: "double", size: 64, encoding: DW_ATE_float)
40!11 = !DIBasicType(name: "bool", size: 8, encoding: DW_ATE_boolean)
41!12 = !{!13, !14, !15}
42!13 = !DILocalVariable(name: "x", arg: 1, scope: !7, file: !1, line: 1, type: !10)
43!14 = !DILocalVariable(name: "y", arg: 2, scope: !7, file: !1, line: 1, type: !10)
44!15 = !DILocalVariable(name: "c", arg: 3, scope: !7, file: !1, line: 1, type: !11)
45!16 = !DILocation(line: 1, column: 19, scope: !7)
46!17 = !DILocation(line: 1, column: 29, scope: !7)
47!18 = !DILocation(line: 1, column: 37, scope: !7)
48!19 = !DILocation(line: 2, column: 26, scope: !7)
49!20 = !DILocation(line: 2, column: 3, scope: !7)
50