Bump version to 19.1.0-rc3
[llvm-project.git] / offload / test / offloading / static_linking.c
blob7be95a10ffcd6ee95d7d6239ae0a566aba8568a7
1 // RUN: %libomptarget-compile-generic -DLIBRARY -c -o %t.o
2 // RUN: ar rcs %t.a %t.o
3 // RUN: %libomptarget-compile-generic %t.a && %libomptarget-run-generic 2>&1 | %fcheck-generic
5 #ifdef LIBRARY
6 int x = 42;
7 #pragma omp declare target(x)
9 int foo() {
10 int value;
11 #pragma omp target map(from : value)
12 value = x;
13 return value;
15 #else
16 #include <stdio.h>
17 int foo();
19 int main() {
20 int x = foo();
22 // CHECK: PASS
23 if (x == 42)
24 printf("PASS\n");
26 #endif