| 1 |
! { dg-do run } |
| 2 |
! { dg-options "-fcheck=all" } |
| 3 |
! { dg-shouldfail "Invalid image number -1 in SYNC IMAGES" } |
| 4 |
! |
| 5 |
! As sync_1, but with bounds checking enabled. |
| 6 |
! PR fortran/52161 |
| 7 |
! |
| 8 |
! Coarray support |
| 9 |
! PR fortran/18918 |
| 10 |
|
| 11 |
implicit none |
| 12 |
integer :: n |
| 13 |
character(len=30) :: str |
| 14 |
critical |
| 15 |
end critical |
| 16 |
myCr: critical |
| 17 |
end critical myCr |
| 18 |
|
| 19 |
! |
| 20 |
! Test SYNC ALL |
| 21 |
! |
| 22 |
sync all |
| 23 |
sync all ( ) |
| 24 |
sync all (errmsg=str) |
| 25 |
|
| 26 |
n = 5 |
| 27 |
sync all (stat=n) |
| 28 |
if (n /= 0) STOP 1 |
| 29 |
|
| 30 |
n = 5 |
| 31 |
sync all (stat=n,errmsg=str) |
| 32 |
if (n /= 0) STOP 2 |
| 33 |
|
| 34 |
|
| 35 |
! |
| 36 |
! Test SYNC MEMORY |
| 37 |
! |
| 38 |
sync memory |
| 39 |
sync memory ( ) |
| 40 |
sync memory (errmsg=str) |
| 41 |
|
| 42 |
n = 5 |
| 43 |
sync memory (stat=n) |
| 44 |
if (n /= 0) STOP 3 |
| 45 |
|
| 46 |
n = 5 |
| 47 |
sync memory (errmsg=str,stat=n) |
| 48 |
if (n /= 0) STOP 4 |
| 49 |
|
| 50 |
|
| 51 |
! |
| 52 |
! Test SYNC IMAGES |
| 53 |
! |
| 54 |
sync images (*) |
| 55 |
if (this_image() == 1) then |
| 56 |
sync images (1) |
| 57 |
sync images (1, errmsg=str) |
| 58 |
sync images ([1]) |
| 59 |
end if |
| 60 |
|
| 61 |
n = 5 |
| 62 |
sync images (*, stat=n) |
| 63 |
if (n /= 0) STOP 5 |
| 64 |
|
| 65 |
n = 5 |
| 66 |
sync images (*,errmsg=str,stat=n) |
| 67 |
if (n /= 0) STOP 6 |
| 68 |
|
| 69 |
n = -1 |
| 70 |
sync images ( num_images() ) |
| 71 |
sync images (n) ! Invalid: "-1" |
| 72 |
|
| 73 |
end |
| 74 |
|
| 75 |
! { dg-output "Fortran runtime error: Invalid image number -1 in SYNC IMAGES" } |