c++: wrong error due to std::initializer_list opt [PR116476]
[official-gcc.git] / gcc / testsuite / gcc.dg / vect / pr65930-2.c
blob9cfb9b102d9b518c5a7f2f011c9a871b81604b3c
1 /* { dg-require-effective-target vect_int } */
3 #include "tree-vect.h"
5 int __attribute__((noipa))
6 bar (unsigned int *x, int n)
8 int sum = 4;
9 x = __builtin_assume_aligned (x, __BIGGEST_ALIGNMENT__);
10 for (int i = 0; i < n; ++i)
11 sum += x[i*4+0]+ x[i*4 + 1] + x[i*4 + 2] + x[i*4 + 3];
12 return sum;
15 int
16 main ()
18 static int a[16] __attribute__((aligned(__BIGGEST_ALIGNMENT__)))
19 = { 1, 3, 5, 8, 9, 10, 17, 18, 23, 29, 30, 55, 42, 2, 3, 1 };
20 check_vect ();
21 if (bar (a, 4) != 260)
22 abort ();
23 return 0;
26 /* { dg-final { scan-tree-dump "vectorized 1 loops" "vect" } } */
27 /* { dg-final { scan-tree-dump "Loop contains only SLP stmts" "vect" } } */
28 /* { dg-final { scan-tree-dump "vectorizing stmts using SLP" "vect" } } */