c7c30edd4a
2018-02-08 Martin Jambor <mjambor@suse.cz> * hsa-gen.c (get_symbol_for_decl): Set program allocation for static local variables. libgomp/ * testsuite/libgomp.hsa.c/staticvar.c: New test. From-SVN: r257484
24 lines
257 B
C
24 lines
257 B
C
extern void abort (void);
|
|
|
|
#pragma omp declare target
|
|
int
|
|
foo (void)
|
|
{
|
|
static int s;
|
|
return ++s;
|
|
}
|
|
#pragma omp end declare target
|
|
|
|
int
|
|
main ()
|
|
{
|
|
int r;
|
|
#pragma omp target map(from:r)
|
|
{
|
|
r = foo ();
|
|
}
|
|
if (r != 1)
|
|
abort ();
|
|
return 0;
|
|
}
|