aboutsummaryrefslogtreecommitdiff
path: root/libgomp/testsuite/libgomp.c-c++-common/target-present-3.c
diff options
context:
space:
mode:
Diffstat (limited to 'libgomp/testsuite/libgomp.c-c++-common/target-present-3.c')
-rw-r--r--libgomp/testsuite/libgomp.c-c++-common/target-present-3.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/libgomp/testsuite/libgomp.c-c++-common/target-present-3.c b/libgomp/testsuite/libgomp.c-c++-common/target-present-3.c
index 455519a..582247d 100644
--- a/libgomp/testsuite/libgomp.c-c++-common/target-present-3.c
+++ b/libgomp/testsuite/libgomp.c-c++-common/target-present-3.c
@@ -16,11 +16,24 @@ int main (void)
/* This should work as a has already been allocated. */
#pragma omp target update to (present: a)
+ #pragma omp target map(present,alloc: a, c)
+ for (int i = 0; i < N; i++) {
+ if (a[i] != i * 2)
+ __builtin_abort ();
+ c[i] = 23*i;
+ }
+
+ #pragma omp target update from(present : c)
+ for (int i = 0; i < N; i++) {
+ if (c[i] != 23*i)
+ __builtin_abort ();
+ }
+
fprintf (stderr, "CheCKpOInT\n");
/* { dg-output "CheCKpOInT(\n|\r\n|\r).*" } */
/* This should fail as b has not been allocated. */
- /* { dg-output "libgomp: present clause: not present on the device \\\(0x\[0-9a-f\]+, \[0-9\]+\\\)" { target offload_device_nonshared_as } } */
+ /* { 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 } } */
/* { dg-shouldfail "present error triggered" { offload_device_nonshared_as } } */
#pragma omp target update to (present: b)