Files
llvm-project/flang/test/Semantics/bug163255.f90
Peter Klausler a6181dc84b [flang] Refine checks for NULL() in expressions (#163655)
Fix a false positive "NULL can't be an operand here" error message
arising in a defined generic interface for an intrinsic operator (==)
with multiple spellings.

Fixes https://github.com/llvm/llvm-project/issues/163255.
2025-10-16 12:20:53 -07:00

22 lines
435 B
Fortran

!RUN: %flang_fc1 -fdebug-unparse %s | FileCheck %s
module m
type t
end type
interface operator (==)
module procedure equal
end interface
contains
logical function equal(b1, b2)
class(t), pointer, intent(in) :: b1, b2
equal = associated(b1, b2)
end
end module
program test
use m
type(t), target :: target
class(t), pointer :: p => target
!CHECK: IF (equal(p,null(p))) STOP
if (p == null(p)) stop
end