Johannes Doerfert a273d17d4a [OpenMP][FIX] Do not add implicit argument to device Ctors and Dtors
Constructors and destructors on the device do not take any arguments,
also not the implicit dyn_ptr argument other kernels automatically take.
2023-11-01 11:18:11 -07:00

25 lines
370 B
C++

// RUN: %libomptarget-compilexx-run-and-check-generic
// RUN: %libomptarget-compileoptxx-run-and-check-generic
//
#include <cstdio>
struct S {
S() : i(7) {}
~S() { foo(); }
int foo() { return i; }
private:
int i;
};
S s;
#pragma omp declare target(s)
int main() {
int r;
#pragma omp target map(from : r)
r = s.foo();
// CHECK: 7
printf("%i\n", r);
}