1 /* { dg-do compile { target c++11 } } */
3 /* This test case is expected to fail due to errors. */
5 /* These functions that are part of the OpenMP runtime API would ordinarily
6 be declared in omp.h, but we don't have that here. */
7 extern int omp_get_num_threads(void);
8 extern int omp_get_max_threads(void);
10 int f1 (int depth, int iter);
11 int f2 (int depth, int iter);
13 void s1 (int a1, int a2, int a3)
16 [[ omp :: directive (for, collapse(3)) ]]
17 for (i = 0; i < a1; i++)
20 for (j = 0; j < omp_get_num_threads (); j++) /* This is OK */
22 f1 (1, omp_get_num_threads ()); /* { dg-error "not permitted in intervening code" } */
23 for (k = omp_get_num_threads (); k < a3; k++) /* This is OK */
25 f1 (2, omp_get_num_threads ());
26 f2 (2, omp_get_max_threads ());
28 f2 (1, omp_get_max_threads ()); /* { dg-error "not permitted in intervening code" } */