Use conditional internal functions in if-conversion
[official-gcc.git] / gcc / testsuite / gcc.target / aarch64 / sve / cond_arith_1_run.c
blob876f98f6ec20ca5087f0164d67b893333f253106
1 /* { dg-do run { target aarch64_sve_hw } } */
2 /* { dg-options "-O2 -ftree-vectorize" } */
4 #include "cond_arith_1.c"
6 #define N 99
8 #undef TEST
9 #define TEST(TYPE, NAME, OP) \
10 { \
11 TYPE x[N], y[N], z[N], pred[N]; \
12 for (int i = 0; i < N; ++i) \
13 { \
14 y[i] = i * i; \
15 z[i] = ((i + 2) % 3) * (i + 1); \
16 pred[i] = i % 3; \
17 } \
18 test_##TYPE##_##NAME (x, y, z, pred, N); \
19 for (int i = 0; i < N; ++i) \
20 { \
21 TYPE expected = i % 3 != 1 ? y[i] OP z[i] : y[i]; \
22 if (x[i] != expected) \
23 __builtin_abort (); \
24 asm volatile ("" ::: "memory"); \
25 } \
28 int
29 main (void)
31 TEST_ALL
32 return 0;