[PATCH] D106294: [flang] Implement the runtime portion of the UNPACK intrinsic
Pete Steinfeld via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Jul 20 09:50:27 PDT 2021
PeteSteinfeld updated this revision to Diff 360181.
PeteSteinfeld added a comment.
Responding to review comments.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D106294/new/
https://reviews.llvm.org/D106294
Files:
flang/unittests/RuntimeGTest/Transformational.cpp
Index: flang/unittests/RuntimeGTest/Transformational.cpp
===================================================================
--- flang/unittests/RuntimeGTest/Transformational.cpp
+++ flang/unittests/RuntimeGTest/Transformational.cpp
@@ -212,4 +212,20 @@
EXPECT_EQ(*result.ZeroBasedIndexedElement<std::int32_t>(j), expect[j]);
}
result.Destroy();
+
+ // Test for scalar value of the "field" argument
+ auto scalarField{MakeArray<TypeCategory::Integer, 4>(
+ std::vector<int>{}, std::vector<std::int32_t>{343})};
+ RTNAME(Unpack)(result, *vector, *mask, *scalarField, __FILE__, __LINE__);
+ EXPECT_EQ(result.rank(), 2);
+ EXPECT_EQ(result.GetDimension(0).LowerBound(), 1);
+ EXPECT_EQ(result.GetDimension(0).Extent(), 2);
+ EXPECT_EQ(result.GetDimension(1).LowerBound(), 1);
+ EXPECT_EQ(result.GetDimension(1).Extent(), 3);
+ static std::int32_t scalarExpect[6]{343, 1, 2, 343, 343, 3};
+ for (int j{0}; j < 6; ++j) {
+ EXPECT_EQ(
+ *result.ZeroBasedIndexedElement<std::int32_t>(j), scalarExpect[j]);
+ }
+ result.Destroy();
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D106294.360181.patch
Type: text/x-patch
Size: 1064 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210720/8f39d64b/attachment.bin>
More information about the llvm-commits
mailing list