-
Notifications
You must be signed in to change notification settings - Fork 12.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Clang, SystemZ] Split test into Driver and CodeGen parts (NFC) #79808
Conversation
The test added in llvm#73511 currently fails in CLANG_DEFAULT_PIE_ON_LINUX=OFF configuration, because it uses the clang driver in a codegen test. Split the tests into two, a driver test that checks that the appropriate target feature is passed, and a codegen test that uses cc1.
@llvm/pr-subscribers-clang Author: Nikita Popov (nikic) ChangesThe test added in #73511 currently fails in Split the test into two, a driver test that checks that the appropriate target feature is passed, and a codegen test that uses cc1. Full diff: https://github.com/llvm/llvm-project/pull/79808.diff 2 Files Affected:
diff --git a/clang/test/CodeGen/SystemZ/unaligned-symbols.c b/clang/test/CodeGen/SystemZ/unaligned-symbols.c
index 31fc211393dd719..b19f30338857992 100644
--- a/clang/test/CodeGen/SystemZ/unaligned-symbols.c
+++ b/clang/test/CodeGen/SystemZ/unaligned-symbols.c
@@ -1,13 +1,10 @@
-// RUN: %clang -target s390x-linux-gnu %s -o - -emit-llvm -S \
+// RUN: %clang_cc1 -triple s390x-linux-gnu %s -o - -emit-llvm \
// RUN: | FileCheck %s -check-prefixes=CHECK,ALIGNED
-// RUN: %clang -target s390x-linux-gnu %s -o - -emit-llvm -S \
-// RUN: -mno-unaligned-symbols | FileCheck %s -check-prefixes=CHECK,ALIGNED
+// RUN: %clang_cc1 -triple s390x-linux-gnu %s -o - -emit-llvm \
+// RUN: -target-feature -unaligned-symbols | FileCheck %s -check-prefixes=CHECK,ALIGNED
-// RUN: %clang -target s390x-linux-gnu %s -o - -emit-llvm -S \
-// RUN: -munaligned-symbols | FileCheck %s -check-prefixes=CHECK,UNALIGN
-
-// RUN: %clang -cc1 -triple s390x-linux-gnu %s -o - -emit-llvm \
+// RUN: %clang_cc1 -triple s390x-linux-gnu %s -o - -emit-llvm \
// RUN: -target-feature +unaligned-symbols | FileCheck %s -check-prefixes=CHECK,UNALIGN
diff --git a/clang/test/Driver/s390x-unaligned-symbols.c b/clang/test/Driver/s390x-unaligned-symbols.c
new file mode 100644
index 000000000000000..1dff5b737fff776
--- /dev/null
+++ b/clang/test/Driver/s390x-unaligned-symbols.c
@@ -0,0 +1,7 @@
+// RUN: %clang -target s390x-linux-gnu -### -c %s 2>&1 | FileCheck -check-prefix=DEFAULT %s
+// RUN: %clang -target s390x-linux-gnu -mno-unaligned-symbols -### -c %s 2>&1 | FileCheck -check-prefix=ALIGNED %s
+// RUN: %clang -target s390x-linux-gnu -munaligned-symbols -### -c %s 2>&1 | FileCheck -check-prefix=UNALIGN %s
+
+// DEFAULT-NOT: unaligned-symbols"
+// ALIGNED: "-target-feature" "-unaligned-symbols"
+// UNALIGN: "-target-feature" "+unaligned-symbols"
|
@llvm/pr-subscribers-clang-driver Author: Nikita Popov (nikic) ChangesThe test added in #73511 currently fails in Split the test into two, a driver test that checks that the appropriate target feature is passed, and a codegen test that uses cc1. Full diff: https://github.com/llvm/llvm-project/pull/79808.diff 2 Files Affected:
diff --git a/clang/test/CodeGen/SystemZ/unaligned-symbols.c b/clang/test/CodeGen/SystemZ/unaligned-symbols.c
index 31fc211393dd719..b19f30338857992 100644
--- a/clang/test/CodeGen/SystemZ/unaligned-symbols.c
+++ b/clang/test/CodeGen/SystemZ/unaligned-symbols.c
@@ -1,13 +1,10 @@
-// RUN: %clang -target s390x-linux-gnu %s -o - -emit-llvm -S \
+// RUN: %clang_cc1 -triple s390x-linux-gnu %s -o - -emit-llvm \
// RUN: | FileCheck %s -check-prefixes=CHECK,ALIGNED
-// RUN: %clang -target s390x-linux-gnu %s -o - -emit-llvm -S \
-// RUN: -mno-unaligned-symbols | FileCheck %s -check-prefixes=CHECK,ALIGNED
+// RUN: %clang_cc1 -triple s390x-linux-gnu %s -o - -emit-llvm \
+// RUN: -target-feature -unaligned-symbols | FileCheck %s -check-prefixes=CHECK,ALIGNED
-// RUN: %clang -target s390x-linux-gnu %s -o - -emit-llvm -S \
-// RUN: -munaligned-symbols | FileCheck %s -check-prefixes=CHECK,UNALIGN
-
-// RUN: %clang -cc1 -triple s390x-linux-gnu %s -o - -emit-llvm \
+// RUN: %clang_cc1 -triple s390x-linux-gnu %s -o - -emit-llvm \
// RUN: -target-feature +unaligned-symbols | FileCheck %s -check-prefixes=CHECK,UNALIGN
diff --git a/clang/test/Driver/s390x-unaligned-symbols.c b/clang/test/Driver/s390x-unaligned-symbols.c
new file mode 100644
index 000000000000000..1dff5b737fff776
--- /dev/null
+++ b/clang/test/Driver/s390x-unaligned-symbols.c
@@ -0,0 +1,7 @@
+// RUN: %clang -target s390x-linux-gnu -### -c %s 2>&1 | FileCheck -check-prefix=DEFAULT %s
+// RUN: %clang -target s390x-linux-gnu -mno-unaligned-symbols -### -c %s 2>&1 | FileCheck -check-prefix=ALIGNED %s
+// RUN: %clang -target s390x-linux-gnu -munaligned-symbols -### -c %s 2>&1 | FileCheck -check-prefix=UNALIGN %s
+
+// DEFAULT-NOT: unaligned-symbols"
+// ALIGNED: "-target-feature" "-unaligned-symbols"
+// UNALIGN: "-target-feature" "+unaligned-symbols"
|
LGTM |
The test added in #73511 currently fails in
CLANG_DEFAULT_PIE_ON_LINUX=OFF configuration, because it uses the clang driver in a codegen test.
Split the test into two, a driver test that checks that the appropriate target feature is passed, and a codegen test that uses cc1.