Debian Codegraph @

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

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