34 lines · plain
1!RUN: %python %S/test_errors.py %s %flang_fc12program main3 type base4 integer :: x = 15 end type6 type, extends(base) :: child7 integer :: y = 28 end type9 class(child), allocatable :: c1(:), c2(:,:)10 class(base), allocatable :: b1(:), b2(:,:)11 logical var(1)12 common /blk/ var13 allocate(c1(2), c2(2,2), b1(2), b2(2,2))14 !ERROR: Actual argument for 'pad=' has bad type or kind 'CLASS(base)'15 c2 = reshape(c1, shape(c2), pad=b1)16 b2 = reshape(b1, shape(b2), pad=c1) ! ok17 !ERROR: Actual argument for 'to=' has bad type or kind 'CLASS(child)'18 call move_alloc(b1, c1)19 call move_alloc(c1, b1) ! ok20 !ERROR: Actual argument for 'boundary=' has bad type or kind 'CLASS(base)'21 c1 = eoshift(c1, 1, b1(1))22 c1 = eoshift(c1, 1, c2(1,1)) ! ok23 b1 = eoshift(b1, 1, c1(1)) ! ok24 !ERROR: Actual argument for 'fsource=' has bad type or kind 'CLASS(child)'25 b1 = merge(b1, c1, var(1))26 !ERROR: Actual argument for 'fsource=' has bad type or kind 'CLASS(base)'27 b1 = merge(c1, b1, var(1))28 b1 = merge(b1, b1, var(1)) ! ok29 !ERROR: Actual argument for 'vector=' has bad type or kind 'CLASS(base)'30 c1 = pack(c1, var, b1)31 c1 = pack(c1, var, c1) ! ok32 b1 = pack(b1, var, c1) ! ok33end34