brintos

brintos / llvm-project-archived public Read only

0
0
Text · 350 B · eb68c5f Raw
26 lines · cpp
1// RUN: %libomptarget-compilexx-generic && %libomptarget-run-generic | %fcheck-generic2 3#include <cstdio>4 5int foo() { return 1; }6 7class C {8public:9  C() : x(foo()) {}10 11  int x;12};13 14C c;15#pragma omp declare target(c)16 17int main() {18  int x = 0;19#pragma omp target map(from : x)20  { x = c.x; }21 22  // CHECK: PASS23  if (x == 1)24    printf("PASS\n");25}26