summaryrefslogtreecommitdiffstats
path: root/llvm/unittests/Support/RegexTest.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/unittests/Support/RegexTest.cpp')
-rw-r--r--llvm/unittests/Support/RegexTest.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/llvm/unittests/Support/RegexTest.cpp b/llvm/unittests/Support/RegexTest.cpp
index 30ea2c5b274..c3a8085accd 100644
--- a/llvm/unittests/Support/RegexTest.cpp
+++ b/llvm/unittests/Support/RegexTest.cpp
@@ -140,4 +140,19 @@ TEST_F(RegexTest, IsValid) {
EXPECT_EQ("invalid character range", Error);
}
+#if LLVM_HAS_RVALUE_REFERENCES
+TEST_F(RegexTest, MoveConstruct) {
+ Regex r1("^[0-9]+$");
+ Regex r2(std::move(r1));
+ EXPECT_TRUE(r2.match("916"));
+}
+
+TEST_F(RegexTest, MoveAssign) {
+ Regex r1("^[0-9]+$");
+ Regex r2("abc");
+ r2 = std::move(r1);
+ EXPECT_TRUE(r2.match("916"));
+}
+#endif
+
}
OpenPOWER on IntegriCloud