diff options
author | Peter Klausler <35819229+klausler@users.noreply.github.com> | 2024-06-13 11:10:32 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-06-13 11:10:32 -0700 |
commit | f8fc883da951064a310e365680b4b567fad58ebc (patch) | |
tree | a1ff537ce273a2ab6a34f3b5361c05c778675546 /flang/unittests | |
parent | 4b493e31b2c5d72d993f0e914adb711f3ce4ba05 (diff) | |
download | llvm-f8fc883da951064a310e365680b4b567fad58ebc.zip llvm-f8fc883da951064a310e365680b4b567fad58ebc.tar.gz llvm-f8fc883da951064a310e365680b4b567fad58ebc.tar.bz2 |
[flang][runtime] Distinguish VALUE from non-VALUE operations in REDUCE (#95297)
Accommodate operations with VALUE dummy arguments in the runtime support
for the REDUCE intrinsic function by splitting most entry points into
Reduce...Ref and Reduce...Value variants.
Further work will be needed in lowering to call the ...Value entry
points.
Diffstat (limited to 'flang/unittests')
-rw-r--r-- | flang/unittests/Runtime/Reduction.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/flang/unittests/Runtime/Reduction.cpp b/flang/unittests/Runtime/Reduction.cpp index b2661e7..41c8d86 100644 --- a/flang/unittests/Runtime/Reduction.cpp +++ b/flang/unittests/Runtime/Reduction.cpp @@ -647,23 +647,24 @@ static std::int32_t IMultiply(const std::int32_t *x, const std::int32_t *y) { TEST(Reductions, ReduceInt4) { auto intVector{MakeArray<TypeCategory::Integer, 4>( std::vector<int>{4}, std::vector<std::int32_t>{1, 2, 3, 4})}; - EXPECT_EQ(RTNAME(ReduceInteger4)(*intVector, IAdd, __FILE__, __LINE__), 10); EXPECT_EQ( - RTNAME(ReduceInteger4)(*intVector, IMultiply, __FILE__, __LINE__), 24); + RTNAME(ReduceInteger4Ref)(*intVector, IAdd, __FILE__, __LINE__), 10); + EXPECT_EQ( + RTNAME(ReduceInteger4Ref)(*intVector, IMultiply, __FILE__, __LINE__), 24); } TEST(Reductions, ReduceInt4Dim) { auto intMatrix{MakeArray<TypeCategory::Integer, 4>( std::vector<int>{2, 2}, std::vector<std::int32_t>{1, 2, 3, 4})}; StaticDescriptor<1, true> statDesc; Descriptor &sums{statDesc.descriptor()}; - RTNAME(ReduceInteger4Dim)(sums, *intMatrix, IAdd, __FILE__, __LINE__, 1); + RTNAME(ReduceInteger4DimRef)(sums, *intMatrix, IAdd, __FILE__, __LINE__, 1); EXPECT_EQ(sums.rank(), 1); EXPECT_EQ(sums.GetDimension(0).LowerBound(), 1); EXPECT_EQ(sums.GetDimension(0).Extent(), 2); EXPECT_EQ(*sums.ZeroBasedIndexedElement<std::int32_t>(0), 3); EXPECT_EQ(*sums.ZeroBasedIndexedElement<std::int32_t>(1), 7); sums.Destroy(); - RTNAME(ReduceInteger4Dim)(sums, *intMatrix, IAdd, __FILE__, __LINE__, 2); + RTNAME(ReduceInteger4DimRef)(sums, *intMatrix, IAdd, __FILE__, __LINE__, 2); EXPECT_EQ(sums.rank(), 1); EXPECT_EQ(sums.GetDimension(0).LowerBound(), 1); EXPECT_EQ(sums.GetDimension(0).Extent(), 2); |