Files
llvm-project/offload/test/offloading/static_linking.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

29 lines
505 B
C

// clang-format off
// RUN: %libomptarget-compile-generic -DLIBRARY -c -o %t.o
// RUN: ar rcs %t.a %t.o
// RUN: %libomptarget-compile-generic %t.a && %libomptarget-run-generic 2>&1 | %fcheck-generic
// clang-format on
#ifdef LIBRARY
int x = 42;
#pragma omp declare target(x)
int foo() {
int value;
#pragma omp target map(from : value)
value = x;
return value;
}
#else
#include <stdio.h>
int foo(void);
int main() {
int x = foo();
// CHECK: PASS
if (x == 42)
printf("PASS\n");
}
#endif