gcc/libgomp/testsuite/libgomp.c/pr32468.c
Jakub Jelinek 4f9c450c2f re PR libgomp/32468 (number of threads in a parallel region depends on number of SECTIONs and MAX_THREADS)
PR libgomp/32468
	* sections.c (GOMP_parallel_sections_start): Only decrease
	number of threads to COUNT if dyn_var is true.
	* testsuite/libgomp.c/pr32468.c: New test.

From-SVN: r126224
2007-07-02 21:19:28 +02:00

27 lines
429 B
C

/* PR libgomp/32468 */
/* { dg-do run } */
#include <omp.h>
#include <stdlib.h>
int
main (void)
{
int res[2] = { -1, -1 };
omp_set_dynamic (0);
omp_set_num_threads (4);
#pragma omp parallel
{
#pragma omp sections
{
#pragma omp section
res[0] = omp_get_num_threads () != 4;
#pragma omp section
res[1] = omp_get_num_threads () != 4;
}
}
if (res[0] != 0 || res[1] != 0)
abort ();
return 0;
}