[memprof] Move YAML support to MemProfYAML.h (NFC) (#119515)
[llvm-project.git] / offload / test / api / omp_dynamic_shared_memory_amdgpu.c
blob1aaec06659a7b5d437b73cd9097231af8566282b
1 // RUN: %libomptarget-compile-amdgcn-amd-amdhsa -O2 -mllvm \
2 // RUN: -openmp-opt-inline-device
3 // RUN: env LIBOMPTARGET_SHARED_MEMORY_SIZE=256 \
4 // RUN: %libomptarget-run-amdgcn-amd-amdhsa | %fcheck-amdgcn-amd-amdhsa
5 // REQUIRES: amdgcn-amd-amdhsa
7 #include <omp.h>
8 #include <stdio.h>
10 int main() {
11 int x;
12 #pragma omp target parallel map(from : x)
14 int *buf = llvm_omp_target_dynamic_shared_alloc() + 252;
15 #pragma omp barrier
16 if (omp_get_thread_num() == 0)
17 *buf = 1;
18 #pragma omp barrier
19 if (omp_get_thread_num() == 1)
20 x = *buf;
23 // CHECK: PASS
24 if (x == 1 && llvm_omp_target_dynamic_shared_alloc() == NULL)
25 printf("PASS\n");