brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.4 KiB · 0c457f2 Raw
104 lines · plain
1! RUN: %python %S/test_errors.py %s %flang_fc12module m3  public i4  integer, private :: j5  !ERROR: The accessibility of 'i' has already been specified as PUBLIC6  private i7  !WARNING: The accessibility of 'j' has already been specified as PRIVATE [-Wredundant-attribute]8  private j9end10 11module m212  interface operator(.foo.)13    module procedure ifoo14  end interface15  public :: operator(.foo.)16  !ERROR: The accessibility of 'OPERATOR(.foo.)' has already been specified as PUBLIC17  private :: operator(.foo.)18  interface operator(+)19    module procedure ifoo20  end interface21  public :: operator(+)22  !ERROR: The accessibility of 'OPERATOR(+)' has already been specified as PUBLIC23  private :: operator(+) , ifoo24contains25  integer function ifoo(x, y)26    logical, intent(in) :: x, y27  end28end module29 30module m331  type t32  end type33  private :: operator(.lt.)34  interface operator(<)35    logical function lt(x, y)36      import t37      type(t), intent(in) :: x, y38    end function39  end interface40  !ERROR: The accessibility of 'OPERATOR(<)' has already been specified as PRIVATE41  public :: operator(<)42  interface operator(.gt.)43    logical function gt(x, y)44      import t45      type(t), intent(in) :: x, y46    end function47  end interface48  public :: operator(>)49  !ERROR: The accessibility of 'OPERATOR(.GT.)' has already been specified as PUBLIC50  private :: operator(.gt.)51end52 53module m454  private55  type, public :: foo56  end type57  interface foo58    procedure fun59  end interface60 contains61  function fun62  end63end64 65subroutine s466  !ERROR: 'fun' is PRIVATE in 'm4'67  use m4, only: foo, fun68  type(foo) x ! ok69  !PORTABILITY: Reference to generic function 'foo' (resolving to specific 'fun') is ambiguous with a structure constructor of the same name [-Wambiguous-structure-constructor]70  print *, foo()71end72 73module m574  public75  type, private :: foo76  end type77  interface foo78    procedure fun79  end interface80 contains81  function fun82  end83end84 85subroutine s586  !ERROR: 'foo' is PRIVATE in 'm5'87  use m5, only: foo, fun88  print *, fun() ! ok89end90 91module m692  !WARNING: 'foo' is PRIVATE in 'm5'93  use m5, only: name$with$dollar => foo94  !ERROR: 'foo' is PRIVATE in 'm5'95  use m5, only: normal_name => foo96end97 98subroutine s699  !The special dispensation for USE association of private names to local100  !aliases with '$' in them only applies to modules.101  !ERROR: 'foo' is PRIVATE in 'm5'102  use m5, only: name$with$dollar => foo103end104