Add support for conditional reductions using SVE CLASTB
[official-gcc.git] / gcc / testsuite / gcc.target / aarch64 / sve / loop_add_1_run.c
blob35fafe64abf27f94089f071640a311cdd6fe1a07
1 /* { dg-do run { target aarch64_sve_hw } } */
2 /* { dg-options "-O3" } */
4 #include "loop_add_1.c"
6 #define ELEMS 10
8 int __attribute__ ((optimize (1)))
9 main (void)
11 int in1[ELEMS] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 };
12 int in2[ELEMS] = { 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 };
13 int out[ELEMS];
14 int check[ELEMS] = { 3, 5, 7, 9, 11, 13, 15, 17, 19, 21 };
16 vadd (out, in1, in2, ELEMS);
18 for (int i = 0; i < ELEMS; ++i)
19 if (out[i] != check[i])
20 __builtin_abort ();
22 return 0;