brintos

brintos / llvm-project-archived public Read only

0
0
Text · 497 B · 35cf905 Raw
28 lines · c
1// RUN: %libomptarget-compile-generic -DVAR -c -o %t.o2// RUN: %libomptarget-compile-generic %t.o && %libomptarget-run-generic | %fcheck-generic3 4#ifdef VAR5int x = 1;6#else7#include <stdio.h>8#include <assert.h>9extern int x;10 11int main() {12  int value = 0;13#pragma omp target map(from : value)14  value = x;15  assert(value == 1);16 17  x = 999;18#pragma omp target update to(x)19 20#pragma omp target map(from : value)21  value = x;22  assert(value == 999);23 24  // CHECK: PASS25  printf ("PASS\n");26}27#endif28