[flang] Updated call10.f90 with more test for flang-compiler/f18#794-Check for PURE procedures containing image control statements (flang-compiler/f18#857)

Original-commit: flang-compiler/f18@ae4868e572
Reviewed-on: https://github.com/flang-compiler/f18/pull/857
This commit is contained in:
Kiran Kumar T P 2019-12-11 22:41:59 +05:30 committed by Steve Scalpone
parent a66086749b
commit b96a26c1fc
1 changed files with 30 additions and 1 deletions

View File

@ -192,7 +192,36 @@ module m
pure subroutine s13
!ERROR: An image control statement may not appear in a PURE subprogram
sync all ! C1599
end subroutine
pure subroutine s14
integer :: img, nimgs, i[*], tmp
! implicit sync all
!ERROR: Procedure 'this_image' referenced in PURE subprogram 's14' must be PURE too
img = this_image()
!ERROR: Procedure 'num_images' referenced in PURE subprogram 's14' must be PURE too
nimgs = num_images()
i = img ! i is ready to use
if ( img .eq. 1 ) then
!ERROR: An image control statement may not appear in a PURE subprogram
sync images( nimgs ) ! explicit sync 1 with last img
tmp = i[ nimgs ]
!ERROR: An image control statement may not appear in a PURE subprogram
sync images( nimgs ) ! explicit sync 2 with last img
i = tmp
end if
if ( img .eq. nimgs ) then
!ERROR: An image control statement may not appear in a PURE subprogram
sync images( 1 ) ! explicit sync 1 with img 1
tmp = i[ 1 ]
!ERROR: An image control statement may not appear in a PURE subprogram
sync images( 1 ) ! explicit sync 2 with img 1
i = tmp
end if
!ERROR: External I/O is not allowed in a PURE subprogram
write (*,*) img, i
! all other images wait here
! TODO others from 11.6.1 (many)
end subroutine
end module