libcpp, c, middle-end: Optimize initializers using #embed in C
[official-gcc.git] / gcc / testsuite / gcc.dg / vect / pr80928.c
blob34566c4535247d2fa39c5d856d1e0c32687e9a2a
1 /* { dg-do compile } */
2 /* { dg-require-effective-target vect_int } */
4 #include "tree-vect.h"
6 int a[1020];
8 void __attribute__((noinline))
9 foo ()
11 for (int i = 0; i < 1020; i += 5)
13 a[i] = i;
14 a[i+1] = i;
15 a[i+2] = i;
16 a[i+3] = i;
17 a[i+4] = i;
21 int main ()
23 check_vect ();
25 foo ();
27 /* check results */
28 #pragma GCC novector
29 for (int i = 0; i < 1020; ++i)
30 if (a[i] != ((i + 4) / 5) * 5)
31 abort ();
33 return 0;
36 /* Make sure we are not triggering hybrid SLP due to the IV update. */
37 /* { dg-final { scan-tree-dump "Loop contains only SLP stmts" "vect" } } */
38 /* { dg-final { scan-tree-dump "vectorized 1 loops" "vect" } } */