32 lines · c
1// RUN: %libomptarget-compile-generic2// RUN: %libomptarget-run-generic 2>&1 \3// RUN: | %fcheck-generic4 5// REQUIRES: unified_shared_memory6 7#include <stdio.h>8 9// The runtime considers unified shared memory to be always present.10#pragma omp requires unified_shared_memory11 12int main() {13 int i;14 15 // CHECK-NOT: omptarget16#pragma omp target data map(alloc : i)17#pragma omp target map(present, alloc : i)18 ;19 20 // CHECK: i is present21 fprintf(stderr, "i is present\n");22 23 // CHECK-NOT: omptarget24#pragma omp target map(present, alloc : i)25 ;26 27 // CHECK: is present28 fprintf(stderr, "i is present\n");29 30 return 0;31}32