1 ; Test that llvm-lto2 handles the -lto-sample-profile-file option and pass
2 ; down to the ICP correctly.
4 ; RUN: opt -module-summary < %s -o %t.bc
5 ; RUN: llvm-lto2 run -o %t.out %t.bc -save-temps \
6 ; RUN: -r %t.bc,test,px -r %t.bc,bar,x \
7 ; RUN: -lto-sample-profile-file=%S/Inputs/load-sample-prof-icp.prof
8 ; RUN: llvm-dis %t.out.1.4.opt.bc -o - | FileCheck %s
9 ; RUN: llvm-lto2 run -o %t.out %t.bc -save-temps \
10 ; RUN: -r %t.bc,test,px -r %t.bc,bar,x -use-new-pm \
11 ; RUN: -lto-sample-profile-file=%S/Inputs/load-sample-prof-icp.prof
12 ; RUN: llvm-dis %t.out.1.4.opt.bc -o - | FileCheck %s
14 target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
15 target triple = "x86_64-unknown-linux-gnu"
18 ; Checks that the call instruction is promoted to direct call and has
19 ; profile count annotated on the direct call.
20 define void @test(void ()*) !dbg !7 {
22 store void ()* %0, void ()** %2
23 %3 = load void ()*, void ()** %2
24 ; CHECK: call void @bar(),{{.*}}!prof
25 call void %3(), !dbg !10
29 declare void @bar() local_unnamed_addr
32 !llvm.module.flags = !{!3, !4, !5}
35 !0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 6.0.0 ", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !2)
36 !1 = !DIFile(filename: "test.c", directory: "/tmp")
38 !3 = !{i32 2, !"Dwarf Version", i32 4}
39 !4 = !{i32 2, !"Debug Info Version", i32 3}
40 !5 = !{i32 1, !"wchar_size", i32 4}
41 !6 = !{!"clang version 6.0.0 "}
42 !7 = distinct !DISubprogram(name: "test", scope: !1, file: !1, line: 3, type: !8, isLocal: false, isDefinition: true, scopeLine: 3, isOptimized: true, unit: !0, retainedNodes: !2)
43 !8 = !DISubroutineType(types: !9)
45 !10 = !DILocation(line: 4, column: 5, scope: !7)
46 !11 = !DILocation(line: 5, column: 1, scope: !7)