1; Check flattened profile will not be read in thinlto postlink. 2; RUN: opt < %s -passes='thinlto<O2>' -pgo-kind=pgo-sample-use-pipeline -profile-file=%S/Inputs/flattened.prof -flattened-profile-used -S | FileCheck %s 3; 4; Check flattened profile will be read in thinlto prelink. 5; RUN: opt < %s -passes='thinlto-pre-link<O2>' -pgo-kind=pgo-sample-use-pipeline -profile-file=%S/Inputs/flattened.prof -flattened-profile-used -S | FileCheck %s --check-prefix=PRELINK 6; 7; Check flattened profile will be read in non-thinlto mode. 8; RUN: opt < %s -passes='default<O2>' -pgo-kind=pgo-sample-use-pipeline -profile-file=%S/Inputs/flattened.prof -flattened-profile-used -S | FileCheck %s --check-prefix=NOTHINLTO 9; 10; CHECK-NOT: !{!"ProfileFormat", !"SampleProfile"} 11; PRELINK: !{!"ProfileFormat", !"SampleProfile"} 12; NOTHINLTO: !{!"ProfileFormat", !"SampleProfile"} 13 14target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" 15target triple = "x86_64-unknown-linux-gnu" 16 17; Function Attrs: norecurse nounwind readnone uwtable 18define dso_local i32 @foo() local_unnamed_addr !dbg !7 { 19entry: 20 ret i32 -1, !dbg !9 21} 22 23!llvm.dbg.cu = !{!0} 24!llvm.module.flags = !{!3, !4, !5} 25!llvm.ident = !{!6} 26 27!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 8.0.0 (trunk 345241)", isOptimized: true, runtimeVersion: 0, emissionKind: LineTablesOnly, enums: !2, nameTableKind: None) 28!1 = !DIFile(filename: "a.c", directory: "") 29!2 = !{} 30!3 = !{i32 2, !"Dwarf Version", i32 4} 31!4 = !{i32 2, !"Debug Info Version", i32 3} 32!5 = !{i32 1, !"wchar_size", i32 4} 33!6 = !{!"clang version 8.0.0 (trunk 345241)"} 34!7 = distinct !DISubprogram(name: "foo", scope: !1, file: !1, line: 1, type: !8, isLocal: false, isDefinition: true, scopeLine: 1, isOptimized: true, unit: !0, retainedNodes: !2) 35!8 = !DISubroutineType(types: !2) 36!9 = !DILocation(line: 2, column: 3, scope: !7) 37