1 ! RUN: %python %S/test_errors.py %s %flang_fc1
2 ! Test comparisons that use the intrinsic SHAPE() as an operand
5 subroutine sub1(arrayDummy
)
6 integer :: arrayDummy(:)
7 integer, allocatable
:: arrayDeferred(:)
8 integer :: arrayLocal(2) = [88, 99]
9 !ERROR: Dimension 1 of left operand has extent 1, but right operand has extent 0
10 !ERROR: Dimension 1 of left operand has extent 1, but right operand has extent 0
11 if (all(shape(arrayDummy
)==shape(8))) then
14 !ERROR: Dimension 1 of left operand has extent 0, but right operand has extent 1
15 !ERROR: Dimension 1 of left operand has extent 0, but right operand has extent 1
16 if (all(shape(27)==shape(arrayDummy
))) then
19 if (all(64==shape(arrayDummy
))) then
22 !ERROR: Dimension 1 of left operand has extent 1, but right operand has extent 0
23 !ERROR: Dimension 1 of left operand has extent 1, but right operand has extent 0
24 if (all(shape(arrayDeferred
)==shape(8))) then
27 !ERROR: Dimension 1 of left operand has extent 0, but right operand has extent 1
28 !ERROR: Dimension 1 of left operand has extent 0, but right operand has extent 1
29 if (all(shape(27)==shape(arrayDeferred
))) then
32 if (all(64==shape(arrayDeferred
))) then
35 !ERROR: Dimension 1 of left operand has extent 1, but right operand has extent 0
36 !ERROR: Dimension 1 of left operand has extent 1, but right operand has extent 0
37 if (all(shape(arrayLocal
)==shape(8))) then
40 !ERROR: Dimension 1 of left operand has extent 0, but right operand has extent 1
41 !ERROR: Dimension 1 of left operand has extent 0, but right operand has extent 1
42 if (all(shape(27)==shape(arrayLocal
))) then
45 if (all(64==shape(arrayLocal
))) then