25 lines · c
1// RUN: %libomptarget-compile-run-and-check-generic2// RUN: %libomptarget-compileopt-run-and-check-generic3 4// FIXME: https://github.com/llvm/llvm-project/issues/1612655// UNSUPPORTED: gpu6 7#include <omp.h>8#include <stdio.h>9 10int main() {11 int b = 0;12 13#pragma omp target map(tofrom : b)14 for (int i = 1; i <= 10; ++i) {15#pragma omp parallel num_threads(10) reduction(+ : b)16#pragma omp for17 for (int k = 0; k < 10; ++k)18 ++b;19 }20 21 // CHECK: b: 10022 printf("b: %i\n", b);23 return 0;24}25