25 lines · c
1// RUN: %libomptarget-compile-run-and-check-generic2 3// FIXME: https://github.com/llvm/llvm-project/issues/1612654// UNSUPPORTED: gpu5 6#include <omp.h>7#include <stdio.h>8 9int main() {10 int b = 0;11 12#pragma omp target map(tofrom : b) thread_limit(256)13 for (int i = 1; i <= 1; ++i) {14#pragma omp parallel num_threads(64) reduction(+ : b)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: 64022 printf("b: %i\n", b);23 return 0;24}25