2018-03-15 Steven G. Kargl <kargl@gcc.gnu.org>
[official-gcc.git] / gcc / testsuite / gcc.target / aarch64 / vect-reduc-or_1.c
blob918822a7d004baf36b4538d81222f3dff10d5451
1 /* { dg-do run } */
2 /* { dg-options "-O2 -ftree-vectorize -fdump-tree-vect-all -fno-vect-cost-model" } */
3 /* Write a reduction loop to be reduced using whole vector right shift. */
5 #pragma GCC target "+nosve"
7 extern void abort (void);
9 unsigned char in[8] __attribute__((__aligned__(16)));
11 int
12 main (unsigned char argc, char **argv)
14 unsigned char i = 0;
15 unsigned char sum = 1;
17 for (i = 0; i < 8; i++)
18 in[i] = (i + i + 1) & 0xfd;
20 /* Prevent constant propagation of the entire loop below. */
21 asm volatile ("" : : : "memory");
23 for (i = 0; i < 8; i++)
24 sum |= in[i];
26 if (sum != 13)
28 __builtin_printf ("Failed %d\n", sum);
29 abort ();
32 return 0;
35 /* { dg-final { scan-tree-dump "Reduce using vector shifts" "vect" } } */