1// RUN: %libomptarget-compilexx-run-and-check-generic
2// RUN: %libomptarget-compileoptxx-run-and-check-generic
3
4#include <cassert>
5#include <iostream>
6
7int main(int argc, char *argv[]) {
8 int i = 0, j = 0;
9
10#pragma omp target map(tofrom : i, j) nowait
11 {
12 i = 1;
13 j = 2;
14 }
15
16#pragma omp taskwait
17
18 assert(i == 1);
19 assert(j == 2);
20
21 std::cout << "PASS\n";
22
23 return 0;
24}
25
26// CHECK: PASS
27

source code of offload/test/offloading/bug47654.cpp