1 /* { dg-do run { target aarch64_sve_hw } } */ 2 /* { dg-options "-O2 -ftree-vectorize" } */ 3 4 #include "vcond_19.c" 5 6 #define N 97 7 8 #define TEST_LOOP(TYPE, NAME, CONST) \ 9 { \ 10 TYPE x[N], pred[N]; \ 11 for (int i = 0; i < N; ++i) \ 12 { \ 13 pred[i] = i % 5 <= i % 6 ? i : 0; \ 14 asm volatile ("" ::: "memory"); \ 15 } \ 16 test_##TYPE##_##NAME (x, pred, N); \ 17 for (int i = 0; i < N; ++i) \ 18 { \ 19 if (x[i] != (TYPE) (pred[i] > 0 ? CONST : pred[i])) \ 20 __builtin_abort (); \ 21 asm volatile ("" ::: "memory"); \ 22 } \ 23 } 24 25 int __attribute__ ((optimize (1))) main(int argc,char ** argv)26main (int argc, char **argv) 27 { 28 TEST_ALL (TEST_LOOP) 29 return 0; 30 } 31