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,px -r %t.bc,externfunc,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
10 target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
11 target triple = "x86_64-unknown-linux-gnu"
14 ; Checks that the call instruction is promoted to direct call and has
15 ; profile count annotated on the direct call.
16 define void @test(ptr) #0 !dbg !7 {
20 ; CHECK: call void @bar(),{{.*}}!prof
21 call void %3(), !dbg !10
25 declare void @externfunc()
27 define void @bar() #0 {
28 call void @externfunc()
32 attributes #0 = {"use-sample-profile" noinline}
35 !llvm.module.flags = !{!3, !4, !5}
38 !0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 6.0.0 ", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !2)
39 !1 = !DIFile(filename: "test.c", directory: "/tmp")
41 !3 = !{i32 2, !"Dwarf Version", i32 4}
42 !4 = !{i32 2, !"Debug Info Version", i32 3}
43 !5 = !{i32 1, !"wchar_size", i32 4}
44 !6 = !{!"clang version 6.0.0 "}
45 !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)
46 !8 = !DISubroutineType(types: !9)
48 !10 = !DILocation(line: 4, column: 5, scope: !7)
49 !11 = !DILocation(line: 5, column: 1, scope: !7)