Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / openmp / libomptarget / test / mapping / present / target_update.c
blob75f4bc60dcc8a5b2f51e603cf98c9b23260d7654
1 // --------------------------------------------------
2 // Check 'to'
3 // --------------------------------------------------
5 // RUN: %libomptarget-compile-generic \
6 // RUN: -DCLAUSE=to
7 // RUN: %libomptarget-run-fail-generic 2>&1 \
8 // RUN: | %fcheck-generic
10 // --------------------------------------------------
11 // Check 'from'
12 // --------------------------------------------------
14 // RUN: %libomptarget-compile-generic \
15 // RUN: -DCLAUSE=from
16 // RUN: %libomptarget-run-fail-generic 2>&1 \
17 // RUN: | %fcheck-generic
19 #include <stdio.h>
21 int main() {
22 int i;
24 // CHECK: addr=0x[[#%x,HOST_ADDR:]], size=[[#%u,SIZE:]]
25 fprintf(stderr, "addr=%p, size=%ld\n", &i, sizeof i);
27 // CHECK-NOT: Libomptarget
28 #pragma omp target enter data map(alloc : i)
29 #pragma omp target update CLAUSE(present : i)
30 #pragma omp target exit data map(delete : i)
32 // CHECK: i is present
33 fprintf(stderr, "i is present\n");
35 // CHECK: Libomptarget message: device mapping required by 'present' motion modifier does not exist for host address 0x{{0*}}[[#HOST_ADDR]] ([[#SIZE]] bytes)
36 // CHECK: Libomptarget fatal error 1: failure of target construct while offloading is mandatory
37 #pragma omp target update CLAUSE(present : i)
39 // CHECK-NOT: i is present
40 fprintf(stderr, "i is present\n");
42 return 0;