xfail scan-tree-dump-not throw in g++.dg/pr99966.C on hppa*64*-*-*
[official-gcc.git] / libgomp / testsuite / libgomp.c-c++-common / nested-parallel-unbalanced.c
blobe777271dde1d49c66ae118f4daa87111ef87c1f2
1 /* Ensure that nested parallel regions work even when the number of loop
2 iterations is not divisible by the number of threads. */
4 #include <stdlib.h>
6 int main() {
7 int A[30][40], B[30][40];
8 size_t n = 30;
10 for (size_t i = 0; i < 30; ++i)
11 for (size_t j = 0; j < 40; ++j)
12 A[i][j] = 42;
14 #pragma omp target map(A[0:30][0:40], B[0:30][0:40])
16 #pragma omp parallel for num_threads(8)
17 for (size_t i = 0; i < n; ++i)
19 #pragma omp parallel for
20 for (size_t j = 0; j < n; ++j)
22 B[i][j] = A[i][j];
27 for (size_t i = 0; i < n; ++i)
28 for (size_t j = 0; j < n; ++j)
29 if (B[i][j] != 42)
30 abort ();