diff --git a/clang/test/Driver/fsplit-machine-functions.c b/clang/test/Driver/fsplit-machine-functions.c index 577c87abd129a..f77118a440e31 100644 --- a/clang/test/Driver/fsplit-machine-functions.c +++ b/clang/test/Driver/fsplit-machine-functions.c @@ -1,10 +1,20 @@ -// REQUIRES: arm-registered-target +// RUN: %clang -### --target=x86_64 -fprofile-use=default.profdata -fsplit-machine-functions %s 2>&1 | FileCheck %s --check-prefixes=CHECK,LTO-NEG +// RUN: %clang -### --target=x86_64 -fprofile-use=default.profdata -fsplit-machine-functions -fno-split-machine-functions %s -c 2>&1 | FileCheck -check-prefix=NEG %s -// RUN: %clang -### -target x86_64 -fprofile-use=default.profdata -fsplit-machine-functions %s -c 2>&1 | FileCheck -check-prefix=CHECK-OPT %s -// RUN: %clang -### -target x86_64 -fsplit-machine-functions %s -c 2>&1 | FileCheck -check-prefix=CHECK-OPT %s -// RUN: %clang -### -target x86_64 -fprofile-use=default.profdata -fsplit-machine-functions -fno-split-machine-functions %s -c 2>&1 | FileCheck -check-prefix=CHECK-NOOPT %s -// RUN: not %clang -c -target arm-unknown-linux -fsplit-machine-functions %s 2>&1 | FileCheck -check-prefix=CHECK-TRIPLE %s +// CHECK: "-fsplit-machine-functions" +// CHECK-SAME: "-fprofile-instrument-use-path=default.profdata" -// CHECK-OPT: "-fsplit-machine-functions" -// CHECK-NOOPT-NOT: "-fsplit-machine-functions" -// CHECK-TRIPLE: error: unsupported option '-fsplit-machine-functions' for target +// NEG-NOT: "-fsplit-machine-functions" + +// RUN: %clang -### --target=x86_64-linux -flto -fsplit-machine-functions %s 2>&1 | FileCheck %s --check-prefix=LTO +// RUN: %clang -### --target=x86_64-linux -flto -fsplit-machine-functions -fno-split-machine-functions %s 2>&1 | FileCheck %s --check-prefix=LTO-NEG + +// LTO: "-plugin-opt=-split-machine-functions" +// LTO-NEG-NOT: "-plugin-opt=-split-machine-functions" + +// RUN: not %clang -### -c --target=arm-unknown-linux -fsplit-machine-functions %s 2>&1 | FileCheck %s --check-prefix=ERR +// ERR: error: unsupported option '-fsplit-machine-functions' for target + +/// FIXME +// RUN: not %clang -### -c --target=arm-unknown-linux -fsplit-machine-functions -fno-split-machine-functions %s 2>&1 | FileCheck %s --check-prefix=ERR2 +// ERR2: error: unsupported option '-fno-split-machine-functions' for target diff --git a/clang/test/Driver/fsplit-machine-functions2.c b/clang/test/Driver/fsplit-machine-functions2.c deleted file mode 100644 index 1b81be084eff9..0000000000000 --- a/clang/test/Driver/fsplit-machine-functions2.c +++ /dev/null @@ -1,12 +0,0 @@ -// Test -fsplit-machine-functions option pass-through with lto -// RUN: %clang -### -target x86_64-unknown-linux -flto -fsplit-machine-functions %s 2>&1 | FileCheck %s -check-prefix=CHECK-PASS - -// Test no pass-through to ld without lto -// RUN: %clang -### -target x86_64-unknown-linux -fsplit-machine-functions %s 2>&1 | FileCheck %s -check-prefix=CHECK-NOPASS - -// Test the mix of -fsplit-machine-functions and -fno-split-machine-functions -// RUN: %clang -### -target x86_64-unknown-linux -flto -fsplit-machine-functions -fno-split-machine-functions %s 2>&1 | FileCheck %s -check-prefix=CHECK-NOPASS -// RUN: %clang -### -target x86_64-unknown-linux -flto -fno-split-machine-functions -fsplit-machine-functions %s 2>&1 | FileCheck %s -check-prefix=CHECK-PASS - -// CHECK-PASS: "-plugin-opt=-split-machine-functions" -// CHECK-NOPASS-NOT: "-plugin-opt=-split-machine-functions"