3 /* Like imperfect2.c, but includes bindings in the blocks. */
5 static int f1count[3], f2count[3];
6 static int g1count[3], g2count[3];
9 extern void abort (void);
11 extern "C" void abort (void);
14 int f1 (int depth, int iter)
20 int f2 (int depth, int iter)
26 int g1 (int depth, int iter)
32 int g2 (int depth, int iter)
38 void s1 (int a1, int a2, int a3)
42 [[ omp :: directive (for, collapse(3)) ]]
43 for (i = 0; i < a1; i++)
49 for (j = 0; j < a2; j++)
55 for (k = 0; k < a3; k++)
94 /* All intervening code at the same depth must be executed the same
96 if (f1count[0] != f2count[0]) abort ();
97 if (f1count[1] != f2count[1]) abort ();
98 if (f1count[2] != f2count[2]) abort ();
99 if (g1count[0] != f1count[0]) abort ();
100 if (g2count[0] != f1count[0]) abort ();
101 if (g1count[1] != f1count[1]) abort ();
102 if (g2count[1] != f1count[1]) abort ();
103 if (g1count[2] != f1count[2]) abort ();
104 if (g2count[2] != f1count[2]) abort ();
106 /* Intervening code must be executed at least as many times as the loop
108 if (f1count[0] < 3) abort ();
109 if (f1count[1] < 3 * 4) abort ();
111 /* Intervening code must not be executed more times than the number
112 of logical iterations. */
113 if (f1count[0] > 3 * 4 * 5) abort ();
114 if (f1count[1] > 3 * 4 * 5) abort ();
116 /* Check that the innermost loop body is executed exactly the number
117 of logical iterations expected. */
118 if (f1count[2] != 3 * 4 * 5) abort ();