[flang] Fixes for RESHAPE()
authorPeter Steinfeld <psteinfeld@nvidia.com>
Wed, 29 Jul 2020 21:46:36 +0000 (14:46 -0700)
committerPeter Steinfeld <psteinfeld@nvidia.com>
Fri, 31 Jul 2020 02:05:06 +0000 (19:05 -0700)
commit2cf52504bb076d24c23f161e92340828052b69f7
tree72e0ad46e5e2727db657a1e3929c13cb6ac12aaf
parentb256cb88a716dfd270745af1bb98b49c22521a99
[flang] Fixes for RESHAPE()

I fixed an assert caused by passing an empty array as the source= argument to
RESHAPE().  In the process, I noticed that there were no tests for RESHAPE(),
so I wrote a test that covers all the description in 16.9.163.  In the process,
I made the error messages more consistent and descriptive.  I also changed the
test to see if a reference to an intrinsic function was a constant to say that
it is a constant if it's a refererence to an invalid intrinsic.  This avoids
emitting multiple messages for the same erroneous source.

Differential Revision: https://reviews.llvm.org/D84904
flang/include/flang/Evaluate/constant.h
flang/include/flang/Evaluate/intrinsics.h
flang/lib/Evaluate/check-expression.cpp
flang/lib/Evaluate/constant.cpp
flang/lib/Evaluate/fold-implementation.h
flang/lib/Evaluate/intrinsics.cpp
flang/test/Semantics/reshape.f90 [new file with mode: 0644]