[clang] 426c2c4 - [Driver][test] Clean up -fsplit-machine-function tests

Fangrui Song via cfe-commits cfe-commits at lists.llvm.org
Thu Aug 24 11:00:21 PDT 2023


Author: Fangrui Song
Date: 2023-08-24T11:00:16-07:00
New Revision: 426c2c44b525dc52863de18d8a5c0f697f8c11e3

URL: https://github.com/llvm/llvm-project/commit/426c2c44b525dc52863de18d8a5c0f697f8c11e3
DIFF: https://github.com/llvm/llvm-project/commit/426c2c44b525dc52863de18d8a5c0f697f8c11e3.diff

LOG: [Driver][test] Clean up -fsplit-machine-function tests

Added: 
    

Modified: 
    clang/test/Driver/fsplit-machine-functions.c

Removed: 
    clang/test/Driver/fsplit-machine-functions2.c


################################################################################
diff  --git a/clang/test/Driver/fsplit-machine-functions.c b/clang/test/Driver/fsplit-machine-functions.c
index 577c87abd129aa..f77118a440e317 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 1b81be084eff93..00000000000000
--- 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"


        


More information about the cfe-commits mailing list