PR tree-optimization/84740
[official-gcc.git] / gcc / testsuite / gcc.dg / vect / pr59591-1.c
blob892fce58e36b37e5412cc6c100f82b6077ace77e
1 /* PR tree-optimization/59591 */
2 /* { dg-additional-options "-fopenmp-simd" } */
4 #ifndef CHECK_H
5 #include "tree-vect.h"
6 #endif
8 extern void abort (void);
10 int p[256], q[256], r[256], t[256];
12 __attribute__((noinline, noclone)) void
13 foo (void)
15 int i;
16 #pragma omp simd safelen(64)
17 for (i = 0; i < 256; i++)
18 if (r[i] > 32)
19 t[i] = p[q[i] * 3L + 2L];
22 __attribute__((noinline, noclone)) void
23 bar (void)
25 int i;
26 for (i = 0; i < 256; i++)
28 r[i] = ((i >> 2) & (1 << (i & 3))) ? 32 + i : 32 - i;
29 q[i] = r[i] > 32 ? ((i * 7) % 84) : 99 + i;
30 p[i] = i * 11;
31 t[i] = i * 13;
33 foo ();
34 for (i = 0; i < 256; i++)
35 if ((i >> 2) & (1 << (i & 3)))
37 if (t[i] != (((i * 7) % 84) * 3 + 2) * 11)
38 abort ();
40 else if (t[i] != i * 13)
41 abort ();
44 #ifndef CHECK_H
45 int
46 main ()
48 check_vect ();
49 bar ();
50 return 0;
52 #endif