PR target/55146
[official-gcc.git] / gcc / testsuite / gcc.dg / vect / vect-112-big-array.c
bloba1302c1e93685fa133a729e24c4aefeff765dab8
1 /* { dg-require-effective-target vect_int } */
3 #include <stdarg.h>
4 #include "tree-vect.h"
6 #define N 128
8 char cb[N];
9 char cc[N];
11 volatile int y = 0;
13 __attribute__ ((noinline)) int
14 main1 (void)
16 int i;
17 int diff = 0;
18 int check_diff = 0;
19 for (i = 0; i < N; i++) {
20 cb[i] = i + 2;
21 cc[i] = i + 1;
22 check_diff += (cb[i] - cc[i]);
23 /* Avoid vectorization. */
24 if (y)
25 abort ();
28 /* Cross-iteration cycle. */
29 diff = 0;
30 for (i = 0; i < N; i++) {
31 diff += (cb[i] - cc[i]);
34 /* Check results. */
35 if (diff != check_diff)
36 abort ();
38 return 0;
41 int main (void)
43 check_vect ();
44 return main1 ();
47 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_unpack } } } */
48 /* { dg-final { cleanup-tree-dump "vect" } } */