gcc/libgomp/testsuite/libgomp.oacc-c/nested-function-1.c

53 lines
935 B
C
Raw Normal View History

[PR middle-end/71373] Handle more OMP_CLAUSE_* in nested function decomposition gcc/ * gimplify.c (gimplify_adjust_omp_clauses): Discard OMP_CLAUSE_TILE. * omp-low.c (scan_sharing_clauses): Don't expect OMP_CLAUSE_TILE. gcc/testsuite/ * c-c++-common/goacc/combined-directives.c: XFAIL tree scanning for OpenACC tile clauses. * gfortran.dg/goacc/combined-directives.f90: Likewise. gcc/ PR middle-end/71373 * tree-nested.c (convert_nonlocal_omp_clauses) (convert_local_omp_clauses): Handle OMP_CLAUSE_ASYNC, OMP_CLAUSE_WAIT, OMP_CLAUSE_INDEPENDENT, OMP_CLAUSE_AUTO, OMP_CLAUSE__CACHE_, OMP_CLAUSE_TILE. gcc/testsuite/ PR middle-end/71373 * gcc.dg/goacc/nested-function-1.c: New file. * gcc.dg/goacc/nested-function-2.c: Likewise. * gcc.dg/goacc/pr71373.c: Likewise. * gfortran.dg/goacc/cray-2.f95: Likewise. * gfortran.dg/goacc/loop-1-2.f95: Likewise. * gfortran.dg/goacc/loop-3-2.f95: Likewise. * gfortran.dg/goacc/cray.f95: Update. * gfortran.dg/goacc/loop-1.f95: Likewise. * gfortran.dg/goacc/loop-3.f95: Likewise. * gfortran.dg/goacc/subroutines.f90: Update, and rename to... * gfortran.dg/goacc/nested-function-1.f90: ... this new file. libgomp/testsuite/ PR middle-end/71373 * libgomp.oacc-c/nested-function-1.c: New file. * libgomp.oacc-c/nested-function-2.c: Likewise. * libgomp.oacc-fortran/nested-function-1.f90: Likewise. * libgomp.oacc-fortran/nested-function-2.f90: Likewise. * libgomp.oacc-fortran/nested-function-3.f90: Likewise. Co-Authored-By: Cesar Philippidis <cesar@codesourcery.com> From-SVN: r237291
2016-06-10 11:22:51 +02:00
/* Exercise nested function decomposition, gcc/tree-nested.c. */
int
main (void)
{
void test1 ()
{
int i, j, k;
int a[4][7][8];
__builtin_memset (a, 0, sizeof (a));
#pragma acc parallel
#pragma acc loop collapse(4 - 1)
for (i = 1; i <= 3; i++)
for (j = 4; j <= 6; j++)
for (k = 5; k <= 7; k++)
a[i][j][k] = i + j + k;
for (i = 1; i <= 3; i++)
for (j = 4; j <= 6; j++)
for (k = 5; k <= 7; k++)
if (a[i][j][k] != i + j + k)
__builtin_abort();
}
void test2 ()
{
int i, j, k;
int a[4][4][4];
__builtin_memset (a, 0, sizeof (a));
#pragma acc parallel
#pragma acc loop collapse(3)
for (i = 1; i <= 3; i++)
for (j = 1; j <= 3; j++)
for (k = 1; k <= 3; k++)
a[i][j][k] = 1;
for (i = 1; i <= 3; i++)
for (j = 1; j <= 3; j++)
for (k = 1; k <= 3; k++)
if (a[i][j][k] != 1)
__builtin_abort ();
}
test1 ();
test2 ();
return 0;
}