44a0c6cbeb
* testsuite/libgomp.c/affinity-1.c: Fix implicit declarations. * testsuite/libgomp.c/nqueens-1.c: Likewise. * testsuite/libgomp.c/pr26943-3.c: Likewise. * testsuite/libgomp.c/pr26943-4.c: Likewise. * testsuite/libgomp.c/pr36802-2.c: Likewise. * testsuite/libgomp.c/pr36802-3.c: Likewise. * testsuite/libgomp.c/thread-limit-1.c: Likewise. * testsuite/libgomp.c/thread-limit-2.c: Likewise. * testsuite/libgomp.c/appendix-a/a.15.1.c: Include <omp.h>. * testsuite/libgomp.c/omp-loop02.c: Fix defaulting to int. * testsuite/libgomp.c/omp-parallel-for.c: Likewise. * testsuite/libgomp.c/omp-parallel-if.c: Likewise. * testsuite/libgomp.c/omp-single-1.c: Likewise. * testsuite/libgomp.c/omp-single-2.c: Likewise. * testsuite/libgomp.c/omp_matvec.c: Likewise. * testsuite/libgomp.c/omp_workshare3.c: Likewise. * testsuite/libgomp.c/omp_workshare4.c: Likewise. * testsuite/libgomp.c/shared-1.c: Fix defaulting to int. Fix implicit declarations. From-SVN: r215922
42 lines
541 B
C
42 lines
541 B
C
#include <omp.h>
|
|
|
|
extern void abort (void);
|
|
|
|
int
|
|
foo (void)
|
|
{
|
|
return 10;
|
|
}
|
|
|
|
int
|
|
main ()
|
|
{
|
|
int A = 0;
|
|
|
|
#pragma omp parallel if (foo () > 10) shared (A)
|
|
{
|
|
A = omp_get_num_threads ();
|
|
}
|
|
|
|
if (A != 1)
|
|
abort ();
|
|
|
|
#pragma omp parallel if (foo () == 10) num_threads (3) shared (A)
|
|
{
|
|
A = omp_get_num_threads ();
|
|
}
|
|
|
|
if (A != 3)
|
|
abort ();
|
|
|
|
#pragma omp parallel if (foo () == 10) num_threads (foo ()) shared (A)
|
|
{
|
|
A = omp_get_num_threads ();
|
|
}
|
|
|
|
if (A != 10)
|
|
abort ();
|
|
|
|
return 0;
|
|
}
|