1// RUN: %libomp-compile-and-run
2
3// Non-rectangular loop collapsing.
4//
5// Nested loops conform to OpenMP 5.2 standard,
6// inner loops bounds may depend on outer loops induction variables.
7
8#define LOOP_TYPES int
9#define LOOP \
10 for (i = iLB; i <= iUB; i += iStep) \
11 for (j = i + jA0; j <= i + jB0; j += jStep) \
12 for (k = j + kA0; k <= j + kB0; k += kStep)
13
14#include "collapse_test.inc"
15
16int main() {
17 int fail;
18 iLB = -2;
19 iUB = 3;
20 jA0 = -7;
21 jB0 = 13;
22 kA0 = -20;
23 kB0 = 111;
24 iStep = 5;
25 jStep = 9;
26 kStep = 10;
27 PRINTF("\nOne off iLB=%d; iUB=%d; jA0=%d; jB0=%d; kA0=%d; kB0=%d; iStep=%d; "
28 "jStep=%d; kStep=%d;\n",
29 iLB, iUB, jA0, jB0, kA0, kB0, iStep, jStep, kStep);
30 fail = (test() == 0);
31 return fail;
32}
33

source code of openmp/runtime/test/worksharing/for/omp_collapse_one_int.c