brintos

brintos / llvm-project-archived public Read only

0
0
Text · 952 B · c129f11 Raw
38 lines · plain
1! RUN: %python %S/test_errors.py %s %flang_fc1 -pedantic2! Structure constructors with bad pointer targets3module m4  real, target, save :: x5  type t6    real, pointer :: rp => x7    procedure(f), pointer, nopass :: pp => f8  end type9 contains10  real function f()11    f = 0.12  end13  subroutine test(da, dp)14    real, target :: y, da15    procedure(f) dp16    procedure(f), pointer :: lpp17    external ext18    type(t) :: a1 = t() ! ok19    type(t) :: a2 = t(rp=x) ! ok20    type(t) :: a3 = t(pp=f) ! ok21    type(t) :: a4 = t(pp=ext) ! ok22    !ERROR: Must be a constant value23    type(t) :: a5 = t(rp=y)24    !ERROR: Must be a constant value25    type(t) :: a6 = t(rp=da)26    !ERROR: Must be a constant value27    type(t) :: a7 = t(pp=lpp)28    !ERROR: Must be a constant value29    type(t) :: a8 = t(pp=internal)30    !ERROR: Must be a constant value31    type(t) :: a9 = t(pp=dp)32   contains33    real function internal()34      internal = 666.35    end36  end37end38