blob: 54ca19511c086cedf6b1e2c8a3ac90f23694ec10 [file] [log] [blame]
Vedant Kumar32a014d2019-01-17 21:29:34 +00001; RUN: opt -hotcoldsplit -hotcoldsplit-threshold=0 -S < %s | FileCheck %s
Vedant Kumar15718a62018-10-15 19:22:20 +00002
Vedant Kumard2a895a2018-11-04 23:11:57 +00003target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
4target triple = "x86_64-apple-macosx10.14.0"
5
Teresa Johnsonc8dba682018-10-24 18:53:47 +00006; CHECK-LABEL: define {{.*}}@foo.cold
Vedant Kumar15718a62018-10-15 19:22:20 +00007; CHECK-NOT: llvm.dbg.value
8
9define void @foo(i32 %arg1) !dbg !6 {
10entry:
11 %var = add i32 0, 0, !dbg !11
Vedant Kumardd4be532018-10-29 19:15:39 +000012 br i1 undef, label %if.then, label %if.end
Vedant Kumar15718a62018-10-15 19:22:20 +000013
14if.then: ; preds = %entry
Vedant Kumardd4be532018-10-29 19:15:39 +000015 ret void
Vedant Kumar15718a62018-10-15 19:22:20 +000016
17if.end: ; preds = %entry
18 call void @llvm.dbg.value(metadata i32 %arg1, metadata !9, metadata !DIExpression()), !dbg !11
Vedant Kumardd4be532018-10-29 19:15:39 +000019 call void @sink()
Vedant Kumardd4be532018-10-29 19:15:39 +000020 ret void
Vedant Kumar15718a62018-10-15 19:22:20 +000021}
22
23declare void @llvm.dbg.value(metadata, metadata, metadata)
24
Vedant Kumardd4be532018-10-29 19:15:39 +000025declare void @sink() cold
26
Vedant Kumar15718a62018-10-15 19:22:20 +000027!llvm.dbg.cu = !{!0}
28!llvm.debugify = !{!3, !4}
29!llvm.module.flags = !{!5}
30
31!0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "debugify", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !2)
32!1 = !DIFile(filename: "<stdin>", directory: "/")
33!2 = !{}
34!3 = !{i32 7}
35!4 = !{i32 1}
36!5 = !{i32 2, !"Debug Info Version", i32 3}
37!6 = distinct !DISubprogram(name: "foo", linkageName: "foo", scope: null, file: !1, line: 1, type: !7, isLocal: false, isDefinition: true, scopeLine: 1, isOptimized: true, unit: !0, retainedNodes: !8)
38!7 = !DISubroutineType(types: !2)
39!8 = !{!9}
40!9 = !DILocalVariable(name: "1", scope: !6, file: !1, line: 1, type: !10)
41!10 = !DIBasicType(name: "ty32", size: 32, encoding: DW_ATE_unsigned)
42!11 = !DILocation(line: 1, column: 1, scope: !6)