Skip various cmp-mem-const tests on lp64 hppa*-*-*
[official-gcc.git] / libgomp / testsuite / libgomp.c-c++-common / pr66199-12.c
blob78eb12ac7aa1bef72b9ee5f7191f6ad254b41dfa
1 /* PR middle-end/66199 */
2 /* { dg-do run } */
4 int u[1024], v[1024], w[1024];
6 __attribute__((noinline, noclone)) long
7 f1 (long a, long b)
9 long d;
10 #pragma omp teams distribute simd default(none) firstprivate (a, b) shared(u, v, w)
11 for (d = a; d < b; d++)
12 u[d] = v[d] + w[d];
13 return d;
16 __attribute__((noinline, noclone)) long
17 f2 (long a, long b, long c)
19 long d, e;
20 #pragma omp teams distribute simd default(none) firstprivate (a, b, c) shared(u, v, w) linear(d) lastprivate(e)
21 for (d = a; d < b; d++)
23 u[d] = v[d] + w[d];
24 e = c + d * 5;
26 return d + e;
29 __attribute__((noinline, noclone)) long
30 f3 (long a1, long b1, long a2, long b2)
32 long d1, d2;
33 #pragma omp teams distribute simd default(none) firstprivate (a1, b1, a2, b2) shared(u, v, w) lastprivate(d1, d2) collapse(2)
34 for (d1 = a1; d1 < b1; d1++)
35 for (d2 = a2; d2 < b2; d2++)
36 u[d1 * 32 + d2] = v[d1 * 32 + d2] + w[d1 * 32 + d2];
37 return d1 + d2;
40 __attribute__((noinline, noclone)) long
41 f4 (long a1, long b1, long a2, long b2)
43 long d1, d2;
44 #pragma omp teams distribute simd default(none) firstprivate (a1, b1, a2, b2) shared(u, v, w) collapse(2)
45 for (d1 = a1; d1 < b1; d1++)
46 for (d2 = a2; d2 < b2; d2++)
47 u[d1 * 32 + d2] = v[d1 * 32 + d2] + w[d1 * 32 + d2];
48 return d1 + d2;
51 int
52 main ()
54 if (f1 (0, 1024) != 1024
55 || f2 (0, 1024, 17) != 1024 + (17 + 5 * 1023)
56 || f3 (0, 32, 0, 32) != 64
57 || f4 (0, 32, 0, 32) != 64)
58 __builtin_abort ();
59 return 0;