28 lines · plain
1! RUN: %python %S/test_errors.py %s %flang_fc1 -pedantic2subroutine s13 type :: d14 real :: x5 end type6 type :: d27 type(d1) :: x8 end type9 type(d1), target :: a(5)10 type(d2), target :: b(5)11 real, pointer, contiguous :: c(:)12 c => a%x ! okay, type has single component13 c => b%x%x ! okay, types have single components14end15 16subroutine s217 type :: d118 real :: x, y19 end type20 type(d1), target :: b(5)21 real, pointer, contiguous :: c(:)22 !ERROR: CONTIGUOUS pointer may not be associated with a discontiguous target23 c => b%x24 c => b(1:1)%x ! okay, one element25 !ERROR: CONTIGUOUS pointer may not be associated with a discontiguous target26 c => b(1:2)%x27end28