[flang] Fix conformability for intrinsic procedures
authorPeter Steinfeld <psteinfeld@nvidia.com>
Fri, 25 Jun 2021 18:28:30 +0000 (11:28 -0700)
committerPeter Steinfeld <psteinfeld@nvidia.com>
Mon, 28 Jun 2021 18:09:24 +0000 (11:09 -0700)
commit57e53f013087d68305fe278aca0a92efc9b0e899
treece9cb6cbc386f044f1cadd78b156ebd1ce6d1e9a
parent4f5ebfdcd6c9d459e262d1815f49a45bad3cbcfc
[flang] Fix conformability for intrinsic procedures

There are situations where the arguments of intrinsics must be
conformable, which is defined in section 3.36.  This means they must
have "the same shape, or one being an array and the other being scalar".
But the check we were actually making was that their ranks were the same.

This change fixes that and adds a test for the UNPACK intrinsic, where
the FIELD argument "shall be conformable with MASK".

Differential Revision: https://reviews.llvm.org/D104936
flang/lib/Evaluate/intrinsics.cpp
flang/test/Semantics/unpack.f90 [new file with mode: 0644]