Skip various cmp-mem-const tests on lp64 hppa*-*-*
[official-gcc.git] / libgomp / testsuite / libgomp.c-c++-common / target-present-2.c
blob07ae90b5aaaf1402517370d5520c2e37c7113594
1 #include <stdio.h>
3 #define N 100
5 int main (void)
7 int a[N], b[N], c[N];
9 for (int i = 0; i < N; i++) {
10 a[i] = i * 2;
11 b[i] = i * 3 + 1;
14 #pragma omp target enter data map (alloc: a, c)
15 /* a and c have already been allocated, so this should be okay. */
16 #pragma omp target defaultmap (present)
17 for (int i = 0; i < N; i++)
18 c[i] = a[i];
20 fprintf (stderr, "CheCKpOInT\n");
21 /* { dg-output "CheCKpOInT(\n|\r\n|\r).*" } */
23 /* b has not been allocated, so this should result in an error. */
24 /* { dg-output "libgomp: present clause: not present on the device \\(addr: 0x\[0-9a-f\]+, size: \[0-9\]+ \\(0x\[0-9a-f\]+\\), dev: \[0-9\]+\\\)" { target offload_device_nonshared_as } } */
25 /* { dg-shouldfail "present error triggered" { offload_device_nonshared_as } } */
26 #pragma omp target defaultmap (present)
27 for (int i = 0; i < N; i++)
28 c[i] += b[i];
29 #pragma omp target exit data map (from: c)