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

28 lines
389 B
C++

// clang-format off
// RUN: %libomptarget-compilexx-generic && %libomptarget-run-generic | %fcheck-generic
// clang-format on
#include <cstdio>
int foo() { return 1; }
class C {
public:
C() : x(foo()) {}
int x;
};
C c;
#pragma omp declare target(c)
int main() {
int x = 0;
#pragma omp target map(from : x)
{ x = c.x; }
// CHECK: PASS
if (x == 1)
printf("PASS\n");
}