When folding a binary operation between two array constructors, it
is necessary to check if each value contained in the left operand
has the same rank and shape as the one on the right.
Otherwise, lowering would end up with an operation between values
of different ranks/shapes, which could result in a crash.
For instance, the following code was crashing the compiler:
integer :: x(4), y(2, 2), z(4) z = (/x/) + (/y/)
Fixes #60229
I added some tests here, in this subroutine. This one, specifically, checks if the operation is not rewritten when the ranks are equal but the extents differ.