gcc/libgomp/testsuite/libgomp.hsa.c/staticvar.c
Martin Jambor c7c30edd4a [hsa] Set program allocation for static local variables
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
2018-02-08 14:03:52 +01:00

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;
}