Skip gnat.dg/prot7.adb on hppa.
[official-gcc.git] / libgomp / testsuite / libgomp.c-c++-common / icv-4.c
blob9da0d635bf5152d7e779a1c68befeb6131ab12e6
1 /* { dg-set-target-env-var OMP_NUM_TEAMS "6" } */
2 /* { dg-set-target-env-var OMP_TEAMS_THREAD_LIMIT "12" } */
4 #include <omp.h>
5 #include <stdlib.h>
6 #include <string.h>
8 int
9 main ()
11 if (getenv ("OMP_NUM_TEAMS") != NULL
12 && strcmp (getenv ("OMP_NUM_TEAMS"), "6") == 0)
14 if (omp_get_max_teams () != 6)
15 abort ();
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)
22 if (omp_get_teams_thread_limit () != 12)
23 abort ();
25 else
26 omp_set_teams_thread_limit (12);
27 #pragma omp teams
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 ();
40 return 0;