* es.po: Update.
[official-gcc.git] / libgomp / testsuite / libgomp.c / pr66199-4.c
bloba9b1bb8a59e992130f73a7a99232d6a370f9d392
1 /* PR middle-end/66199 */
2 /* { dg-do run } */
3 /* { dg-options "-O2 -fopenmp" } */
5 #pragma omp declare target
6 int u[1024], v[1024], w[1024];
7 #pragma omp end declare target
9 __attribute__((noinline, noclone)) void
10 f1 (long a, long b)
12 long d;
13 #pragma omp target teams distribute parallel for default(none) firstprivate (a, b) shared(u, v, w)
14 for (d = a; d < b; d++)
15 u[d] = v[d] + w[d];
18 __attribute__((noinline, noclone)) void
19 f2 (long a, long b, long c)
21 long d, e;
22 #pragma omp target teams distribute parallel for default(none) firstprivate (a, b, c) shared(u, v, w) lastprivate(d, e)
23 for (d = a; d < b; d++)
25 u[d] = v[d] + w[d];
26 e = c + d * 5;
30 __attribute__((noinline, noclone)) void
31 f3 (long a1, long b1, long a2, long b2)
33 long d1, d2;
34 #pragma omp target teams distribute parallel for default(none) firstprivate (a1, b1, a2, b2) shared(u, v, w) lastprivate(d1, d2) collapse(2)
35 for (d1 = a1; d1 < b1; d1++)
36 for (d2 = a2; d2 < b2; d2++)
37 u[d1 * 32 + d2] = v[d1 * 32 + d2] + w[d1 * 32 + d2];
40 __attribute__((noinline, noclone)) void
41 f4 (long a1, long b1, long a2, long b2)
43 long d1, d2;
44 #pragma omp target teams distribute parallel for 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];
50 int
51 main ()
53 f1 (0, 1024);
54 f2 (0, 1024, 17);
55 f3 (0, 32, 0, 32);
56 f4 (0, 32, 0, 32);
57 return 0;