[flang-commits] [flang] d0f1ae6 - Add a scalar argument case for the Fortran spread intrinsic unit test.
Mark Leair via flang-commits
flang-commits at lists.llvm.org
Fri Jul 16 12:22:03 PDT 2021
Author: Mark Leair
Date: 2021-07-16T12:19:08-07:00
New Revision: d0f1ae6eb6eab82d2f67c61260087353a46d48ec
URL: https://github.com/llvm/llvm-project/commit/d0f1ae6eb6eab82d2f67c61260087353a46d48ec
DIFF: https://github.com/llvm/llvm-project/commit/d0f1ae6eb6eab82d2f67c61260087353a46d48ec.diff
LOG: Add a scalar argument case for the Fortran spread intrinsic unit test.
Added:
Modified:
flang/unittests/RuntimeGTest/Transformational.cpp
Removed:
################################################################################
diff --git a/flang/unittests/RuntimeGTest/Transformational.cpp b/flang/unittests/RuntimeGTest/Transformational.cpp
index 00495fc04a94d..90c1fa36d9941 100644
--- a/flang/unittests/RuntimeGTest/Transformational.cpp
+++ b/flang/unittests/RuntimeGTest/Transformational.cpp
@@ -150,6 +150,18 @@ TEST(Transformational, Spread) {
EXPECT_EQ(*result.ZeroBasedIndexedElement<std::int32_t>(j), 1 + j % 3);
}
result.Destroy();
+
+ auto scalar{MakeArray<TypeCategory::Integer, 4>(
+ std::vector<int>{}, std::vector<std::int32_t>{1})};
+ RTNAME(Spread)(result, *scalar, 1, 2, __FILE__, __LINE__);
+ EXPECT_EQ(result.type(), array->type());
+ EXPECT_EQ(result.rank(), 1);
+ EXPECT_EQ(result.GetDimension(0).LowerBound(), 1);
+ EXPECT_EQ(result.GetDimension(0).Extent(), 2);
+ for (int j{0}; j < 2; ++j) {
+ EXPECT_EQ(*result.ZeroBasedIndexedElement<std::int32_t>(j), 1);
+ }
+ result.Destroy();
}
TEST(Transformational, Transpose) {
More information about the flang-commits
mailing list