aboutsummaryrefslogtreecommitdiff
path: root/llvm/unittests/Support/ErrorTest.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/unittests/Support/ErrorTest.cpp')
-rw-r--r--llvm/unittests/Support/ErrorTest.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/llvm/unittests/Support/ErrorTest.cpp b/llvm/unittests/Support/ErrorTest.cpp
index 893bd68..1a0dd44 100644
--- a/llvm/unittests/Support/ErrorTest.cpp
+++ b/llvm/unittests/Support/ErrorTest.cpp
@@ -105,6 +105,12 @@ TEST(Error, UncheckedSuccess) {
}
#endif
+// Test that errors to be used as out parameters are implicitly checked (
+// and thus destruct quietly).
+TEST(Error, ErrorAsOutParameter) {
+ Error E = Error::errorForOutParameter();
+}
+
// Check that we abort on unhandled failure cases. (Force conversion to bool
// to make sure that we don't accidentally treat checked errors as handled).
// Test runs in debug mode only.