gcc/libgomp/testsuite/libgomp.c/pr66199-4.c
Tom de Vries 5c561fa938 Remove superfluous -fopenmp from libgomp testcases
Reviewed-by: Thomas Schwinge <thomas@codesourcery.com>

2017-09-28  Tom de Vries  <tom@codesourcery.com>

	* testsuite/libgomp.c++/for-12.C: Remove superfluous -fopenmp option
	setting.
	* testsuite/libgomp.c++/pr69393.C: Same.
	* testsuite/libgomp.c++/taskloop-1.C: Same.
	* testsuite/libgomp.c++/taskloop-3.C: Same.
	* testsuite/libgomp.c++/taskloop-4.C: Same.
	* testsuite/libgomp.c/for-4.c: Same.
	* testsuite/libgomp.c/pr66199-3.c: Same.
	* testsuite/libgomp.c/pr66199-4.c: Same.
	* testsuite/libgomp.c/pr66199-6.c: Same.
	* testsuite/libgomp.c/taskloop-1.c: Same.
	* testsuite/libgomp.c/taskloop-3.c: Same.
	* testsuite/libgomp.c/taskloop-4.c: Same.
	* testsuite/libgomp.fortran/aligned1.f03: Same.
	* testsuite/libgomp.fortran/condinc1.f: Same.
	* testsuite/libgomp.fortran/condinc3.f90: Same.
	* testsuite/libgomp.fortran/crayptr1.f90: Same.
	* testsuite/libgomp.fortran/crayptr2.f90: Same.
	* testsuite/libgomp.fortran/crayptr3.f90: Same.
	* testsuite/libgomp.fortran/omp_cond1.f: Same.
	* testsuite/libgomp.fortran/omp_cond3.F90: Same.
	* testsuite/libgomp.fortran/pr66199-1.f90: Same.
	* testsuite/libgomp.fortran/pr66199-2.f90: Same.
	* testsuite/libgomp.fortran/recursion1.f90: Same.
	* testsuite/libgomp.fortran/target2.f90: Same.
	* testsuite/libgomp.fortran/target5.f90: Same.
	* testsuite/libgomp.fortran/task3.f90: Same.

From-SVN: r253250
2017-09-28 09:32:00 +00:00

59 lines
1.5 KiB
C

/* PR middle-end/66199 */
/* { dg-do run } */
/* { dg-options "-O2" } */
#pragma omp declare target
int u[1024], v[1024], w[1024];
#pragma omp end declare target
__attribute__((noinline, noclone)) void
f1 (long a, long b)
{
long d;
#pragma omp target teams distribute parallel for default(none) firstprivate (a, b) shared(u, v, w)
for (d = a; d < b; d++)
u[d] = v[d] + w[d];
}
__attribute__((noinline, noclone)) void
f2 (long a, long b, long c)
{
long d, e;
#pragma omp target teams distribute parallel for default(none) firstprivate (a, b, c) shared(u, v, w) lastprivate(d, e)
for (d = a; d < b; d++)
{
u[d] = v[d] + w[d];
e = c + d * 5;
}
}
__attribute__((noinline, noclone)) void
f3 (long a1, long b1, long a2, long b2)
{
long d1, d2;
#pragma omp target teams distribute parallel for default(none) firstprivate (a1, b1, a2, b2) shared(u, v, w) lastprivate(d1, d2) collapse(2)
for (d1 = a1; d1 < b1; d1++)
for (d2 = a2; d2 < b2; d2++)
u[d1 * 32 + d2] = v[d1 * 32 + d2] + w[d1 * 32 + d2];
}
__attribute__((noinline, noclone)) void
f4 (long a1, long b1, long a2, long b2)
{
long d1, d2;
#pragma omp target teams distribute parallel for default(none) firstprivate (a1, b1, a2, b2) shared(u, v, w) collapse(2)
for (d1 = a1; d1 < b1; d1++)
for (d2 = a2; d2 < b2; d2++)
u[d1 * 32 + d2] = v[d1 * 32 + d2] + w[d1 * 32 + d2];
}
int
main ()
{
f1 (0, 1024);
f2 (0, 1024, 17);
f3 (0, 32, 0, 32);
f4 (0, 32, 0, 32);
return 0;
}