29 lines · c
1// RUN: %libomptarget-compile-generic2// RUN: %libomptarget-run-fail-generic 2>&1 \3// RUN: | %fcheck-generic4 5#include <stdio.h>6 7int main() {8 int i;9 10 // CHECK: addr=0x[[#%x,HOST_ADDR:]], size=[[#%u,SIZE:]]11 fprintf(stderr, "addr=%p, size=%ld\n", &i, sizeof i);12 13// CHECK-NOT: omptarget14#pragma omp target enter data map(alloc : i)15#pragma omp target exit data map(present, delete : i)16 17 // CHECK: i was present18 fprintf(stderr, "i was present\n");19 20// CHECK: omptarget message: device mapping required by 'present' map type modifier does not exist for host address 0x{{0*}}[[#HOST_ADDR]] ([[#SIZE]] bytes)21// CHECK: omptarget fatal error 1: failure of target construct while offloading is mandatory22#pragma omp target exit data map(present, delete : i)23 24 // CHECK-NOT: i was present25 fprintf(stderr, "i was present\n");26 27 return 0;28}29