Skip gnat.dg/prot7.adb on hppa.
[official-gcc.git] / libgomp / testsuite / libgomp.c-c++-common / pr66199-6.c
blob86467d7c726acaa01d8c1d675b1766fbf148a0f4
1 /* PR middle-end/66199 */
2 /* { dg-do run } */
3 /* { dg-options "-O2" { target c } } */
5 #pragma omp declare target
6 int u[1024], v[1024], w[1024];
7 #pragma omp end declare target
9 __attribute__((noinline, noclone)) long
10 f2 (long a, long b, long c)
12 long d, e;
13 #pragma omp target map(from: d, e)
14 #pragma omp teams distribute parallel for default(none) firstprivate (a, b, c) shared(u, v, w) lastprivate(d, e)
15 for (d = a; d < b; d++)
17 u[d] = v[d] + w[d];
18 e = c + d * 5;
20 return d + e;
23 __attribute__((noinline, noclone)) long
24 f3 (long a1, long b1, long a2, long b2)
26 long d1, d2;
27 #pragma omp target map(from: d1, d2)
28 #pragma omp teams distribute parallel for default(none) firstprivate (a1, b1, a2, b2) shared(u, v, w) lastprivate(d1, d2) collapse(2)
29 for (d1 = a1; d1 < b1; d1++)
30 for (d2 = a2; d2 < b2; d2++)
31 u[d1 * 32 + d2] = v[d1 * 32 + d2] + w[d1 * 32 + d2];
32 return d1 + d2;
35 int
36 main ()
38 if (f2 (0, 1024, 17) != 1024 + (17 + 5 * 1023)
39 || f3 (0, 32, 0, 32) != 64)
40 __builtin_abort ();
41 return 0;