summaryrefslogtreecommitdiff
path: root/unittests
diff options
context:
space:
mode:
Diffstat (limited to 'unittests')
-rw-r--r--unittests/Support/RegexTest.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/unittests/Support/RegexTest.cpp b/unittests/Support/RegexTest.cpp
index 30ea2c5b27..c3a8085acc 100644
--- a/unittests/Support/RegexTest.cpp
+++ b/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
+
}