25 lines · plain
1! RUN: %python %S/test_errors.py %s %flang_fc1 -pedantic2subroutine foo(A, B, P)3 interface4 real elemental function foo_elemental(x)5 real, intent(in) :: x6 end function7 pure real function foo_pure(x)8 real, intent(in) :: x9 end function10 real function foo_nonelemental(x)11 real, intent(in) :: x12 end function13 end interface14 real :: A(:), B(:)15 !PORTABILITY: A dummy procedure should not have an ELEMENTAL intrinsic as its interface [-Wportability]16 procedure(sqrt), pointer :: P17 !ERROR: Rank of dummy argument is 0, but actual argument has rank 118 A = P(B)19 !ERROR: Procedure pointer 'p' associated with incompatible procedure designator 'foo_elemental': incompatible procedure attributes: Elemental20 P => foo_elemental21 P => foo_pure ! ok22 !ERROR: PURE procedure pointer 'p' may not be associated with non-PURE procedure designator 'foo_nonelemental'23 P => foo_nonelemental24end subroutine25