2018-01-16 Richard Biener <rguenther@suse.de>
[official-gcc.git] / gcc / testsuite / gcc.dg / vect / pr59591-2.c
blobbd82d765794a32af6509ffd60d1f552ce10570a3
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 long long int p[256], r[256], t[256];
11 int q[256];
13 __attribute__((noinline, noclone)) void
14 foo (void)
16 int i;
17 #pragma omp simd safelen(64)
18 for (i = 0; i < 256; i++)
19 if (r[i] > 32LL)
20 t[i] = p[q[i]];
23 __attribute__((noinline, noclone)) void
24 bar (void)
26 int i;
27 for (i = 0; i < 256; i++)
29 r[i] = ((i >> 2) & (1 << (i & 3))) ? 32 + i : 32 - i;
30 q[i] = r[i] > 32 ? ((i * 7) % 256) : 258 + i;
31 p[i] = i * 11;
32 t[i] = i * 13;
34 foo ();
35 for (i = 0; i < 256; i++)
36 if ((i >> 2) & (1 << (i & 3)))
38 if (t[i] != ((i * 7) % 256) * 11)
39 abort ();
41 else if (t[i] != i * 13)
42 abort ();
45 #ifndef CHECK_H
46 int
47 main ()
49 check_vect ();
50 bar ();
51 return 0;
53 #endif