[clangd] Re-land "support outgoing calls in call hierarchy" (#117673)
[llvm-project.git] / openmp / runtime / test / target / issue-81488.c
blobadac7d69944646a952275952398dda8228a9d64b
1 // RUN: %libomp-compile
2 // RUN: env OMP_NUM_THREADS=1 LIBOMP_USE_HIDDEN_HELPER_TASK=1 \
3 // RUN: LIBOMP_NUM_HIDDEN_HELPER_THREADS=8 %libomp-run
5 #include <stdio.h>
6 #include <stdlib.h>
7 #include <omp.h>
9 #define Nz 8
10 #define DEVICE_ID 0
12 int a[Nz];
14 int main(void) {
15 for (int n = 0; n < 10; ++n) {
16 for (int k = 0; k < Nz; ++k) {
17 a[k] = -1;
19 #pragma omp parallel shared(a)
21 #pragma omp single
23 #pragma omp target teams distribute parallel for nowait device(DEVICE_ID) \
24 map(tofrom : a[0 : 8])
25 for (int i = 0; i < Nz; ++i) {
26 a[i] = i;
29 #pragma omp barrier
31 for (int k = 0; k < Nz; ++k) {
32 printf("a[%d] = %d\n", k, a[k]);
35 return 0;