25 lines · cpp
1// RUN: %libomptarget-compilexx-run-and-check-generic2// RUN: %libomptarget-compileoptxx-run-and-check-generic3 4#include <cstdio>5struct S {6 S() : i(7) {}7 ~S() { foo(); }8 int foo() { return i; }9 10private:11 int i;12};13 14S s;15#pragma omp declare target(s)16 17int main() {18 int r;19#pragma omp target map(from : r)20 r = s.foo();21 22 // CHECK: 723 printf("%i\n", r);24}25