summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/aarch64/sve_cond_arith_3_run.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.target/aarch64/sve_cond_arith_3_run.c')
-rw-r--r--gcc/testsuite/gcc.target/aarch64/sve_cond_arith_3_run.c32
1 files changed, 32 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.target/aarch64/sve_cond_arith_3_run.c b/gcc/testsuite/gcc.target/aarch64/sve_cond_arith_3_run.c
new file mode 100644
index 00000000000..38736e11006
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/sve_cond_arith_3_run.c
@@ -0,0 +1,32 @@
+/* { dg-do run { target aarch64_sve_hw } } */
+/* { dg-options "-O2 -ftree-vectorize -march=armv8-a+sve" } */
+
+#include "sve_cond_arith_3.c"
+
+#define N 98
+
+#undef TEST
+#define TEST(TYPE, NAME, OP) \
+ { \
+ TYPE x[N], y[N], pred[N], z[2] = { 5, 7 }; \
+ for (int i = 0; i < N; ++i) \
+ { \
+ y[i] = i * i; \
+ pred[i] = i % 3; \
+ } \
+ test_##TYPE##_##NAME (x, y, z[0], z[1], pred, N); \
+ for (int i = 0; i < N; ++i) \
+ { \
+ TYPE expected = i % 3 != 1 ? y[i] OP z[i & 1] : y[i]; \
+ if (x[i] != expected) \
+ __builtin_abort (); \
+ asm volatile ("" ::: "memory"); \
+ } \
+ }
+
+int
+main (void)
+{
+ TEST_ALL
+ return 0;
+}