ca431befaa
2015-06-15 Tom de Vries <tom@codesourcery.com> * testsuite/libgomp.c/atomic-18.c: Remove superfluous -fopenmp setting in dg-options. * testsuite/libgomp.c/atomic-3.c: Same. * testsuite/libgomp.c/debug-1.c: Same. * testsuite/libgomp.c/nqueens-1.c: Same. * testsuite/libgomp.c/pr26171.c: Same. * testsuite/libgomp.c/pr48591.c: Same. * testsuite/libgomp.c/pr64824.c: Same. * testsuite/libgomp.c/pr64868.c: Same. * testsuite/libgomp.c/pr66133.c: Same. * testsuite/libgomp.c/pr66199-1.c: Same. * testsuite/libgomp.c/pr66199-2.c: Same. * testsuite/libgomp.c/target-8.c: Same. From-SVN: r224480
62 lines
1.5 KiB
C
62 lines
1.5 KiB
C
/* PR middle-end/66199 */
|
|
/* { dg-do run } */
|
|
|
|
int u[1024], v[1024], w[1024];
|
|
|
|
__attribute__((noinline, noclone)) long
|
|
f1 (long a, long b)
|
|
{
|
|
long d;
|
|
#pragma omp parallel for simd default(none) firstprivate (a, b) shared(u, v, w)
|
|
for (d = a; d < b; d++)
|
|
u[d] = v[d] + w[d];
|
|
return d;
|
|
}
|
|
|
|
__attribute__((noinline, noclone)) long
|
|
f2 (long a, long b, long c)
|
|
{
|
|
long d, e;
|
|
#pragma omp parallel for simd default(none) firstprivate (a, b) shared(u, v, w) linear(d) linear(c:5) lastprivate(e)
|
|
for (d = a; d < b; d++)
|
|
{
|
|
u[d] = v[d] + w[d];
|
|
c += 5;
|
|
e = c;
|
|
}
|
|
return d + c + e;
|
|
}
|
|
|
|
__attribute__((noinline, noclone)) long
|
|
f3 (long a1, long b1, long a2, long b2)
|
|
{
|
|
long d1, d2;
|
|
#pragma omp parallel for simd 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];
|
|
return d1 + d2;
|
|
}
|
|
|
|
__attribute__((noinline, noclone)) long
|
|
f4 (long a1, long b1, long a2, long b2)
|
|
{
|
|
long d1, d2;
|
|
#pragma omp parallel for simd 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];
|
|
return d1 + d2;
|
|
}
|
|
|
|
int
|
|
main ()
|
|
{
|
|
if (f1 (0, 1024) != 1024
|
|
|| f2 (0, 1024, 17) != 1024 + 2 * (17 + 5 * 1024)
|
|
|| f3 (0, 32, 0, 32) != 64
|
|
|| f4 (0, 32, 0, 32) != 64)
|
|
__builtin_abort ();
|
|
return 0;
|
|
}
|