| 1 |
/* { dg-set-target-env-var OMP_NUM_TEAMS "6" } */ |
| 2 |
/* { dg-set-target-env-var OMP_TEAMS_THREAD_LIMIT "12" } */ |
| 3 |
|
| 4 |
#include <omp.h> |
| 5 |
#include <stdlib.h> |
| 6 |
#include <string.h> |
| 7 |
|
| 8 |
int |
| 9 |
main () |
| 10 |
{ |
| 11 |
if (getenv ("OMP_NUM_TEAMS") != NULL |
| 12 |
&& strcmp (getenv ("OMP_NUM_TEAMS"), "6") == 0) |
| 13 |
{ |
| 14 |
if (omp_get_max_teams () != 6) |
| 15 |
abort (); |
| 16 |
} |
| 17 |
else |
| 18 |
omp_set_num_teams (6); |
| 19 |
if (getenv ("OMP_TEAMS_THREAD_LIMIT") != NULL |
| 20 |
&& strcmp (getenv ("OMP_TEAMS_THREAD_LIMIT"), "12") == 0) |
| 21 |
{ |
| 22 |
if (omp_get_teams_thread_limit () != 12) |
| 23 |
abort (); |
| 24 |
} |
| 25 |
else |
| 26 |
omp_set_teams_thread_limit (12); |
| 27 |
#pragma omp teams |
| 28 |
{ |
| 29 |
#pragma omp parallel if(0) |
| 30 |
if (omp_get_max_teams () != 6 |
| 31 |
|| omp_get_teams_thread_limit () != 12 |
| 32 |
|| omp_get_num_teams () < 1 |
| 33 |
|| omp_get_num_teams () > 6 |
| 34 |
|| omp_get_team_num () < 0 |
| 35 |
|| omp_get_team_num () >= omp_get_num_teams () |
| 36 |
|| omp_get_thread_limit () < 1 |
| 37 |
|| omp_get_thread_limit () > 12) |
| 38 |
abort (); |
| 39 |
} |
| 40 |
return 0; |
| 41 |
} |