1; RUN: opt -debug-pass-manager -passes='default<O2>' -pgo-kind=new-pm-pgo-instr-gen-pipeline -profile-file='temp' %s 2>&1 |FileCheck %s --check-prefixes=GEN
2; RUN: llvm-profdata merge %S/Inputs/new-pm-pgo.proftext -o %t.profdata
3; RUN: opt -debug-pass-manager -passes='default<O2>' -pgo-kind=new-pm-pgo-instr-use-pipeline -profile-file='%t.profdata' %s 2>&1 |FileCheck %s --check-prefixes=USE
4; RUN: opt -debug-pass-manager -passes='default<O2>' -pgo-kind=new-pm-pgo-sample-use-pipeline -profile-file='%S/Inputs/new-pm-pgo.prof' %s 2>&1 \
5; RUN:     |FileCheck %s --check-prefixes=SAMPLE_USE,SAMPLE_USE_O
6; RUN: opt -debug-pass-manager -passes='thinlto-pre-link<O2>' -pgo-kind=new-pm-pgo-sample-use-pipeline -profile-file='%S/Inputs/new-pm-pgo.prof' %s 2>&1 \
7; RUN:     |FileCheck %s --check-prefixes=SAMPLE_USE,SAMPLE_USE_PRE_LINK
8; RUN: opt -debug-pass-manager -passes='thinlto<O2>' -pgo-kind=new-pm-pgo-sample-use-pipeline -profile-file='%S/Inputs/new-pm-pgo.prof' %s 2>&1 \
9; RUN:     |FileCheck %s --check-prefixes=SAMPLE_USE,SAMPLE_USE_POST_LINK
10; RUN: opt -debug-pass-manager -passes='default<O2>' -new-pm-debug-info-for-profiling %s 2>&1 |FileCheck %s --check-prefixes=SAMPLE_GEN
11;
12; GEN: Running pass: PGOInstrumentationGen
13; USE: Running pass: PGOInstrumentationUse
14; USE: Running pass: PGOIndirectCallPromotion
15; USE: Running pass: PGOMemOPSizeOpt
16; SAMPLE_USE_O: Running pass: ModuleToFunctionPassAdaptor<{{.*}}AddDiscriminatorsPass{{.*}}>
17; SAMPLE_USE_PRE_LINK: Running pass: ModuleToFunctionPassAdaptor<{{.*}}AddDiscriminatorsPass{{.*}}>
18; SAMPLE_USE: Running pass: SimplifyCFGPass
19; SAMPLE_USE: Running pass: SROA
20; SAMPLE_USE: Running pass: EarlyCSEPass
21; SAMPLE_USE: Running pass: LowerExpectIntrinsicPass
22; SAMPLE_USE_POST_LINK: Running pass: InstCombinePass
23; SAMPLE_USE: Running pass: SampleProfileLoaderPass
24; SAMPLE_USE_O: Running pass: PGOIndirectCallPromotion
25; SAMPLE_USE_POST_LINK-NOT: Running pass: GlobalOptPass
26; SAMPLE_USE_POST_LINK: Running pass: PGOIndirectCallPromotion
27; SAMPLE_GEN: Running pass: ModuleToFunctionPassAdaptor<{{.*}}AddDiscriminatorsPass{{.*}}>
28
29define void @foo() {
30  ret void
31}
32