Rong Xu | 522b5cb | 2016-02-29 18:54:59 +0000 | [diff] [blame] | 1 | // Test if PGO instrumentation and use pass are invoked. |
| 2 | // |
| 3 | // Ensure Pass PGOInstrumentationGenPass is invoked. |
| 4 | // RUN: %clang_cc1 -O2 -fprofile-instrument=llvm %s -mllvm -debug-pass=Structure -emit-llvm -o - 2>&1 | FileCheck %s -check-prefix=CHECK-PGOGENPASS-INVOKED-INSTR-GEN |
| 5 | // CHECK-PGOGENPASS-INVOKED-INSTR-GEN: PGOInstrumentationGenPass |
| 6 | // |
| 7 | // Ensure Pass PGOInstrumentationGenPass is not invoked. |
| 8 | // 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 |
| 9 | // CHECK-PGOGENPASS-INVOKED-INSTR-GEN-CLANG-NOT: PGOInstrumentationGenPass |
Rong Xu | 9c6f153 | 2016-03-02 20:59:36 +0000 | [diff] [blame] | 10 | |
| 11 | // Ensure Pass PGOInstrumentationUsePass is invoked. |
| 12 | // RUN: llvm-profdata merge -o %t.profdata %S/Inputs/pgotestir.profraw |
| 13 | // 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-INSTR-USE |
| 14 | // CHECK-PGOUSEPASS-INVOKED-INSTR-USE: PGOInstrumentationUsePass |
| 15 | // |
| 16 | // Ensure Pass PGOInstrumentationUsePass is not invoked. |
| 17 | // RUN: llvm-profdata merge -o %t.profdata %S/Inputs/pgotestclang.profraw |
| 18 | // 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 |
| 19 | // CHECK-PGOUSEPASS-INVOKED-USE-CLANG-NOT: PGOInstrumentationUsePass |
| 20 | |