Bump version to 19.1.0-rc3
[llvm-project.git] / offload / test / offloading / ctor_dtor.cpp
blob7f08798dea103b32617f4e7c61984a4c6c99e67b
1 // RUN: %libomptarget-compilexx-run-and-check-generic
2 // RUN: %libomptarget-compileoptxx-run-and-check-generic
4 #include <cstdio>
5 struct S {
6 S() : i(7) {}
7 ~S() { foo(); }
8 int foo() { return i; }
10 private:
11 int i;
14 S s;
15 #pragma omp declare target(s)
17 int main() {
18 int r;
19 #pragma omp target map(from : r)
20 r = s.foo();
22 // CHECK: 7
23 printf("%i\n", r);