brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.0 KiB · 3877584 Raw
26 lines · plain
1! RUN: %python %S/test_errors.py %s %flang_fc1 -pedantic2! Test the RelaxedIntentInChecking extension3module m4 contains5  subroutine intentInUnlimited(x)6    class(*), dimension(..), pointer, intent(in) :: x7  end8  subroutine intentInOutUnlimited(x)9    class(*), dimension(..), pointer, intent(in out) :: x10  end11  subroutine test12    integer, target :: scalar13    real, pointer :: arrayptr(:)14    class(*), pointer :: unlimited(:)15    call intentInUnlimited(scalar)16    !ERROR: Actual argument associated with POINTER dummy argument 'x=' must also be POINTER unless INTENT(IN)17    call intentInOutUnlimited(scalar)18    !PORTABILITY: If a POINTER or ALLOCATABLE dummy or actual argument is unlimited polymorphic, both should be so [-Wrelaxed-intent-in-checking]19    call intentInUnlimited(arrayptr)20    !ERROR: If a POINTER or ALLOCATABLE dummy or actual argument is unlimited polymorphic, both must be so21    call intentInOutUnlimited(arrayptr)22    call intentInUnlimited(unlimited) ! ok23    call intentInOutUnlimited(unlimited) ! ok24  end25end26