public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc(refs/users/marxin/heads/vect_cond_expr-rework-v3)] [testsuite, arm] cmp-2.c: Move double-precision tests to cmp-3.c
@ 2020-03-25 15:13 Martin Liska
0 siblings, 0 replies; only message in thread
From: Martin Liska @ 2020-03-25 15:13 UTC (permalink / raw)
To: gcc-cvs
https://gcc.gnu.org/g:2a0eaca3e9c88eb82579c75b393bd11d84d4da61
commit 2a0eaca3e9c88eb82579c75b393bd11d84d4da61
Author: Christophe Lyon <christophe.lyon@linaro.org>
Date: Mon Mar 23 18:01:11 2020 +0000
[testsuite,arm] cmp-2.c: Move double-precision tests to cmp-3.c
Parts of the cmp-2.c test rely on double-precision support, making the
test fail on targets where the FPU supports single-precision only.
Split the test into single-precision (cmp-2.c) and double-precision
tests (cmp-3.c).
2020-03-24 Christophe Lyon <christophe.lyon@linaro.org>
gcc/testsuite/
* gcc.target/arm/cmp-2.c: Move double-precision tests to...
* gcc.target/arm/cmp-3.c: ...here (new file)
Diff:
---
gcc/testsuite/ChangeLog | 5 ++++
gcc/testsuite/gcc.target/arm/cmp-2.c | 4 +--
gcc/testsuite/gcc.target/arm/cmp-3.c | 49 ++++++++++++++++++++++++++++++++++++
3 files changed, 55 insertions(+), 3 deletions(-)
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index adce8ede3b3..149ee023483 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2020-03-24 Christophe Lyon <christophe.lyon@linaro.org>
+
+ * gcc.target/arm/cmp-2.c: Move double-precision tests to...
+ * gcc.target/arm/cmp-3.c: ...here (new file)
+
2020-03-24 Christophe Lyon <christophe.lyon@linaro.org>
* lib/target-supports.exp
diff --git a/gcc/testsuite/gcc.target/arm/cmp-2.c b/gcc/testsuite/gcc.target/arm/cmp-2.c
index 70e45091c0c..c61487d70f4 100644
--- a/gcc/testsuite/gcc.target/arm/cmp-2.c
+++ b/gcc/testsuite/gcc.target/arm/cmp-2.c
@@ -30,9 +30,7 @@ int x, y;
TEST_EXPR (NAME##_cr, (TYPE a1), OPERATOR (100, a1))
#define TEST_OP(NAME, OPERATOR) \
- TEST (f_##NAME, float, OPERATOR) \
- TEST (d_##NAME, double, OPERATOR) \
- TEST (ld_##NAME, long double, OPERATOR)
+ TEST (f_##NAME, float, OPERATOR)
TEST_OP (eq, EQ)
TEST_OP (ne, NE)
diff --git a/gcc/testsuite/gcc.target/arm/cmp-3.c b/gcc/testsuite/gcc.target/arm/cmp-3.c
new file mode 100644
index 00000000000..70a11686f69
--- /dev/null
+++ b/gcc/testsuite/gcc.target/arm/cmp-3.c
@@ -0,0 +1,49 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target arm_fp_dp_ok } */
+/* { dg-skip-if "need fp instructions" { *-*-* } { "-mfloat-abi=soft" } { "" } } */
+/* { dg-options "-O" } */
+/* { dg-add-options arm_fp_dp } */
+/* { dg-final { scan-assembler-not "\tbl\t" } } */
+/* { dg-final { scan-assembler-not "__aeabi" } } */
+int x, y;
+
+#define EQ(X, Y) ((X) == (Y))
+#define NE(X, Y) ((X) != (Y))
+#define LT(X, Y) ((X) < (Y))
+#define GT(X, Y) ((X) > (Y))
+#define LE(X, Y) ((X) <= (Y))
+#define GE(X, Y) ((X) >= (Y))
+
+#define TEST_EXPR(NAME, ARGS, EXPR) \
+ int NAME##1 ARGS { return (EXPR); } \
+ int NAME##2 ARGS { return !(EXPR); } \
+ int NAME##3 ARGS { return (EXPR) ? x : y; } \
+ void NAME##4 ARGS { if (EXPR) x++; } \
+ void NAME##5 ARGS { if (!(EXPR)) x++; }
+
+#define TEST(NAME, TYPE, OPERATOR) \
+ TEST_EXPR (NAME##_rr, (TYPE a1, TYPE a2), OPERATOR (a1, a2)) \
+ TEST_EXPR (NAME##_rm, (TYPE a1, TYPE *a2), OPERATOR (a1, *a2)) \
+ TEST_EXPR (NAME##_mr, (TYPE *a1, TYPE a2), OPERATOR (*a1, a2)) \
+ TEST_EXPR (NAME##_mm, (TYPE *a1, TYPE *a2), OPERATOR (*a1, *a2)) \
+ TEST_EXPR (NAME##_rc, (TYPE a1), OPERATOR (a1, 100)) \
+ TEST_EXPR (NAME##_cr, (TYPE a1), OPERATOR (100, a1))
+
+#define TEST_OP(NAME, OPERATOR) \
+ TEST (d_##NAME, double, OPERATOR) \
+ TEST (ld_##NAME, long double, OPERATOR)
+
+TEST_OP (eq, EQ)
+TEST_OP (ne, NE)
+TEST_OP (lt, LT)
+TEST_OP (gt, GT)
+TEST_OP (le, LE)
+TEST_OP (ge, GE)
+TEST_OP (blt, __builtin_isless)
+TEST_OP (bgt, __builtin_isgreater)
+TEST_OP (ble, __builtin_islessequal)
+TEST_OP (bge, __builtin_isgreaterequal)
+/* This one should be expanded into separate ordered and equality
+ comparisons. */
+TEST_OP (blg, __builtin_islessgreater)
+TEST_OP (bun, __builtin_isunordered)
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2020-03-25 15:13 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-25 15:13 [gcc(refs/users/marxin/heads/vect_cond_expr-rework-v3)] [testsuite, arm] cmp-2.c: Move double-precision tests to cmp-3.c Martin Liska
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).