gcc/libgomp/testsuite/libgomp.c/pr81687-1.c
Jakub Jelinek 50aa16c388 re PR c/81687 (Compiler drops label in OpenMP region)
PR c/81687
	* omp-low.c (omp_copy_decl): Don't remap FORCED_LABEL or DECL_NONLOCAL
	LABEL_DECLs.
	* tree-cfg.c (move_stmt_op): Don't adjust DECL_CONTEXT of FORCED_LABEL
	or DECL_NONLOCAL labels.
	(move_stmt_r) <case GIMPLE_LABEL>: Adjust DECL_CONTEXT of FORCED_LABEL
	or DECL_NONLOCAL labels here.

	* testsuite/libgomp.c/pr81687-1.c: New test.
	* testsuite/libgomp.c/pr81687-2.c: New test.

From-SVN: r251019
2017-08-10 02:33:20 +02:00

24 lines
362 B
C

/* PR c/81687 */
/* { dg-do link } */
/* { dg-additional-options "-O2" } */
extern int printf (const char *, ...);
int
main ()
{
#pragma omp parallel
{
lab1:
printf ("lab1=%p\n", (void *)(&&lab1));
}
lab2:
#pragma omp parallel
{
lab3:
printf ("lab2=%p\n", (void *)(&&lab2));
}
printf ("lab3=%p\n", (void *)(&&lab3));
return 0;
}