1! RUN: %S/test_errors.sh %s %t %flang_fc1
2! REQUIRES: shell
3module m1
4  !ERROR: Logical constant '.true.' may not be used as a defined operator
5  interface operator(.TRUE.)
6  end interface
7  !ERROR: Logical constant '.false.' may not be used as a defined operator
8  generic :: operator(.false.) => bar
9end
10
11module m2
12  interface operator(+)
13    module procedure foo
14  end interface
15  interface operator(.foo.)
16    module procedure foo
17  end interface
18  interface operator(.ge.)
19    module procedure bar
20  end interface
21contains
22  integer function foo(x, y)
23    logical, intent(in) :: x, y
24    foo = 0
25  end
26  logical function bar(x, y)
27    complex, intent(in) :: x, y
28    bar = .false.
29  end
30end
31
32!ERROR: Intrinsic operator '.le.' may not be used as a defined operator
33use m2, only: operator(.le.) => operator(.ge.)
34!ERROR: Intrinsic operator '.not.' may not be used as a defined operator
35use m2, only: operator(.not.) => operator(.foo.)
36!ERROR: Logical constant '.true.' may not be used as a defined operator
37use m2, only: operator(.true.) => operator(.foo.)
38end
39