PR tree-optimization/84740
[official-gcc.git] / gcc / testsuite / gcc.dg / vect / pr80928.c
blobe6c1f1ab5a7f4ca7eac98cf91fccffbff2dcfc7a
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 for (int i = 0; i < 1020; ++i)
29 if (a[i] != ((i + 4) / 5) * 5)
30 abort ();
32 return 0;
35 /* Make sure we are not triggering hybrid SLP due to the IV update. */
36 /* { dg-final { scan-tree-dump "Loop contains only SLP stmts" "vect" } } */
37 /* { dg-final { scan-tree-dump "vectorized 1 loops" "vect" } } */