46 lines · plain
1! RUN: %python %S/test_errors.py %s %flang_fc12! Miscellaneous constraint and requirement checking on declarations:3! - 8.5.6.2 & 8.5.6.3 constraints on coarrays4! - 8.5.19 constraints on the VOLATILE attribute5 6module m7 !ERROR: 'mustbedeferred' is an ALLOCATABLE coarray and must have a deferred coshape8 real, allocatable :: mustBeDeferred[*] ! C8279 !ERROR: 'mustbeexplicit' is a non-ALLOCATABLE coarray and must have an explicit coshape10 real :: mustBeExplicit[:] ! C82811 type :: hasCoarray12 real, allocatable :: coarray[:]13 end type14 real :: coarray[*]15 type(hasCoarray) :: coarrayComponent16 contains17 !ERROR: VOLATILE attribute may not apply to an INTENT(IN) argument18 subroutine C866(x)19 intent(in) :: x20 volatile :: x21 !ERROR: VOLATILE attribute may apply only to a variable22 volatile :: notData23 external :: notData24 end subroutine25 subroutine C86726 !ERROR: VOLATILE attribute may not apply to a coarray accessed by USE or host association27 volatile :: coarray28 !ERROR: VOLATILE attribute may not apply to a type with a coarray ultimate component accessed by USE or host association29 volatile :: coarrayComponent30 end subroutine31 subroutine C868(coarray,coarrayComponent)32 real :: coarray[*]33 type(hasCoarray) :: coarrayComponent34 block35 !ERROR: VOLATILE attribute may not apply to a coarray accessed by USE or host association36 volatile :: coarray37 !ERROR: VOLATILE attribute may not apply to a type with a coarray ultimate component accessed by USE or host association38 volatile :: coarrayComponent39 end block40 end subroutine41 subroutine C839(x)42 !ERROR: Coarray 'x' may not be an assumed-rank array43 real, intent(in) :: x(..)[*]44 end45end module46