1 /* { dg-do run { target aarch64_sve_hw } } */ 2 /* { dg-options "-O2 -ftree-vectorize -fno-trapping-math -ffinite-math-only" } */ 3 4 #include "vcond_8.c" 5 6 #define N 187 7 8 #define TEST_LOOP(TYPE, CMPTYPE, OP) \ 9 { \ 10 TYPE dest[N], src[N]; \ 11 CMPTYPE cond[N]; \ 12 for (unsigned int i = 0; i < N; ++i) \ 13 { \ 14 src[i] = i * 3; \ 15 cond[i] = i % 5; \ 16 } \ 17 f_##OP##_##TYPE (dest, cond, 3, src, 77, N); \ 18 for (unsigned int i = 0; i < N; ++i) \ 19 { \ 20 TYPE if_false = i * 3; \ 21 TYPE if_true = OP (if_false, (TYPE) 77); \ 22 if (dest[i] != (i % 5 < 3 ? if_true : if_false)) \ 23 __builtin_abort (); \ 24 } \ 25 } 26 27 int __attribute__ ((optimize (1))) main(void)28main (void) 29 { 30 FOR_EACH_LOOP (TEST_LOOP); 31 return 0; 32 } 33