1; Test that LTO pipeline loads profile. 2; 3; RUN: opt < %s -o %t.bc 4 5; Run the old pm LTO pipeline. 6; RUN: llvm-lto2 run -o %t.out %t.bc -save-temps \ 7; RUN: -r %t.bc,foo,px -r %t.bc,bar,x \ 8; RUN: -lto-sample-profile-file=%S/Inputs/load-sample-prof.prof 9; RUN: llvm-dis %t.out.0.4.opt.bc -o - | FileCheck %s 10 11; Run the new pm LTO pipeline. 12; RUN: llvm-lto2 run -o %t.out %t.bc -save-temps -use-new-pm \ 13; RUN: -r %t.bc,foo,px -r %t.bc,bar,x \ 14; RUN: -lto-sample-profile-file=%S/Inputs/load-sample-prof.prof 15; RUN: llvm-dis %t.out.0.4.opt.bc -o - | FileCheck %s 16 17; Make sure profile information is attached. 18; CHECK: !prof 19 20target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" 21target triple = "x86_64-unknown-linux-gnu" 22 23define void @foo() #0 !dbg !7 { 24entry: 25 tail call void @bar(), !dbg !10 26 ret void, !dbg !11 27} 28 29declare void @bar() local_unnamed_addr 30 31attributes #0 = {"local_unnamed_addr" "use-sample-profile"} 32 33!llvm.dbg.cu = !{!0} 34!llvm.module.flags = !{!3, !4, !5} 35!llvm.ident = !{!6} 36 37!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 6.0.0 ", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !2) 38!1 = !DIFile(filename: "test.c", directory: "/tmp") 39!2 = !{} 40!3 = !{i32 2, !"Dwarf Version", i32 4} 41!4 = !{i32 2, !"Debug Info Version", i32 3} 42!5 = !{i32 1, !"wchar_size", i32 4} 43!6 = !{!"clang version 6.0.0 "} 44!7 = distinct !DISubprogram(name: "foo", scope: !1, file: !1, line: 3, type: !8, isLocal: false, isDefinition: true, scopeLine: 3, isOptimized: true, unit: !0, retainedNodes: !2) 45!8 = !DISubroutineType(types: !9) 46!9 = !{null} 47!10 = !DILocation(line: 4, column: 5, scope: !7) 48!11 = !DILocation(line: 5, column: 1, scope: !7) 49