[flang] Fix LBOUND() folding for constant arrays
Previously constant folding uses 'dim' without checks which leads to ICE if we do not have DIM= parameter. And for inputs without DIM= we need to form an array of rank size with computed bounds instead of single value. Add additional PackageConstant function to simplify 'if (dim)' handling since we need to distinguish between scalar initialization in case of DIM= argument and rank=1 array. Also add a few more tests with 'parameter' type to verify folding for constant arrays. Reviewed By: jeanPerier Differential Revision: https://reviews.llvm.org/D123237
Loading
Please sign in to comment