summaryrefslogtreecommitdiffstats
path: root/llvm/unittests
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/unittests')
-rw-r--r--llvm/unittests/Support/RegexTest.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/llvm/unittests/Support/RegexTest.cpp b/llvm/unittests/Support/RegexTest.cpp
index c045c49bc3d..7b61a03dd9b 100644
--- a/llvm/unittests/Support/RegexTest.cpp
+++ b/llvm/unittests/Support/RegexTest.cpp
@@ -153,4 +153,13 @@ TEST_F(RegexTest, MoveAssign) {
EXPECT_TRUE(r2.match("916"));
}
+TEST_F(RegexTest, NoArgConstructor) {
+ std::string Error;
+ Regex r1;
+ EXPECT_FALSE(r1.isValid(Error));
+ EXPECT_EQ("invalid regular expression", Error);
+ r1 = Regex("abc");
+ EXPECT_TRUE(r1.isValid(Error));
+}
+
}
OpenPOWER on IntegriCloud