gcc/libgomp/testsuite/libgomp.c-c++-common/pr83046.c
Tom de Vries 60bf575ccb Prune removed funcs from offload table
2017-12-30  Tom de Vries  <tom@codesourcery.com>

	PR libgomp/83046
	* omp-expand.c (expand_omp_target): If in_lto_p, mark offload_funcs with
	DECL_PRESERVE_P.
	* lto-streamer-out.c (prune_offload_funcs): New function.  Remove
	offload_funcs entries that no longer have a corresponding cgraph_node.
	Mark the remaining ones as DECL_PRESERVE_P.
	(output_lto): Call prune_offload_funcs.

	* testsuite/libgomp.oacc-c-c++-common/pr83046.c: New test.
	* testsuite/libgomp.c-c++-common/pr83046.c: New test.

From-SVN: r256045
2017-12-30 17:02:00 +00:00

26 lines
272 B
C

/* { dg-do link } */
#define N 100
int
main ()
{
int a[N];
int i, x;
int c;
c = 1;
#pragma omp target
for (i = 0; i < 100; i++)
a[i] = 0;
if (c)
__builtin_unreachable ();
#pragma omp target
for (i = 0; i < 100; i++)
a[i] = 1;
return 0;
}