Debian Codegraph @

gcc/testsuite/gcc.dg/vect/vect-71.c

raw
1 /* { dg-require-effective-target vect_int } */
2 /* { dg-additional-options "-fdump-tree-optimized-details-blocks" } */
3
4 #include <stdarg.h>
5 #include "tree-vect.h"
6
7 #define N 16
8
9 /* indirect access. */
10
11 __attribute__ ((noinline))
12 int main1 ()
13 {
14 int i;
15 unsigned ia[N];
16 unsigned ib[N+1] = {2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 0, 1, 2};
17
18 for (i = 2; i < N+1; i++)
19 {
20 ia[ib[i]] = 0;
21 }
22
23 /* check results: */
24 #pragma GCC novector
25 for (i = 2; i < N+1; i++)
26 {
27 if (ia[ib[i]] != 0)
28 abort();
29 }
30
31 return 0;
32 }
33
34 int main (void)
35 {
36 check_vect ();
37
38 return main1 ();
39 }
40
41 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
42 /* { dg-final { scan-tree-dump-not "Invalid sum" "optimized" } } */