diff options
author | Pavel Labath <labath@google.com> | 2018-06-28 11:45:28 +0000 |
---|---|---|
committer | Pavel Labath <labath@google.com> | 2018-06-28 11:45:28 +0000 |
commit | 33aa5c546ec9eb2246c3ba83289c4bd01c4466e0 (patch) | |
tree | f18f0b2492a1e700e94f03c70924cdce1a1e6950 /llvm/unittests/ADT/ArrayRefTest.cpp | |
parent | 057ce39ea0eeb593e1f7483d297f9026d3be71bd (diff) | |
download | bcm5719-llvm-33aa5c546ec9eb2246c3ba83289c4bd01c4466e0.tar.gz bcm5719-llvm-33aa5c546ec9eb2246c3ba83289c4bd01c4466e0.zip |
ADT: Move ArrayRef comparison operators into the class
Summary:
This allows the implicit ArrayRef conversions to kick in when e.g.
comparing ArrayRef to a SmallVector.
Reviewers: zturner, dblaikie
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D48632
llvm-svn: 335839
Diffstat (limited to 'llvm/unittests/ADT/ArrayRefTest.cpp')
-rw-r--r-- | llvm/unittests/ADT/ArrayRefTest.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/llvm/unittests/ADT/ArrayRefTest.cpp b/llvm/unittests/ADT/ArrayRefTest.cpp index e01d212f218..7f97c40d41c 100644 --- a/llvm/unittests/ADT/ArrayRefTest.cpp +++ b/llvm/unittests/ADT/ArrayRefTest.cpp @@ -188,6 +188,10 @@ TEST(ArrayRefTest, Equals) { EXPECT_TRUE(AR1b.equals({3, 4, 5, 6})); EXPECT_FALSE(AR1b.equals({2, 3, 4, 5, 6})); EXPECT_FALSE(AR1b.equals({3, 4, 5, 6, 7})); + + SmallVector<int, 8> V1{1, 2, 3, 4, 5, 6, 7, 8}; + EXPECT_EQ(AR1, V1); + EXPECT_EQ(V1, AR1); } TEST(ArrayRefTest, EmptyEquals) { |