Peter Klausler 9696355484
[flang] Better messages and error recovery for a bad RESHAPE (#122604)
Add tests for negative array extents where necessary, motivated by a
compiler crash exposed by yet another fuzzer test, and improve overall
error message quality for RESHAPE().

Fixes https://github.com/llvm/llvm-project/issues/122060.
2025-01-14 12:57:49 -08:00

7 lines
241 B
Fortran

! RUN: %python %S/test_errors.py %s %flang_fc1
integer, parameter :: a = -10
! ERROR: Assignment to constant 'a' is not allowed
! ERROR: 'shape=' argument ([INTEGER(4)::-10_4]) must not have a negative extent
a = b() - reshape([c], [a])
END