Bump version to 19.1.0-rc3
[llvm-project.git] / offload / test / mapping / delete_inf_refcount.c
blobf6016c19b0ffb56e231f662735521b499e458b53
1 // RUN: %libomptarget-compile-run-and-check-generic
3 #include <omp.h>
4 #include <stdio.h>
6 #pragma omp declare target
7 int isHost;
8 #pragma omp end declare target
10 int main(void) {
11 isHost = -1;
13 #pragma omp target enter data map(to : isHost)
15 #pragma omp target
16 { isHost = omp_is_initial_device(); }
17 #pragma omp target update from(isHost)
19 if (isHost < 0) {
20 printf("Runtime error, isHost=%d\n", isHost);
23 #pragma omp target exit data map(delete : isHost)
25 // CHECK: Target region executed on the device
26 printf("Target region executed on the %s\n", isHost ? "host" : "device");
28 return isHost;