23 lines · plain
1! RUN: %python %S/test_errors.py %s %flang_fc1 -pedantic -Werror2module m3 contains4 subroutine foo(a)5 real, intent(in), target :: a(:)6 end subroutine7end module8 9program test10 use m11 real, target :: a(1)12 real :: b(1)13 call foo(a) ! ok14 !WARNING: Any pointer associated with TARGET dummy argument 'a=' during this call must not be used afterwards, as 'b' is not a target [-Wnon-target-passed-to-target]15 call foo(b)16 !WARNING: Any pointer associated with TARGET dummy argument 'a=' during this call will not be associated with the value of '(a)' afterwards [-Wnon-target-passed-to-target]17 call foo((a))18 !WARNING: Any pointer associated with TARGET dummy argument 'a=' during this call will not be associated with the value of 'a([INTEGER(8)::1_8])' afterwards [-Wnon-target-passed-to-target]19 call foo(a([1]))20 !ERROR: Scalar actual argument may not be associated with assumed-shape dummy argument 'a='21 call foo(a(1))22end23