Merged revisions 208012,208018-208019,208021,208023-208030,208033,208037,208040-20804...
[official-gcc.git] / main / gcc / testsuite / gcc.dg / vect / pr59591-2.c
blob429b187bf22cbb0325e143cd4126c4550d271a28
1 /* PR tree-optimization/59591 */
2 /* { dg-do run } */
3 /* { dg-additional-options "-fopenmp-simd" } */
5 #ifndef CHECK_H
6 #include "tree-vect.h"
7 #endif
9 extern void abort (void);
11 long long int p[256], r[256], t[256];
12 int q[256];
14 __attribute__((noinline, noclone)) void
15 foo (void)
17 int i;
18 #pragma omp simd safelen(64)
19 for (i = 0; i < 256; i++)
20 if (r[i] > 32LL)
21 t[i] = p[q[i]];
24 __attribute__((noinline, noclone)) void
25 bar (void)
27 int i;
28 for (i = 0; i < 256; i++)
30 r[i] = ((i >> 2) & (1 << (i & 3))) ? 32 + i : 32 - i;
31 q[i] = r[i] > 32 ? ((i * 7) % 256) : 258 + i;
32 p[i] = i * 11;
33 t[i] = i * 13;
35 foo ();
36 for (i = 0; i < 256; i++)
37 if ((i >> 2) & (1 << (i & 3)))
39 if (t[i] != ((i * 7) % 256) * 11)
40 abort ();
42 else if (t[i] != i * 13)
43 abort ();
46 #ifndef CHECK_H
47 int
48 main ()
50 check_vect ();
51 bar ();
52 return 0;
54 #endif
56 /* { dg-final { cleanup-tree-dump "vect" } } */