brintos

brintos / llvm-project-archived public Read only

0
0
Text · 3.0 KiB · f1a1a30 Raw
101 lines · plain
1! RUN: %python %S/test_errors.py %s %flang_fc1 -pedantic2module m3  abstract interface4    subroutine foo5    end subroutine6    subroutine foo27    end subroutine8  end interface9 10  procedure() :: a11  procedure(integer) :: b12  procedure(foo) :: c13  procedure(bar) :: d14  !ERROR: 'missing' must be an abstract interface or a procedure with an explicit interface15  procedure(missing) :: e16  !ERROR: 'b' must be an abstract interface or a procedure with an explicit interface17  procedure(b) :: f18  procedure(c) :: g19  external :: h20  !ERROR: 'h' must be an abstract interface or a procedure with an explicit interface21  procedure(h) :: i22  procedure(forward) :: j23  !ERROR: 'bad1' must be an abstract interface or a procedure with an explicit interface24  !ERROR: Procedure 'k1' may not be an array without an explicit interface25  procedure(bad1) :: k126  !ERROR: 'bad2' must be an abstract interface or a procedure with an explicit interface27  procedure(bad2) :: k228  !ERROR: 'bad3' must be an abstract interface or a procedure with an explicit interface29  procedure(bad3) :: k330 31  abstract interface32    subroutine forward33    end subroutine34  end interface35 36  real :: bad1(1)37  real :: bad238  type :: bad339  end type40 41  !PORTABILITY: Name 'm' declared in a module should not have the same name as the module [-Wbenign-name-clash]42  type :: m43  end type m44 45  !ERROR: EXTERNAL attribute was already specified on 'a'46  !ERROR: EXTERNAL attribute was already specified on 'b'47  !ERROR: EXTERNAL attribute was already specified on 'c'48  !ERROR: EXTERNAL attribute was already specified on 'd'49  external :: a, b, c, d50  !ERROR: EXTERNAL attribute not allowed on 'm'51  external :: m52  !WARNING: EXTERNAL attribute was already specified on 'foo' [-Wredundant-attribute]53  external :: foo54  !ERROR: EXTERNAL attribute not allowed on 'bar'55  external :: bar56 57  !ERROR: An entity may not have the ASYNCHRONOUS attribute unless it is a variable58  asynchronous :: async59  external :: async60 61  !ERROR: PARAMETER attribute not allowed on 'm'62  parameter(m=2)63  !ERROR: PARAMETER attribute not allowed on 'foo'64  parameter(foo=2)65  !ERROR: PARAMETER attribute not allowed on 'bar'66  parameter(bar=2)67 68  type, abstract :: t169    integer :: i70  contains71    !ERROR: 'proc' must be an abstract interface or a procedure with an explicit interface72    !ERROR: Procedure component 'p1' must have NOPASS attribute or explicit interface73    procedure(proc), deferred :: p174  end type t175 76  abstract interface77    function f()78    end function79  end interface80 81contains82  subroutine bar83  end subroutine84  !ERROR: An entity may not have the ASYNCHRONOUS attribute unless it is a variable85  subroutine test86    asynchronous test87    !ERROR: Abstract procedure interface 'foo2' may not be referenced88    call foo2()89    !ERROR: Abstract procedure interface 'f' may not be referenced90    x = f()91  end subroutine92  subroutine baz(foo)93    external foo94    interface95      !WARNING: Dummy argument 'foo' was declared earlier as EXTERNAL [-Wredundant-attribute]96      subroutine foo(x)97      end98    end interface99  end100end module101