Bump version to 19.1.0-rc3
[llvm-project.git] / offload / test / offloading / extern.c
blob35cf905ee0cd41f1a2664b57d70594ac60c87dbc
1 // RUN: %libomptarget-compile-generic -DVAR -c -o %t.o
2 // RUN: %libomptarget-compile-generic %t.o && %libomptarget-run-generic | %fcheck-generic
4 #ifdef VAR
5 int x = 1;
6 #else
7 #include <stdio.h>
8 #include <assert.h>
9 extern int x;
11 int main() {
12 int value = 0;
13 #pragma omp target map(from : value)
14 value = x;
15 assert(value == 1);
17 x = 999;
18 #pragma omp target update to(x)
20 #pragma omp target map(from : value)
21 value = x;
22 assert(value == 999);
24 // CHECK: PASS
25 printf ("PASS\n");
27 #endif