Bump version to 19.1.0-rc3
[llvm-project.git] / offload / test / offloading / global_constructor.cpp
blobeb68c5f78358be5f91cc12abab8785c0373cf011
1 // RUN: %libomptarget-compilexx-generic && %libomptarget-run-generic | %fcheck-generic
3 #include <cstdio>
5 int foo() { return 1; }
7 class C {
8 public:
9 C() : x(foo()) {}
11 int x;
14 C c;
15 #pragma omp declare target(c)
17 int main() {
18 int x = 0;
19 #pragma omp target map(from : x)
20 { x = c.x; }
22 // CHECK: PASS
23 if (x == 1)
24 printf("PASS\n");