mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-17 03:36:37 +00:00

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.
7 lines
241 B
Fortran
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
|