1! RUN: %B/test/Semantics/test_errors.sh %s %flang %t
2!OPTIONS: -flogical-abbreviations -fxor-operator
3
4! Like m4 in resolve63 but compiled with different options.
5! Alternate operators are enabled so treat these as intrinsic.
6module m4
7contains
8  subroutine s1(x, y, z)
9    logical :: x
10    real :: y, z
11    !ERROR: Operands of .AND. must be LOGICAL; have REAL(4) and REAL(4)
12    x = y .a. z
13    !ERROR: Operands of .OR. must be LOGICAL; have REAL(4) and REAL(4)
14    x = y .o. z
15    !ERROR: Operand of .NOT. must be LOGICAL; have REAL(4)
16    x = .n. y
17    !ERROR: Operands of .NEQV. must be LOGICAL; have REAL(4) and REAL(4)
18    x = y .xor. z
19    !ERROR: Operands of .NEQV. must be LOGICAL; have REAL(4) and REAL(4)
20    x = y .x. y
21  end
22end
23
24! Like m4 in resolve63 but compiled with different options.
25! Alternate operators are enabled so treat .A. as .AND.
26module m5
27  interface operator(.A.)
28    logical function f1(x, y)
29      integer, intent(in) :: x, y
30    end
31  end interface
32  interface operator(.and.)
33    logical function f2(x, y)
34      real, intent(in) :: x, y
35    end
36  end interface
37contains
38  subroutine s1(x, y, z)
39    logical :: x
40    complex :: y, z
41    !ERROR: No intrinsic or user-defined OPERATOR(.A.) matches operand types COMPLEX(4) and COMPLEX(4)
42    x = y .and. z
43    !ERROR: No intrinsic or user-defined OPERATOR(.A.) matches operand types COMPLEX(4) and COMPLEX(4)
44    x = y .a. z
45  end
46end
47