brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.3 KiB · f49766d Raw
46 lines · plain
1! RUN: %python %S/test_errors.py %s %flang -flogical-abbreviations -fxor-operator2 3! Like m4 in resolve63 but compiled with different options.4! Alternate operators are enabled so treat these as intrinsic.5module m46contains7  subroutine s1(x, y, z)8    logical :: x9    real :: y, z10    !ERROR: Operands of .AND. must be LOGICAL; have REAL(4) and REAL(4)11    x = y .a. z12    !ERROR: Operands of .OR. must be LOGICAL; have REAL(4) and REAL(4)13    x = y .o. z14    !ERROR: Operand of .NOT. must be LOGICAL; have REAL(4)15    x = .n. y16    !ERROR: Operands of .NEQV. must be LOGICAL; have REAL(4) and REAL(4)17    x = y .xor. z18    !ERROR: Operands of .NEQV. must be LOGICAL; have REAL(4) and REAL(4)19    x = y .x. y20  end21end22 23! Like m4 in resolve63 but compiled with different options.24! Alternate operators are enabled so treat .A. as .AND.25module m526  interface operator(.A.)27    logical function f1(x, y)28      integer, intent(in) :: x, y29    end30  end interface31  interface operator(.and.)32    logical function f2(x, y)33      real, intent(in) :: x, y34    end35  end interface36contains37  subroutine s1(x, y, z)38    logical :: x39    complex :: y, z40    !ERROR: Operands of .AND. must be LOGICAL; have COMPLEX(4) and COMPLEX(4)41    x = y .and. z42    !ERROR: Operands of .AND. must be LOGICAL; have COMPLEX(4) and COMPLEX(4)43    x = y .a. z44  end45end46