summaryrefslogtreecommitdiff
path: root/lldb/test/API/python_api/process/TestProcessAPI.py
diff options
context:
space:
mode:
authorPeter Steinfeld <psteinfeld@nvidia.com>2021-01-26 08:20:57 -0800
committerPeter Steinfeld <psteinfeld@nvidia.com>2021-01-29 08:05:10 -0800
commit543cd89d3fb5a108d4050635c00093695b2b6c6d (patch)
tree17a4f0bc1d93a3d509c121a0bc3e7fc48713dec8 /lldb/test/API/python_api/process/TestProcessAPI.py
parent5046c5be8459a9631eeb149337776dcbde0e2a0b (diff)
[flang] Fix problems with constant arrays with lower bounds that are not 1
There were two problems with constant arrays whose lower bound is not 1. First, when folding the arrays, we were creating the folded array to have lower bounds of 1 but, we were not re-adjusting their lower bounds to the declared values. Second, we were not calculating the extents correctly. Both of these problems led to bogus error messages. I fixed the first problem by adjusting the lower bounds in NonPointerInitializationExpr() in Evaluate/check-expression.cpp. I wrote the class ArrayConstantBoundChanger, which is similar to the existing class ScalarConstantExpander. In the process of implementing and testing it, I found a bug that I fixed in ScalarConstantExpander which caused it to infinitely recurse on parenthesized expressions. I also removed the unrelated class ScalarExpansionVisitor, which was not used. I fixed the second problem by changing the formula that calculates upper bounds in in the function ComputeUpperBound() in Evaluate/shape.cpp. I added tests that trigger the bogus error messages mentioned above along with a constant folding tests that uses array operands with shapes that conform but have different bounds. In the process of adding tests, I discovered that tests in Evaluate/folding09.f90 and folding16.f90 were written incorrectly, and I fixed them. This also revealed a bug in contant folding of the intrinsic "lbounds" which I plan to fix in a later change. Differential Revision: https://reviews.llvm.org/D95449
Diffstat (limited to 'lldb/test/API/python_api/process/TestProcessAPI.py')
0 files changed, 0 insertions, 0 deletions