| 1 |
// RUN: rm -rf %t && mkdir %t |
| 2 |
// RUN: llvm-profdata merge -o %t/a.profdata %S/Inputs/a.proftext |
| 3 |
|
| 4 |
// RUN: %clang -### -c -fprofile-use=%t/a.profdata -fcs-profile-generate %s 2>&1 | FileCheck %s |
| 5 |
// CHECK: "-fprofile-instrument=csllvm" |
| 6 |
// CHECK-NOT: "-fprofile-instrument-path= |
| 7 |
// CHECK-SAME: "-fprofile-instrument-use=llvm" |
| 8 |
// CHECK-SAME: "-fprofile-instrument-use-path={{.*}}a.profdata" |
| 9 |
|
| 10 |
// RUN: %clang -### -c -fprofile-use=%t/a.profdata -fcs-profile-generate=dir %s 2>&1 | FileCheck %s --check-prefix=CHECK1 |
| 11 |
// CHECK1: "-fprofile-instrument=csllvm"{{.*}} "-fprofile-instrument-path=dir{{/|\\\\}}default_%m.profraw" "-fprofile-instrument-use=llvm" "-fprofile-instrument-use-path={{.*}}a.profdata" |
| 12 |
|
| 13 |
/// Degradation case. This usage does not make much sense. |
| 14 |
// RUN: %clang -### -c -fcs-profile-generate %s 2>&1 | FileCheck %s --check-prefix=NOUSE |
| 15 |
// NOUSE: "-fprofile-instrument=csllvm" |
| 16 |
// NOUSE-NOT: "-fprofile-instrument-path= |
| 17 |
|
| 18 |
// RUN: not %clang -### -c -fprofile-generate -fcs-profile-generate %s 2>&1 | FileCheck %s --check-prefix=CONFLICT |
| 19 |
// CONFLICT: error: invalid argument '-fcs-profile-generate' not allowed with '-fprofile-generate' |