0d8a9e2065
2015-06-15 Tom de Vries <tom@codesourcery.com> * testsuite/libgomp.c/collapse-3.c: Use dg-additional-options for -std={gnu99,c99}. * testsuite/libgomp.c/for-1.c: Same. * testsuite/libgomp.c/for-2.c: Same. * testsuite/libgomp.c/for-3.c: Same. * testsuite/libgomp.c/pr35625.c: Same. * testsuite/libgomp.c/pr39154.c: Same. * testsuite/libgomp.c/simd-16.c: Same. * testsuite/libgomp.c/simd-17.c: Same. From-SVN: r224479
106 lines
1.8 KiB
C
106 lines
1.8 KiB
C
/* PR middle-end/39154 */
|
|
/* { dg-do compile } */
|
|
/* { dg-additional-options "-std=gnu99" } */
|
|
|
|
extern void abort (void);
|
|
|
|
int n = 20;
|
|
|
|
int
|
|
main (void)
|
|
{
|
|
int a[n], b[n][n];
|
|
|
|
#pragma omp parallel for
|
|
for (int i = 0; i < n; i++)
|
|
{
|
|
a[i] = i + 1;
|
|
#pragma omp parallel for
|
|
for (int j = 0; j < n; j++)
|
|
b[i][j] = a[i];
|
|
}
|
|
|
|
for (int i = 0; i < n; i++)
|
|
{
|
|
for (int j = 0; j < n; j++)
|
|
if (b[i][j] != i + 1)
|
|
abort ();
|
|
if (a[i] != i + 1)
|
|
abort ();
|
|
}
|
|
|
|
#pragma omp parallel for shared (n, a, b)
|
|
for (int i = 0; i < n; i++)
|
|
{
|
|
a[i] = i + 3;
|
|
#pragma omp parallel for
|
|
for (int j = 0; j < n; j++)
|
|
b[i][j] = a[i];
|
|
}
|
|
|
|
for (int i = 0; i < n; i++)
|
|
{
|
|
for (int j = 0; j < n; j++)
|
|
if (b[i][j] != i + 3)
|
|
abort ();
|
|
if (a[i] != i + 3)
|
|
abort ();
|
|
}
|
|
|
|
#pragma omp parallel for
|
|
for (int i = 0; i < n; i++)
|
|
{
|
|
a[i] = i + 5;
|
|
#pragma omp parallel for shared (n, a, b)
|
|
for (int j = 0; j < n; j++)
|
|
b[i][j] = a[i];
|
|
}
|
|
|
|
for (int i = 0; i < n; i++)
|
|
{
|
|
for (int j = 0; j < n; j++)
|
|
if (b[i][j] != i + 5)
|
|
abort ();
|
|
if (a[i] != i + 5)
|
|
abort ();
|
|
}
|
|
|
|
#pragma omp parallel for shared (n, a, b)
|
|
for (int i = 0; i < n; i++)
|
|
{
|
|
a[i] = i + 7;
|
|
#pragma omp parallel for shared (n, a, b)
|
|
for (int j = 0; j < n; j++)
|
|
b[i][j] = a[i];
|
|
}
|
|
|
|
for (int i = 0; i < n; i++)
|
|
{
|
|
for (int j = 0; j < n; j++)
|
|
if (b[i][j] != i + 7)
|
|
abort ();
|
|
if (a[i] != i + 7)
|
|
abort ();
|
|
}
|
|
|
|
#pragma omp parallel for private (a, b)
|
|
for (int i = 0; i < n; i++)
|
|
{
|
|
a[i] = i + 1;
|
|
#pragma omp parallel for
|
|
for (int j = 0; j < n; j++)
|
|
b[i][j] = a[i];
|
|
}
|
|
|
|
#pragma omp parallel for private (a, b)
|
|
for (int i = 0; i < n; i++)
|
|
{
|
|
a[i] = i + 1;
|
|
#pragma omp parallel for private (b)
|
|
for (int j = 0; j < n; j++)
|
|
b[i][j] = a[i];
|
|
}
|
|
|
|
return 0;
|
|
}
|