aboutsummaryrefslogtreecommitdiff
path: root/clang/unittests/Interpreter/InterpreterTest.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/unittests/Interpreter/InterpreterTest.cpp')
-rw-r--r--clang/unittests/Interpreter/InterpreterTest.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/clang/unittests/Interpreter/InterpreterTest.cpp b/clang/unittests/Interpreter/InterpreterTest.cpp
index 30b051e..578f1d4 100644
--- a/clang/unittests/Interpreter/InterpreterTest.cpp
+++ b/clang/unittests/Interpreter/InterpreterTest.cpp
@@ -107,6 +107,13 @@ TEST_F(InterpreterTest, Errors) {
auto RecoverErr = Interp->Parse("int var1 = 42;");
EXPECT_TRUE(!!RecoverErr);
+
+ Err = Interp->Parse("try { throw 1; } catch { 0; }").takeError();
+ EXPECT_THAT(DiagnosticOutput, HasSubstr("error: expected '('"));
+ EXPECT_EQ("Parsing failed.", llvm::toString(std::move(Err)));
+
+ RecoverErr = Interp->Parse("var1 = 424;");
+ EXPECT_TRUE(!!RecoverErr);
}
// Here we test whether the user can mix declarations and statements. The