27 lines · c
1// RUN: %libomptarget-compile-generic -DLIBRARY -c -o %t.o2// RUN: ar rcs %t.a %t.o3// RUN: %libomptarget-compile-generic %t.a && %libomptarget-run-generic 2>&1 | %fcheck-generic4 5#ifdef LIBRARY6int x = 42;7#pragma omp declare target(x)8 9int foo() {10 int value;11#pragma omp target map(from : value)12 value = x;13 return value;14}15#else16#include <stdio.h>17int foo(void);18 19int main() {20 int x = foo();21 22 // CHECK: PASS23 if (x == 42)24 printf("PASS\n");25}26#endif27