brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.7 KiB · 5566c0f Raw
95 lines · plain
1! RUN: %python %S/test_errors.py %s %flang_fc12module m13  type :: t14    sequence5    real :: x6  end type7  type :: t28    sequence9    real :: x10  end type11  type :: t312    real :: x13  end type14  type :: t415    real, private :: x16  end type17 contains18  subroutine s1a(x)19    type(t1), intent(in) :: x20  end21  subroutine s2a(x)22    type(t2), intent(in) :: x23  end24  subroutine s3a(x)25    type(t3), intent(in) :: x26  end27  subroutine s4a(x)28    type(t4), intent(in) :: x29  end30end31 32module m233  type t1034    integer n35   contains36    procedure :: f37    generic:: operator(+) => f38  end type39 contains40  elemental type(t10) function f(x,y)41    class(t10), intent(in) :: x, y42    f%n = x%n + y%n43  end44end45 46module m347  use m2, only: rt10 => t1048end49 50program test51  use m1, only: s1a, s2a, s3a, s4a52  use m2, only: t1053  use m3, only: rt10 ! alias for t10, ensure no distinguishability error54  type :: t155    sequence56    integer :: x ! distinct type57  end type58  type :: t259    sequence60    real :: x61  end type62  type :: t3 ! no SEQUENCE63    real :: x64  end type65  type :: t466    real :: x ! not PRIVATE67  end type68  interface distinguishable169    procedure :: s1a, s1b70  end interface71  interface distinguishable272    procedure :: s1a, s1b73  end interface74  interface distinguishable375    procedure :: s1a, s1b76  end interface77  !ERROR: Generic 'indistinguishable' may not have specific procedures 's2a' and 's2b' as their interfaces are not distinguishable78  interface indistinguishable79    procedure :: s2a, s2b80  end interface81 contains82  subroutine s1b(x)83    type(t1), intent(in) :: x84  end85  subroutine s2b(x)86    type(t2), intent(in) :: x87  end88  subroutine s3b(x)89    type(t3), intent(in) :: x90  end91  subroutine s4b(x)92    type(t4), intent(in) :: x93  end94end95