openmp: Fix signed/unsigned warning
[official-gcc.git] / gcc / testsuite / gcc.dg / vect / pr85586.c
bloba4a170a1fcd130d84da3be9f897889ff4cfc717c
1 #define N 100
3 void __attribute__ ((noipa))
4 foo (int *out, int *in, int step)
6 for (int i = 0; i < N; ++i)
8 out[0] = in[i];
9 out[1] = 2;
10 out += step;
14 int in[N];
15 int out[N * 2];
17 int
18 main (void)
20 for (int i = 0; i < N; ++i)
22 in[i] = i * (i + 1);
23 asm volatile ("" ::: "memory");
26 foo (out, in, 1);
27 #pragma GCC novector
28 for (int i = 0; i < N; ++i)
29 if (out[i] != in[i])
30 __builtin_abort ();
31 if (out[N] != 2)
32 __builtin_abort ();
34 foo (out + N - 1, in, -1);
35 if (out[0] != in[N - 1])
36 __builtin_abort ();
37 #pragma GCC novector
38 for (int i = 1; i <= N; ++i)
39 if (out[i] != 2)
40 __builtin_abort ();
42 return 0;
45 /* { dg-final { scan-tree-dump-times "LOOP VECTORIZED" 1 "vect" { target { { ! vect_no_align } && vect_int } } } } */