| 1 |
// RUN: rm -rf %t && mkdir %t |
| 2 |
// RUN: llvm-profdata merge -o %t/default.profdata %S/Inputs/a.proftext |
| 3 |
|
| 4 |
// RUN: %clang -### --target=x86_64 -fprofile-use=%t/default.profdata -fsplit-machine-functions %s 2>&1 | FileCheck %s --check-prefixes=CHECK,LTO-NEG |
| 5 |
// RUN: %clang -### --target=aarch64 -fprofile-use=%t/default.profdata -fsplit-machine-functions %s 2>&1 | FileCheck %s --check-prefixes=CHECK,LTO-NEG |
| 6 |
// RUN: %clang -### --target=x86_64 -fprofile-use=%t/default.profdata -fsplit-machine-functions -fno-split-machine-functions %s -c 2>&1 | FileCheck -check-prefix=NEG %s |
| 7 |
|
| 8 |
// CHECK: "-fsplit-machine-functions" |
| 9 |
// CHECK-SAME: "-fprofile-instrument-use=llvm" |
| 10 |
// CHECK-SAME: "-fprofile-instrument-use-path={{.*}}default.profdata" |
| 11 |
|
| 12 |
// NEG-NOT: "-fsplit-machine-functions" |
| 13 |
|
| 14 |
// RUN: %clang -### --target=x86_64-linux -flto -fsplit-machine-functions %s 2>&1 | FileCheck %s --check-prefix=LTO |
| 15 |
// RUN: %clang -### --target=x86_64-linux -flto -fsplit-machine-functions -fno-split-machine-functions %s 2>&1 | FileCheck %s --check-prefix=LTO-NEG |
| 16 |
|
| 17 |
// LTO: "-plugin-opt=-split-machine-functions" |
| 18 |
// LTO-NEG-NOT: "-plugin-opt=-split-machine-functions" |
| 19 |
|
| 20 |
// RUN: not %clang -### -c --target=arm-unknown-linux -fsplit-machine-functions %s 2>&1 | FileCheck %s --check-prefix=ERR |
| 21 |
// ERR: error: unsupported option '-fsplit-machine-functions' for target |
| 22 |
|
| 23 |
// RUN: %clang -### --target=arm-unknown-linux -fsplit-machine-functions -fno-split-machine-functions %s |