lfortran
lfortran copied to clipboard
comparison operator not implemented
MRE
program minloc_mre
implicit none
integer, parameter :: grid(2, 2) = reshape([1, 2, 2, 1], [2, 2])
integer, parameter :: where_is_two(2) = minloc(grid, dim=1, mask=grid > 1, back=.true.)
print *, "minloc:", where_is_two
if (any(where_is_two /= [2, 1])) error stop
end program minloc_mre
output
(base) opixdown@Atharvs-MacBook-Air lfortran % lfortran t.f90
semantic error: Comparison operator not implemented
--> t.f90:7:11
|
7 | if (any(where_is_two /= [2, 1])) error stop
| ^^^^^^^^^^^^^^^^^^^^^^
gfortran behavior
(base) opixdown@Atharvs-MacBook-Air lfortran % gfortran t.f90 && ./a.out
minloc: 2 1
Hi @opixdown thanks for the bug. I am on this .