Break circular dependency between FIR dialect and utilities
[llvm-project.git] / flang / test / Semantics / resolve64.f90
blobf49766d25dab1bf4617e05af26a0220bfcde175e
1 ! RUN: %python %S/test_errors.py %s %flang -flogical-abbreviations -fxor-operator
3 ! Like m4 in resolve63 but compiled with different options.
4 ! Alternate operators are enabled so treat these as intrinsic.
5 module m4
6 contains
7 subroutine s1(x, y, z)
8 logical :: x
9 real :: y, z
10 !ERROR: Operands of .AND. must be LOGICAL; have REAL(4) and REAL(4)
11 x = y .a. z
12 !ERROR: Operands of .OR. must be LOGICAL; have REAL(4) and REAL(4)
13 x = y .o. z
14 !ERROR: Operand of .NOT. must be LOGICAL; have REAL(4)
15 x = .n. y
16 !ERROR: Operands of .NEQV. must be LOGICAL; have REAL(4) and REAL(4)
17 x = y .xor. z
18 !ERROR: Operands of .NEQV. must be LOGICAL; have REAL(4) and REAL(4)
19 x = y .x. y
20 end
21 end
23 ! Like m4 in resolve63 but compiled with different options.
24 ! Alternate operators are enabled so treat .A. as .AND.
25 module m5
26 interface operator(.A.)
27 logical function f1(x, y)
28 integer, intent(in) :: x, y
29 end
30 end interface
31 interface operator(.and.)
32 logical function f2(x, y)
33 real, intent(in) :: x, y
34 end
35 end interface
36 contains
37 subroutine s1(x, y, z)
38 logical :: x
39 complex :: y, z
40 !ERROR: Operands of .AND. must be LOGICAL; have COMPLEX(4) and COMPLEX(4)
41 x = y .and. z
42 !ERROR: Operands of .AND. must be LOGICAL; have COMPLEX(4) and COMPLEX(4)
43 x = y .a. z
44 end
45 end