Debian Codegraph @

gcc/testsuite/gcc.dg/vect/pr80928.c

raw
1 /* { dg-do compile } */
2 /* { dg-require-effective-target vect_int } */
3
4 #include "tree-vect.h"
5
6 int a[1020];
7
8 void __attribute__((noinline))
9 foo ()
10 {
11 for (int i = 0; i < 1020; i += 5)
12 {
13 a[i] = i;
14 a[i+1] = i;
15 a[i+2] = i;
16 a[i+3] = i;
17 a[i+4] = i;
18 }
19 }
20
21 int main ()
22 {
23 check_vect ();
24
25 foo ();
26
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 ();
32
33 return 0;
34 }
35
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" } } */