gcc/libgomp/testsuite/libgomp.c++/pr34513.C
Jakub Jelinek 5259c81310 re PR c++/34513 (static variable not found for C++ OpenMP)
PR c++/34513
	* parser.c (cp_parser_omp_parallel): For non-combined parallel
	call cp_parser_statement rather than
	cp_parser_already_scoped_statement.

	* testsuite/libgomp.c/pr34513.c: New test.
	* testsuite/libgomp.c++/pr34513.C: New test.

From-SVN: r131059
2007-12-19 13:58:32 +01:00

33 lines
396 B
C

// PR c++/34513
// { dg-do run }
#include <omp.h>
extern "C" void abort ();
static int errors = 0;
static int thrs = 4;
int
main ()
{
omp_set_dynamic (0);
#pragma omp parallel num_threads (thrs)
{
static int shrd = 0;
#pragma omp atomic
shrd += 1;
#pragma omp barrier
if (shrd != thrs)
#pragma omp atomic
errors += 1;
}
if (errors)
abort ();
}