brintos

brintos / llvm-project-archived public Read only

0
0
Text · 3.7 KiB · 05fb7aa Raw
101 lines · plain
1! RUN: %python %S/test_errors.py %s %flang_fc1 -pedantic2! Allow the same external or intrinsic procedure to be use-associated3! by multiple paths when they are unambiguous.4module m15  intrinsic :: sin6  intrinsic :: iabs7  interface8    subroutine ext1(a, b)9      integer, intent(in) :: a(:)10      real, intent(in) :: b(:)11    end subroutine12    subroutine ext2(a, b)13      real, intent(in) :: a(:)14      integer, intent(in) :: b(:)15    end subroutine16  end interface17end module m118 19module m220  intrinsic :: sin, tan21  intrinsic :: iabs, idim22  interface23    subroutine ext1(a, b)24      integer, intent(in) :: a(:)25      real, intent(in) :: b(:)26    end subroutine27    subroutine ext2(a, b)28      real, intent(in) :: a(:)29      integer, intent(in) :: b(:)30    end subroutine31  end interface32end module m233 34subroutine s2a35  use m136  use m237  !PORTABILITY: Procedure pointer 'p1' should not have an ELEMENTAL intrinsic as its interface [-Wportability]38  procedure(sin), pointer :: p1 => sin39  !PORTABILITY: Procedure pointer 'p2' should not have an ELEMENTAL intrinsic as its interface [-Wportability]40  procedure(iabs), pointer :: p2 => iabs41  procedure(ext1), pointer :: p3 => ext142  procedure(ext2), pointer :: p4 => ext243end subroutine44 45subroutine s2b46  use m1, only: x1 => sin, x2 => iabs, x3 => ext1, x4 => ext247  use m2, only: x1 => sin, x2 => iabs, x3 => ext1, x4 => ext248  use m1, only: iface1 => sin, iface2 => iabs, iface3 => ext1, iface4 => ext249  !PORTABILITY: Procedure pointer 'p1' should not have an ELEMENTAL intrinsic as its interface [-Wportability]50  procedure(iface1), pointer :: p1 => x151  !PORTABILITY: Procedure pointer 'p2' should not have an ELEMENTAL intrinsic as its interface [-Wportability]52  procedure(iface2), pointer :: p2 => x253  procedure(iface3), pointer :: p3 => x354  procedure(iface4), pointer :: p4 => x455end subroutine56 57module m358  use m159  use m260end module61subroutine s362  use m363  !PORTABILITY: Procedure pointer 'p1' should not have an ELEMENTAL intrinsic as its interface [-Wportability]64  procedure(sin), pointer :: p1 => sin65  !PORTABILITY: Procedure pointer 'p2' should not have an ELEMENTAL intrinsic as its interface [-Wportability]66  procedure(iabs), pointer :: p2 => iabs67  procedure(ext1), pointer :: p3 => ext168  procedure(ext2), pointer :: p4 => ext269end subroutine70 71module m472  use m1, only: x1 => sin, x2 => iabs, x3 => ext1, x4 => ext273  use m2, only: x1 => sin, x2 => iabs, x3 => ext1, x4 => ext274end module75subroutine s476  use m477  use m1, only: iface1 => sin, iface2 => iabs, iface3 => ext1, iface4 => ext278  !PORTABILITY: Procedure pointer 'p1' should not have an ELEMENTAL intrinsic as its interface [-Wportability]79  procedure(iface1), pointer :: p1 => x180  !PORTABILITY: Procedure pointer 'p2' should not have an ELEMENTAL intrinsic as its interface [-Wportability]81  procedure(iface2), pointer :: p2 => x282  procedure(iface3), pointer :: p3 => x383  procedure(iface4), pointer :: p4 => x484end subroutine85 86subroutine s587  use m1, only: x1 => sin, x2 => iabs, x3 => ext1, x4 => ext288  use m2, only: x1 => tan, x2 => idim, x3 => ext2, x4 => ext189  use m1, only: iface1 => sin, iface2 => iabs, iface3 => ext1, iface4 => ext290  !PORTABILITY: Procedure pointer 'p1' should not have an ELEMENTAL intrinsic as its interface [-Wportability]91  !ERROR: Reference to 'x1' is ambiguous92  procedure(iface1), pointer :: p1 => x193  !PORTABILITY: Procedure pointer 'p2' should not have an ELEMENTAL intrinsic as its interface [-Wportability]94  !ERROR: Reference to 'x2' is ambiguous95  procedure(iface2), pointer :: p2 => x296  !ERROR: Reference to 'x3' is ambiguous97  procedure(iface3), pointer :: p3 => x398  !ERROR: Reference to 'x4' is ambiguous99  procedure(iface4), pointer :: p4 => x4100end subroutine101