Debian Codegraph @

gcc/testsuite/gcc.target/aarch64/sve/cond_arith_4_run.c

raw
1 /* { dg-do run { target aarch64_sve_hw } } */
2 /* { dg-options "-O2 -ftree-vectorize" } */
3
4 #include "cond_arith_4.c"
5
6 #define N 98
7
8 #undef TEST
9 #define TEST(TYPE, NAME, OP) \
10 { \
11 TYPE x[N], y[N], pred[N], z[2] = { 5, 7 }; \
12 for (int i = 0; i < N; ++i) \
13 { \
14 y[i] = i * i; \
15 pred[i] = i % 3; \
16 } \
17 test_##TYPE##_##NAME (x, y, z[0], z[1], pred, N); \
18 for (int i = 0; i < N; ++i) \
19 { \
20 TYPE expected = i % 3 != 1 ? y[i] OP z[i & 1] : y[i]; \
21 if (x[i] != expected) \
22 __builtin_abort (); \
23 asm volatile ("" ::: "memory"); \
24 } \
25 }
26
27 int
28 main (void)
29 {
30 TEST_ALL
31 return 0;
32 }