summaryrefslogtreecommitdiffstats
path: root/llvm/unittests/Support/RegexTest.cpp
diff options
context:
space:
mode:
authorDavid Blaikie <dblaikie@gmail.com>2014-01-02 19:04:59 +0000
committerDavid Blaikie <dblaikie@gmail.com>2014-01-02 19:04:59 +0000
commit7a2380486c20865d0529af988cdb4b9255009d73 (patch)
tree7c8dc91f6ea365cefc7c26929b82aa09c7ec0141 /llvm/unittests/Support/RegexTest.cpp
parentfd3279f27fd9076025c838211b06c5818913d6a3 (diff)
downloadbcm5719-llvm-7a2380486c20865d0529af988cdb4b9255009d73.tar.gz
bcm5719-llvm-7a2380486c20865d0529af988cdb4b9255009d73.zip
Make llvm::Regex non-copyable but movable.
Based on a patch by Maciej Piechotka. llvm-svn: 198334
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