brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.1 KiB · c6a9b03 Raw
92 lines · plain
1! RUN: %python %S/test_errors.py %s %flang_fc12module m13  type t14  end type5  type t36    integer t3c7  end type8  interface9    subroutine s1(x)10      !ERROR: 't1' from host is not accessible11      import :: t112      type(t1) :: x13      !BECAUSE: 't1' is hidden by this entity14      integer :: t115    end subroutine16    subroutine s2()17      !ERROR: 't2' not found in host scope18      import :: t219    end subroutine20    subroutine s3(x, y)21      !ERROR: Derived type 't1' not found22      type(t1) :: x, y23    end subroutine24    subroutine s4(x, y)25      !ERROR: 't3' from host is not accessible26      import, all27      type(t1) :: x28      type(t3) :: y29      !BECAUSE: 't3' is hidden by this entity30      integer :: t331    end subroutine32  end interface33contains34  subroutine s5()35  end36  subroutine s6()37    import, only: s538    implicit none(external)39    call s5()40  end41  subroutine s7()42    import, only: t143    implicit none(external)44    !ERROR: 's5' is an external procedure without the EXTERNAL attribute in a scope with IMPLICIT NONE(EXTERNAL)45    call s5()46  end47  subroutine s8()48    !This case is a dangerous ambiguity allowed by the standard.49    !ERROR: 't1' from host is not accessible50    type(t1), pointer :: p51    !BECAUSE: 't1' is hidden by this entity52    type t153      integer n(2)54    end type55  end56  subroutine s9()57    !This case is a dangerous ambiguity allowed by the standard.58    type t259      !ERROR: 't1' from host is not accessible60      type(t1), pointer :: p61    end type62    !BECAUSE: 't1' is hidden by this entity63    type t164      integer n(2)65    end type66    type(t2) x67  end68  subroutine s10()69    !Forward shadowing derived type in IMPLICIT70    !(supported by all other compilers)71    implicit type(t1) (c) ! forward shadow72    implicit type(t3) (d) ! host associated73    type t174      integer a75    end type76    c%a = 177    d%t3c = 278  end79end module80module m281  integer, parameter :: ck = kind('a')82end module83program main84  use m285  interface86    subroutine s0(x)87      import :: ck88      character(kind=ck) :: x ! no error89    end subroutine90  end interface91end program92