[flang] Fix another bug checking simple contiguity
The test still wasn't correct for structure components. If the last
part-ref is a non-array or a single array element, but the whole
ArrayRef has non-zero rank, it is not contiguous. Otherwise, if there
are subscripts on the last part-ref they can be checked normally.
Add some tests for cases that were previously failing, and also for
cases with vector subscripts.
Original-commit: flang-compiler/f18@
aa0a0887325bd1fc6c3a1ad40fc6711d2e458a1c
Reviewed-on: https://github.com/flang-compiler/f18/pull/961