llvm-project/offload/test/mapping/map_ordering_tgt_alloc_tofrom.c
fineg74 1611a23a5b
[OFFLOAD] Add spirv implementation for named barrier (#180393)
This change adds implementation for named barriers for SPIRV backend.
Since there is no built in API/intrinsics for named barrier in SPIRV,
the implementation loosely follows implementation for AMD
2026-03-27 20:14:09 +01:00

14 lines
251 B
C

// RUN: %libomptarget-compile-run-and-check-generic
#include <stdio.h>
int main() {
int x = 111;
#pragma omp target map(alloc : x) map(tofrom : x) map(alloc : x)
{
x = x + 111;
}
printf("After tgt: %d\n", x); // CHECK: After tgt: 222
}