1// RUN: %libomptarget-compile-run-and-check-generic
2// RUN: %libomptarget-compileopt-run-and-check-generic
3
4#include <omp.h>
5#include <stdio.h>
6
7__attribute__((optnone)) void optnone() {}
8
9int main() {
10 int i = 0;
11#pragma omp target teams num_teams(1) map(tofrom : i)
12 {
13 optnone();
14#pragma omp parallel
15 if (omp_get_thread_num() == 0)
16 ++i;
17#pragma omp parallel
18 if (omp_get_thread_num() == 0)
19 ++i;
20#pragma omp parallel
21 if (omp_get_thread_num() == 0)
22 ++i;
23#pragma omp parallel
24 if (omp_get_thread_num() == 0)
25 ++i;
26 }
27 // CHECK: 4
28 printf(format: "%i\n", i);
29}
30

source code of offload/test/offloading/generic_multiple_parallel_regions.c