1 // RUN: %libomptarget-compilexx-run-and-check-generic 2 3 // REQUIRES: libc 4 5 #include <stdio.h> 6 7 #pragma omp begin declare target device_type(nohost) 8 9 // CHECK: void ctor1() 10 // CHECK: void ctor2() 11 // CHECK: void ctor3() ctor1()12[[gnu::constructor(101)]] void ctor1() { puts(__PRETTY_FUNCTION__); } ctor2()13[[gnu::constructor(102)]] void ctor2() { puts(__PRETTY_FUNCTION__); } ctor3()14[[gnu::constructor(103)]] void ctor3() { puts(__PRETTY_FUNCTION__); } 15 16 struct S { SS17 S() { puts(__PRETTY_FUNCTION__); } ~SS18 ~S() { puts(__PRETTY_FUNCTION__); } 19 }; 20 21 // CHECK: S::S() 22 // CHECK: S::~S() 23 S s; 24 25 // CHECK: void dtor3() 26 // CHECK: void dtor2() 27 // CHECK: void dtor1() dtor1()28[[gnu::destructor(101)]] void dtor1() { puts(__PRETTY_FUNCTION__); } dtor3()29[[gnu::destructor(103)]] void dtor3() { puts(__PRETTY_FUNCTION__); } dtor2()30[[gnu::destructor(102)]] void dtor2() { puts(__PRETTY_FUNCTION__); } 31 32 #pragma omp end declare target 33 main()34int main() { 35 #pragma omp target 36 ; 37 } 38