8c8e9a6bb6
2018-01-19 Tom de Vries <tom@codesourcery.com> Cesar Philippidis <cesar@codesourcery.com> PR target/83920 * config/nvptx/nvptx.c (nvptx_single): Fix jit workaround. * testsuite/libgomp.oacc-c-c++-common/pr83920.c: New test. * testsuite/libgomp.oacc-fortran/pr83920.f90: New test. Co-Authored-By: Cesar Philippidis <cesar@codesourcery.com> From-SVN: r256894
33 lines
486 B
C
33 lines
486 B
C
/* { dg-do run } */
|
|
|
|
#include <stdlib.h>
|
|
|
|
#define n 10
|
|
|
|
static void __attribute__((noinline)) __attribute__((noclone))
|
|
foo (int beta, int *c)
|
|
{
|
|
#pragma acc parallel copy(c[0:(n * n) - 1]) num_gangs(2)
|
|
#pragma acc loop gang
|
|
for (int j = 0; j < n; ++j)
|
|
if (beta != 1)
|
|
{
|
|
#pragma acc loop vector
|
|
for (int i = 0; i < n; ++i)
|
|
c[i + (j * n)] = 0;
|
|
}
|
|
}
|
|
|
|
int
|
|
main (void)
|
|
{
|
|
int c[n * n];
|
|
|
|
c[0] = 1;
|
|
foo (0, c);
|
|
if (c[0] != 0)
|
|
abort ();
|
|
|
|
return 0;
|
|
}
|