PR testsuite/85483: Move aarch64/sve/vcond_1.c test to g++.dg/other/
[official-gcc.git] / libgomp / testsuite / libgomp.c / pr66199-3.c
blobffe28589933105ecffe964a1ca6d9b9b5d384bd1
1 /* PR middle-end/66199 */
2 /* { dg-do run } */
3 /* { dg-options "-O2" } */
5 int u[1024], v[1024], w[1024];
7 __attribute__((noinline, noclone)) long
8 f1 (long a, long b)
10 long d;
11 #pragma omp parallel for lastprivate (d) default(none) firstprivate (a, b) shared(u, v, w)
12 for (d = a; d < b; d++)
13 u[d] = v[d] + w[d];
14 return d;
17 __attribute__((noinline, noclone)) long
18 f2 (long a, long b, long c)
20 long d, e;
21 #pragma omp parallel for lastprivate (d) default(none) firstprivate (a, b) shared(u, v, w) linear(c:5) lastprivate(e)
22 for (d = a; d < b; d++)
24 u[d] = v[d] + w[d];
25 c += 5;
26 e = c;
28 return d + c + e;
31 __attribute__((noinline, noclone)) long
32 f3 (long a1, long b1, long a2, long b2)
34 long d1, d2;
35 #pragma omp parallel for default(none) firstprivate (a1, b1, a2, b2) shared(u, v, w) lastprivate(d1, d2) collapse(2)
36 for (d1 = a1; d1 < b1; d1++)
37 for (d2 = a2; d2 < b2; d2++)
38 u[d1 * 32 + d2] = v[d1 * 32 + d2] + w[d1 * 32 + d2];
39 return d1 + d2;
42 int
43 main ()
45 if (f1 (0, 1024) != 1024
46 || f2 (0, 1024, 17) != 1024 + 2 * (17 + 5 * 1024)
47 || f3 (0, 32, 0, 32) != 64)
48 __builtin_abort ();
49 return 0;