78 lines · plain
1! RUN: %python %S/test_errors.py %s %flang_fc12! 10.2.3.1(2) All masks and LHS of assignments in a WHERE must conform3 4subroutine s15 integer :: a1(10), a2(10)6 logical :: m1(10), m2(5,5)7 m1 = .true.8 m2 = .false.9 a1 = [((i),i=1,10)]10 where (m1)11 a2 = 112 !ERROR: Must have rank 1 to match prior mask or assignment of WHERE construct13 elsewhere (m2)14 a2 = 215 elsewhere16 a2 = 317 end where18end19 20subroutine s221 logical, allocatable :: m1(:), m4(:,:)22 logical :: m2(2), m3(3)23 where(m1)24 where(m2)25 end where26 !ERROR: Dimension 1 must have extent 2 to match prior mask or assignment of WHERE construct27 where(m3)28 end where29 !ERROR: Must have rank 1 to match prior mask or assignment of WHERE construct30 where(m4)31 end where32 endwhere33 where(m1)34 where(m3)35 end where36 !ERROR: Dimension 1 must have extent 3 to match prior mask or assignment of WHERE construct37 elsewhere(m2)38 end where39end40 41subroutine s342 logical, allocatable :: m1(:,:)43 logical :: m2(4,2)44 real :: x(4,4), y(4,4)45 real :: a(4,5), b(4,5)46 where(m1)47 x = y48 !ERROR: Dimension 2 must have extent 4 to match prior mask or assignment of WHERE construct49 a = b50 !ERROR: Dimension 2 must have extent 4 to match prior mask or assignment of WHERE construct51 where(m2)52 end where53 end where54end55 56subroutine s457 integer :: x1 = 0, x2(2) = 058 logical :: l1 = .false., l2(2) = (/.true., .false./), l3 = .false.59 !ERROR: The mask or variable must not be scalar60 where (l1)61 !ERROR: The mask or variable must not be scalar62 x1 = 163 end where64 !ERROR: The mask or variable must not be scalar65 where (l1)66 !ERROR: The mask or variable must not be scalar67 where (l3)68 !ERROR: The mask or variable must not be scalar69 x1 = 170 end where71 end where72 !ERROR: The mask or variable must not be scalar73 where (l2(2))74 !ERROR: The mask or variable must not be scalar75 x2(2) = 176 end where77end78