3 ! Test of attachment counters and finalize.
8 integer, parameter :: n = 512
10 integer, allocatable :: a(:)
11 integer, allocatable :: b(:)
27 !$acc enter data copyin(var%a(5:n - 5), var%b(5:n - 5))
30 !$acc enter data attach(var%a)
38 !$acc end parallel loop
40 if (.not. acc_is_present(var%a(5:n - 5))) stop 11
41 if (.not. acc_is_present(var%b(5:n - 5))) stop 12
42 if (.not. acc_is_present(var)) stop 13
43 !$acc exit data copyout(var%a(5:n - 5), var%b(5:n - 5)) finalize
44 if (acc_get_device_type() .ne. acc_device_host) then
45 if (acc_is_present(var%a(5:n - 5))) stop 21
46 if (acc_is_present(var%b(5:n - 5))) stop 22
48 print *, "CheCKpOInT1"
49 ! { dg-output ".*CheCKpOInT1(\n|\r\n|\r)" }
50 if (.not. acc_is_present(var)) stop 23
51 !TODO { dg-output "STOP 23(\n|\r\n|\r)$" { target { ! openacc_host_selected } } } ! Scan for what we expect in the "XFAILed" case (without actually XFAILing).
52 !TODO { dg-shouldfail "XFAILed" { ! openacc_host_selected } } ! ... instead of 'dg-xfail-run-if' so that 'dg-output' is evaluated at all.
53 !TODO { dg-final { if { [dg-process-target { xfail { ! openacc_host_selected } }] == "F" } { xfail "[testname-for-summary] really is XFAILed" } } } ! ... so that we still get an XFAIL visible in the log.
54 print *, "CheCKpOInT2"
55 ! { dg-output ".CheCKpOInT2(\n|\r\n|\r)" { target { openacc_host_selected } } }
60 if (var%a(i) .ne. 0) stop 1
61 if (var%b(i) .ne. 0) stop 2
65 if (i .ne. var%a(i)) stop 3
66 if (i * 2 .ne. var%b(i)) stop 4
70 if (var%a(i) .ne. 0) stop 5
71 if (var%b(i) .ne. 0) stop 6