brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.6 KiB · ffee322 Raw
138 lines · plain
1! RUN: %python %S/test_errors.py %s %flang_fc12subroutine p13  integer(8) :: a, b, c, d4  pointer(a, b)5  !ERROR: 'b' cannot be a Cray pointer as it is already a Cray pointee6  pointer(b, c)7  !ERROR: 'a' cannot be a Cray pointee as it is already a Cray pointer8  pointer(d, a)9end10 11subroutine p212  pointer(a, c)13  !ERROR: 'c' was already declared as a Cray pointee14  pointer(b, c)15end16 17subroutine p318  real a19  !ERROR: Cray pointer 'a' must have type INTEGER(8)20  pointer(a, b)21end22 23subroutine p424  implicit none25  real b26  !ERROR: No explicit type declared for 'd'27  pointer(a, b), (c, d)28end29 30subroutine p531  integer(8) a(10)32  !ERROR: Cray pointer 'a' must be a scalar33  pointer(a, b)34end35 36subroutine p637  real b(8)38  !ERROR: The dimensions of 'b' have already been declared39  pointer(a, b(4))40end41 42subroutine p743  !ERROR: Cray pointee 'b' must have explicit shape or assumed size44  pointer(a, b(:))45contains46  subroutine s(x, y)47    real :: x(*)  ! assumed size48    !ERROR: Cray pointee 'y' must have explicit shape or assumed size49    real :: y(:)  ! assumed shape50    pointer(w, y)51  end52end53 54subroutine p855  integer(8), parameter :: k = 256  type t57  end type58  !ERROR: 't' is not a variable59  pointer(t, a)60  !ERROR: 's' is not a variable61  pointer(s, b)62  !ERROR: 'k' is a named constant and may not be a Cray pointer63  pointer(k, c)64contains65  subroutine s66  end67end68 69subroutine p970  integer(8), parameter :: k = 271  type t72  end type73  !ERROR: 't' is already declared in this scoping unit74  pointer(a, t)75  !ERROR: Declaration of 's' conflicts with its use as internal procedure76  pointer(b, s)77  !ERROR: 'k' is a named constant and may not be a Cray pointee78  pointer(c, k)79contains80  subroutine s81  end82end83 84module m1085  integer(8) :: a86  real :: b87end88subroutine p1089  use m1090  !ERROR: 'b' is use-associated from module 'm10' and cannot be re-declared91  pointer(a, c),(d, b)92end93 94subroutine p1195  pointer(a, b)96  !ERROR: PARAMETER attribute not allowed on 'a'97  parameter(a=2)98  !ERROR: PARAMETER attribute not allowed on 'b'99  parameter(b=3)100end101 102subroutine p12103  type t1104    sequence105    real c1106  end type107  type t2108    integer c2109  end type110  type, bind(c) :: t3111    integer c3112  end type113  type(t1) :: x1114  type(t2) :: x2115  type(t3) :: x3116  pointer(a, x1)117  !WARNING: Type of Cray pointee 'x2' is a derived type that is neither SEQUENCE nor BIND(C) [-Wnon-sequence-cray-pointee]118  pointer(b, x2)119  pointer(c, x3)120end121 122subroutine p13123  pointer(ip, x)124 contains125  subroutine s126    pointer(ip, x) ! ok, local declaration127  end128end129 130subroutine p14131  real :: r132  block133    asynchronous :: r134    !ERROR: PARAMETER attribute not allowed on 'r'135    parameter (r = 1.0)136  end block137end138