[clang] 3d22dac - Revert "[clang][test] Refine clang machine-function-split tests."
Nico Weber via cfe-commits
cfe-commits at lists.llvm.org
Sun Aug 20 07:38:43 PDT 2023
Author: Nico Weber
Date: 2023-08-20T10:38:29-04:00
New Revision: 3d22dac6c3b97d7bb92f243886dfb0d32a5c42e9
URL: https://github.com/llvm/llvm-project/commit/3d22dac6c3b97d7bb92f243886dfb0d32a5c42e9
DIFF: https://github.com/llvm/llvm-project/commit/3d22dac6c3b97d7bb92f243886dfb0d32a5c42e9.diff
LOG: Revert "[clang][test] Refine clang machine-function-split tests."
This reverts commit b9d079d6188b50730e0a67267b7fee36008435ce.
Breaks tests on Windows, see https://reviews.llvm.org/D157565#4600939
Added:
Modified:
clang/test/Driver/fsplit-machine-functions-with-cuda-nvptx.c
clang/test/Driver/fsplit-machine-functions.c
llvm/test/CodeGen/Generic/machine-function-splitter.ll
Removed:
clang/test/CodeGen/fsplit-machine-functions.c
################################################################################
diff --git a/clang/test/CodeGen/fsplit-machine-functions.c b/clang/test/CodeGen/fsplit-machine-functions.c
deleted file mode 100644
index dd8e4ff333f20d..00000000000000
--- a/clang/test/CodeGen/fsplit-machine-functions.c
+++ /dev/null
@@ -1,25 +0,0 @@
-// REQUIRES: x86-registered-target
-// REQUIRES: arm-registered-target
-// REQUIRES: nvptx-registered-target
-
-// Check -fsplit-machine-functions passed to cuda device causes a warning.
-// RUN: %clang_cc1 -triple nvptx-unknown-unknown -target-cpu sm_70 \
-// RUN: -fcuda-is-device -x cuda -fsplit-machine-functions -S %s \
-// RUN: -o %t 2>&1 | FileCheck %s --check-prefix=MFS1
-// MFS1: warning: -fsplit-machine-functions is not valid for nvptx
-
-// Check -fsplit-machine-functions passed to X86 does not cause any warning.
-// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -fsplit-machine-functions \
-// RUN: -o %t -S %s && { echo "empty output causes FileCheck to fail" ; } \
-// RUN: 2>&1 | FileCheck %s --check-prefix=MFS2
-// MFS2-NOT: warning:
-
-// Check -fsplit-machine-functions passed to ARM does cause a warning.
-// RUN: %clang_cc1 -triple arm-unknown-linux-gnueabi \
-// RUN: -fsplit-machine-functions -S %s -o %t \
-// RUN: 2>&1 | FileCheck -check-prefix=MFS3 %s
-// MFS3: warning: -fsplit-machine-functions is not valid for arm
-
-int foo() {
- return 13;
-}
diff --git a/clang/test/Driver/fsplit-machine-functions-with-cuda-nvptx.c b/clang/test/Driver/fsplit-machine-functions-with-cuda-nvptx.c
index aab1179b3e731e..f2b09e13d80b68 100644
--- a/clang/test/Driver/fsplit-machine-functions-with-cuda-nvptx.c
+++ b/clang/test/Driver/fsplit-machine-functions-with-cuda-nvptx.c
@@ -1,28 +1,68 @@
+// REQUIRES: system-linux
// REQUIRES: x86-registered-target
// REQUIRES: nvptx-registered-target
+// REQUIRES: shell
// Check that -fsplit-machine-functions is passed to both x86 and cuda
// compilation and does not cause driver error.
-// RUN: %clang -### --target=x86_64-unknown-linux-gnu -nogpulib -nogpuinc \
+// RUN: cd "$(dirname "%t")" ; \
+// RUN: %clang -### --target=x86_64-unknown-linux-gnu -nogpulib -nogpuinc \
// RUN: --cuda-gpu-arch=sm_70 -x cuda -fsplit-machine-functions -S %s \
// RUN: 2>&1 | FileCheck %s --check-prefix=MFS1
// MFS1: "-target-cpu" "x86-64"{{.*}}"-fsplit-machine-functions"
// MFS1: "-target-cpu" "sm_70"{{.*}}"-fsplit-machine-functions"
+// Check that -fsplit-machine-functions is passed to cuda and it
+// causes a warning.
+// RUN: cd "$(dirname "%t")" ; \
+// RUN: %clang --target=x86_64-unknown-linux-gnu -nogpulib -nogpuinc \
+// RUN: --cuda-gpu-arch=sm_70 -x cuda -fsplit-machine-functions -S %s \
+// RUN: 2>&1 | FileCheck %s --check-prefix=MFS2
+// MFS2: warning: -fsplit-machine-functions is not valid for nvptx
+
// Check that -Xarch_host -fsplit-machine-functions is passed only to
// native compilation.
-// RUN: %clang -### --target=x86_64-unknown-linux-gnu -nogpulib -nogpuinc \
+// RUN: cd "$(dirname "%t")" ; \
+// RUN: %clang -### --target=x86_64-unknown-linux-gnu -nogpulib -nogpuinc \
// RUN: --cuda-gpu-arch=sm_70 -x cuda -Xarch_host \
// RUN: -fsplit-machine-functions -S %s \
-// RUN: 2>&1 | FileCheck %s --check-prefix=MFS2
-// MFS2: "-target-cpu" "x86-64"{{.*}}"-fsplit-machine-functions"
-// MFS2-NOT: "-target-cpu" "sm_70"{{.*}}"-fsplit-machine-functions"
+// RUN: 2>&1 | FileCheck %s --check-prefix=MFS3
+// MFS3: "-target-cpu" "x86-64"{{.*}}"-fsplit-machine-functions"
+// MFS3-NOT: "-target-cpu" "sm_70"{{.*}}"-fsplit-machine-functions"
+
+// Check that -Xarch_host -fsplit-machine-functions does not cause any warning.
+// RUN: cd "$(dirname "%t")" ; \
+// RUN: %clang --target=x86_64-unknown-linux-gnu -nogpulib -nogpuinc \
+// RUN --cuda-gpu-arch=sm_70 -x cuda -Xarch_host \
+// RUN -fsplit-machine-functions -S %s || { echo \
+// RUN "warning: -fsplit-machine-functions is not valid for" ; } \
+// RUN 2>&1 | FileCheck %s --check-prefix=MFS4
+// MFS4-NOT: warning: -fsplit-machine-functions is not valid for
+
+// Check that -Xarch_device -fsplit-machine-functions does cause the warning.
+// RUN: cd "$(dirname "%t")" ; \
+// RUN: %clang --target=x86_64-unknown-linux-gnu -nogpulib -nogpuinc \
+// RUN: --cuda-gpu-arch=sm_70 -x cuda -Xarch_device \
+// RUN: -fsplit-machine-functions -S %s 2>&1 | \
+// RUN: FileCheck %s --check-prefix=MFS5
+// MFS5: warning: -fsplit-machine-functions is not valid for
// Check that -fsplit-machine-functions -Xarch_device
// -fno-split-machine-functions only passes MFS to x86
-// RUN: %clang -### --target=x86_64-unknown-linux-gnu -nogpulib -nogpuinc \
+// RUN: cd "$(dirname "%t")" ; \
+// RUN: %clang -### --target=x86_64-unknown-linux-gnu -nogpulib -nogpuinc \
// RUN: --cuda-gpu-arch=sm_70 -x cuda -fsplit-machine-functions \
// RUN: -Xarch_device -fno-split-machine-functions -S %s \
-// RUN: 2>&1 | FileCheck %s --check-prefix=MFS3
-// MFS3: "-target-cpu" "x86-64"{{.*}}"-fsplit-machine-functions"
-// MFS3-NOT: "-target-cpu" "sm_70"{{.*}}"-fsplit-machine-functions"
+// RUN: 2>&1 | FileCheck %s --check-prefix=MFS6
+// MFS6: "-target-cpu" "x86-64"{{.*}}"-fsplit-machine-functions"
+// MFS6-NOT: "-target-cpu" "sm_70"{{.*}}"-fsplit-machine-functions"
+
+// Check that -fsplit-machine-functions -Xarch_device
+// -fno-split-machine-functions has no warnings
+// RUN: cd "$(dirname "%t")" ; \
+// RUN: %clang --target=x86_64-unknown-linux-gnu -nogpulib -nogpuinc \
+// RUN: --cuda-gpu-arch=sm_70 -x cuda -fsplit-machine-functions \
+// RUN: -Xarch_device -fno-split-machine-functions -S %s \
+// RUN: || { echo "warning: -fsplit-machine-functions is not valid for"; } \
+// RUN: 2>&1 | FileCheck %s --check-prefix=MFS7
+// MFS7-NOT: warning: -fsplit-machine-functions is not valid for
diff --git a/clang/test/Driver/fsplit-machine-functions.c b/clang/test/Driver/fsplit-machine-functions.c
index 189689f4097656..4ba4e52fb79484 100644
--- a/clang/test/Driver/fsplit-machine-functions.c
+++ b/clang/test/Driver/fsplit-machine-functions.c
@@ -1,5 +1,10 @@
-// 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
+// REQUIRES: arm-registered-target
-// CHECK_OPT: "-fsplit-machine-functions"
-// CHECK_NOOPT-NOT: "-fsplit-machine-functions"
+// RUN: %clang -### -target x86_64 -fprofile-use=default.profdata -fsplit-machine-functions %s -c -o %t.o 2>&1 | FileCheck -check-prefix=CHECK-OPT %s
+// RUN: %clang -### -target x86_64 -fsplit-machine-functions %s -c -o %t.o 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 -o %t.o 2>&1 | FileCheck -check-prefix=CHECK-NOOPT %s
+// RUN: %clang -c -target arm-unknown-linux-gnueabi -fsplit-machine-functions %s -o %t.o 2>&1 | FileCheck -check-prefix=CHECK-TRIPLE %s
+
+// CHECK-OPT: "-fsplit-machine-functions"
+// CHECK-NOOPT-NOT: "-fsplit-machine-functions"
+// CHECK-TRIPLE: warning: -fsplit-machine-functions is not valid for arm
diff --git a/llvm/test/CodeGen/Generic/machine-function-splitter.ll b/llvm/test/CodeGen/Generic/machine-function-splitter.ll
index 3003240c373ea0..03934434f3ceb7 100644
--- a/llvm/test/CodeGen/Generic/machine-function-splitter.ll
+++ b/llvm/test/CodeGen/Generic/machine-function-splitter.ll
@@ -16,10 +16,10 @@
;; Check that MFS is on for X86 targets.
; MFS_ON: Machine Function Splitter Transformation
-; MFS_ON-NOT: warning:
+; MFS_ON_NO: warning: -fsplit-machine-functions is not valid for
;; Check that MFS is not on for non-X86 targets.
; MFS_OFF: warning: -fsplit-machine-functions is not valid for
-; MFS_OFF-NOT: Machine Function Splitter Transformation
+; MFS_OFF_NO: Machine Function Splitter Transformation
define void @foo1(i1 zeroext %0) nounwind !prof !14 !section_prefix !15 {
;; Check that cold block is moved to .text.split.
More information about the cfe-commits
mailing list