-/* { dg-do run { target offload_device } } */
-/* { dg-shouldfail "present error triggered" } */
+#include <stdio.h>
#define N 100
for (int i = 0; i < N; i++)
c[i] = a[i];
+ fprintf (stderr, "CheCKpOInT\n");
+ /* { dg-output "CheCKpOInT(\n|\r\n|\r).*" } */
+
/* b has not been allocated, so this should result in an error. */
- /* { dg-output "libgomp: present clause: not present on the device \\\(0x\[0-9a-f\]+, \[0-9\]+\\\)" } */
+ /* { dg-output "libgomp: present clause: not present on the device \\\(0x\[0-9a-f\]+, \[0-9\]+\\\)" { target offload_device_nonshared_as } } */
+ /* { dg-shouldfail "present error triggered" { offload_device_nonshared_as } } */
#pragma omp target map (present, to: b)
for (int i = 0; i < N; i++)
c[i] += b[i];
-/* { dg-do run { target offload_device } } */
-/* { dg-shouldfail "present error triggered" } */
+#include <stdio.h>
#define N 100
}
#pragma omp target enter data map (alloc: a, c)
- /* a has already been allocated, so this should be okay. */
+ /* a and c have already been allocated, so this should be okay. */
#pragma omp target defaultmap (present)
for (int i = 0; i < N; i++)
c[i] = a[i];
+ fprintf (stderr, "CheCKpOInT\n");
+ /* { dg-output "CheCKpOInT(\n|\r\n|\r).*" } */
+
/* b has not been allocated, so this should result in an error. */
- /* { dg-output "libgomp: present clause: not present on the device \\\(0x\[0-9a-f\]+, \[0-9\]+\\\)" } */
+ /* { dg-output "libgomp: present clause: not present on the device \\\(0x\[0-9a-f\]+, \[0-9\]+\\\)" { target offload_device_nonshared_as } } */
+ /* { dg-shouldfail "present error triggered" { offload_device_nonshared_as } } */
#pragma omp target defaultmap (present)
for (int i = 0; i < N; i++)
c[i] += b[i];
-/* { dg-do run { target offload_device } } */
-/* { dg-shouldfail "present error triggered" } */
-
#include <stdio.h>
#define N 100
/* This should work as a has already been allocated. */
#pragma omp target update to (present: a)
+ 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\]+\\\)" } */
+ /* { dg-output "libgomp: present clause: not present on the device \\\(0x\[0-9a-f\]+, \[0-9\]+\\\)" { target offload_device_nonshared_as } } */
+ /* { dg-shouldfail "present error triggered" { offload_device_nonshared_as } } */
#pragma omp target update to (present: b)
#pragma omp target exit data map (from: c)
-! { dg-do run { target offload_device } }
-! { dg-shouldfail "present error triggered" }
-
program main
implicit none
integer, parameter :: N = 100
end do
!$omp end target
+ print *, "CheCKpOInT"
+ ! { dg-output "CheCKpOInT(\n|\r\n|\r).*" }
+
! b has not been allocated, so this should result in an error.
- ! { dg-output "libgomp: present clause: not present on the device \\\(0x\[0-9a-f\]+, \[0-9\]+\\\)" }
+ ! { dg-output "libgomp: present clause: not present on the device \\\(0x\[0-9a-f\]+, \[0-9\]+\\\)" { target offload_device_nonshared_as } }
+ ! { dg-shouldfail "present error triggered" { offload_device_nonshared_as } }
!$omp target map (present, to: b)
do i = 1, N
c(i) = c(i) + b(i)
-! { dg-do run { target offload_device } }
-! { dg-shouldfail "present error triggered" }
-
program main
implicit none
integer, parameter :: N = 100
b(i) = i * 3 + 1
end do
- !$omp target enter data map (alloc: a)
- ! a has already been allocated, so this should be okay.
+ !$omp target enter data map (alloc: a, c, i)
+ ! a, c, and i have already been allocated, so this should be okay.
!$omp target defaultmap (present)
do i = 1, N
c(i) = a(i)
end do
!$omp end target
+ print *, "CheCKpOInT"
+ ! { dg-output "CheCKpOInT(\n|\r\n|\r).*" }
+
! b has not been allocated, so this should result in an error.
- ! { dg-output "libgomp: present clause: not present on the device \\\(0x\[0-9a-f\]+, \[0-9\]+\\\)" }
+ ! { dg-output "libgomp: present clause: not present on the device \\\(0x\[0-9a-f\]+, \[0-9\]+\\\)" { target offload_device_nonshared_as } }
+ ! { dg-shouldfail "present error triggered" { offload_device_nonshared_as } }
!$omp target defaultmap (present)
do i = 1, N
c(i) = c(i) + b(i)
-! { dg-do run { target offload_device } }
-! { dg-shouldfail "present error triggered" }
-
program main
implicit none
integer, parameter :: N = 100
! This should work as a has already been allocated.
!$omp target update to (present: a)
+ print *, "CheCKpOInT"
+ ! { 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\]+\\\)" }
+ ! { dg-output "libgomp: present clause: not present on the device \\\(0x\[0-9a-f\]+, \[0-9\]+\\\)" { target offload_device_nonshared_as } }
+ ! { dg-shouldfail "present error triggered" { offload_device_nonshared_as } }
!$omp target update to (present: b)
!$omp target exit data map (from: c)
end program