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.
I think PackageConstant is very specific to the LBOUND/UBOUND folding usage. I am not sure it is worth exposing it in this widely included header.
Looking at GetConstantArrayLboundHelper, it is only ever used in folding, so maybe PackageConstant could be moved inside it, or next to it if that brings too many templates.