2016-03-01 02:54:59 +08:00
|
|
|
// Test if PGO instrumentation and use pass are invoked.
|
|
|
|
//
|
|
|
|
// Ensure Pass PGOInstrumentationGenPass is invoked.
|
2019-06-22 00:03:06 +08:00
|
|
|
// RUN: %clang_cc1 -O2 -fno-experimental-new-pass-manager -fprofile-instrument=llvm %s -mllvm -debug-pass=Structure -emit-llvm -o - 2>&1 | FileCheck %s -check-prefix=CHECK-PGOGENPASS-INVOKED-INSTR-GEN --check-prefix=CHECK-INSTRPROF
|
2019-04-26 01:52:43 +08:00
|
|
|
// RUN: %clang_cc1 -O2 -fprofile-instrument=llvm %s -fexperimental-new-pass-manager -fdebug-pass-manager -emit-llvm -o - 2>&1 | FileCheck %s -check-prefix=CHECK-PGOGENPASS-INVOKED-INSTR-GEN-NEWPM --check-prefix=CHECK-INSTRPROF-NEWPM
|
2016-03-01 02:54:59 +08:00
|
|
|
// CHECK-PGOGENPASS-INVOKED-INSTR-GEN: PGOInstrumentationGenPass
|
2019-04-26 01:52:43 +08:00
|
|
|
// CHECK-INSTRPROF: Frontend instrumentation-based coverage lowering
|
|
|
|
// CHECK-PGOGENPASS-INVOKED-INSTR-GEN-NEWPM: Running pass: PGOInstrumentationGen on
|
|
|
|
// CHECK-INSTRPROF-NEWPM: Running pass: InstrProfiling on
|
2016-03-01 02:54:59 +08:00
|
|
|
//
|
|
|
|
// Ensure Pass PGOInstrumentationGenPass is not invoked.
|
|
|
|
// RUN: %clang_cc1 -O2 -fprofile-instrument=clang %s -mllvm -debug-pass=Structure -emit-llvm -o - 2>&1 | FileCheck %s -check-prefix=CHECK-PGOGENPASS-INVOKED-INSTR-GEN-CLANG
|
2019-04-26 01:52:43 +08:00
|
|
|
// RUN: %clang_cc1 -O2 -fprofile-instrument=clang %s -fexperimental-new-pass-manager -fdebug-pass-manager -emit-llvm -o - 2>&1 | FileCheck %s -check-prefix=CHECK-PGOGENPASS-INVOKED-INSTR-GEN-CLANG-NEWPM
|
2016-03-01 02:54:59 +08:00
|
|
|
// CHECK-PGOGENPASS-INVOKED-INSTR-GEN-CLANG-NOT: PGOInstrumentationGenPass
|
2019-04-26 01:52:43 +08:00
|
|
|
// CHECK-PGOGENPASS-INVOKED-INSTR-GEN-CLANG-NEWPM-NOT: Running pass: PGOInstrumentationGen on
|
|
|
|
|
2019-06-22 00:03:06 +08:00
|
|
|
// RUN: %clang_cc1 -O2 -fno-experimental-new-pass-manager -fprofile-instrument=clang %s -mllvm -debug-pass=Structure -emit-llvm -o - 2>&1 | FileCheck %s --check-prefix=CHECK-CLANG-INSTRPROF
|
2019-04-26 01:52:43 +08:00
|
|
|
// RUN: %clang_cc1 -O2 -fprofile-instrument=clang %s -fexperimental-new-pass-manager -fdebug-pass-manager -emit-llvm -o - 2>&1 | FileCheck %s --check-prefix=CHECK-CLANG-INSTRPROF-NEWPM
|
2019-06-22 00:03:06 +08:00
|
|
|
// RUN: %clang_cc1 -O0 -fno-experimental-new-pass-manager -fprofile-instrument=clang %s -mllvm -debug-pass=Structure -emit-llvm -o - 2>&1 | FileCheck %s --check-prefix=CHECK-CLANG-INSTRPROF
|
2019-04-26 01:52:43 +08:00
|
|
|
// RUN: %clang_cc1 -O0 -fprofile-instrument=clang %s -fexperimental-new-pass-manager -fdebug-pass-manager -emit-llvm -o - 2>&1 | FileCheck %s --check-prefix=CHECK-CLANG-INSTRPROF-NEWPM
|
|
|
|
// CHECK-CLANG-INSTRPROF: Frontend instrumentation-based coverage lowering
|
|
|
|
// CHECK-CLANG-INSTRPROF-NEWPM: Running pass: InstrProfiling on
|
2016-03-03 04:59:36 +08:00
|
|
|
|
|
|
|
// Ensure Pass PGOInstrumentationUsePass is invoked.
|
|
|
|
// RUN: llvm-profdata merge -o %t.profdata %S/Inputs/pgotestir.profraw
|
2019-06-22 00:03:06 +08:00
|
|
|
// RUN: %clang_cc1 -O2 -fno-experimental-new-pass-manager -fprofile-instrument-use-path=%t.profdata %s -mllvm -debug-pass=Structure -emit-llvm -o - 2>&1 | FileCheck %s -check-prefix=CHECK-PGOUSEPASS-INVOKED-INSTR-USE
|
2019-04-26 01:52:43 +08:00
|
|
|
// RUN: %clang_cc1 -O2 -fprofile-instrument-use-path=%t.profdata %s -fexperimental-new-pass-manager -fdebug-pass-manager -emit-llvm -o - 2>&1 | FileCheck %s -check-prefix=CHECK-PGOUSEPASS-INVOKED-INSTR-USE-NEWPM
|
2016-03-03 04:59:36 +08:00
|
|
|
// CHECK-PGOUSEPASS-INVOKED-INSTR-USE: PGOInstrumentationUsePass
|
2019-04-26 01:52:43 +08:00
|
|
|
// CHECK-PGOUSEPASS-INVOKED-INSTR-USE-NEWPM: Running pass: PGOInstrumentationUse on
|
2016-03-03 04:59:36 +08:00
|
|
|
//
|
|
|
|
// Ensure Pass PGOInstrumentationUsePass is not invoked.
|
|
|
|
// RUN: llvm-profdata merge -o %t.profdata %S/Inputs/pgotestclang.profraw
|
|
|
|
// RUN: %clang_cc1 -O2 -fprofile-instrument-use-path=%t.profdata %s -mllvm -debug-pass=Structure -emit-llvm -o - 2>&1 | FileCheck %s -check-prefix=CHECK-PGOUSEPASS-INVOKED-USE-CLANG
|
2019-04-26 01:52:43 +08:00
|
|
|
// RUN: %clang_cc1 -O2 -fprofile-instrument-use-path=%t.profdata %s -fexperimental-new-pass-manager -fdebug-pass-manager -emit-llvm -o - 2>&1 | FileCheck %s -check-prefix=CHECK-PGOUSEPASS-INVOKED-USE-CLANG-NEWPM
|
2016-03-03 04:59:36 +08:00
|
|
|
// CHECK-PGOUSEPASS-INVOKED-USE-CLANG-NOT: PGOInstrumentationUsePass
|
2019-04-26 01:52:43 +08:00
|
|
|
// CHECK-PGOUSEPASS-INVOKED-USE-CLANG-NEWPM-NOT: Running pass: PGOInstrumentationUse on
|