brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.8 KiB · ad67caa Raw
43 lines · plain
1! RUN: %python %S/test_errors.py %s %flang_fc1 -pedantic2! Test 8.5.18 constraints on the VALUE attribute3 4module m5  type :: hasCoarray6    real, allocatable :: coarray[:]7  end type8 contains9  !ERROR: VALUE attribute may apply only to a dummy data object10  subroutine C863(notData,assumedSize,coarray,coarrayComponent,assumedRank,assumedLen)11    external :: notData12    !WARNING: Only a dummy argument should have an INTENT, VALUE, or OPTIONAL attribute [-Wignore-irrelevant-attributes]13    real, value :: notADummy14    value :: notData15    !ERROR: VALUE attribute may not apply to an assumed-size array16    real, value :: assumedSize(10,*)17    !ERROR: VALUE attribute may not apply to a coarray18    real, value :: coarray[*]19    !ERROR: VALUE attribute may not apply to a type with a coarray ultimate component20    type(hasCoarray), value :: coarrayComponent21    !ERROR: VALUE attribute may not apply to an assumed-rank array22    real, value :: assumedRank(..)23    !PORTABILITY: VALUE attribute on assumed-length CHARACTER may not be portable [-Wportability]24    character(*), value :: assumedLen25  end subroutine26  subroutine C864(allocatable, inout, out, pointer, volatile)27    !ERROR: VALUE attribute may not apply to an ALLOCATABLE28    real, value, allocatable :: allocatable29    !ERROR: VALUE attribute may not apply to an INTENT(IN OUT) argument30    real, value, intent(in out) :: inout31    !ERROR: VALUE attribute may not apply to an INTENT(OUT) argument32    real, value, intent(out) :: out33    !ERROR: VALUE attribute may not apply to a POINTER34    real, value, pointer :: pointer35    !ERROR: VALUE attribute may not apply to a VOLATILE36    real, value, volatile :: volatile37  end subroutine38  subroutine C865(optional) bind(c)39    !ERROR: VALUE attribute may not apply to an OPTIONAL in a BIND(C) procedure40    real, value, optional :: optional41  end subroutine42end module43