diff options
Diffstat (limited to 'unittests/Support/ErrorTest.cpp')
-rw-r--r-- | unittests/Support/ErrorTest.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/unittests/Support/ErrorTest.cpp b/unittests/Support/ErrorTest.cpp index 382346cd231ac..299fc50b46979 100644 --- a/unittests/Support/ErrorTest.cpp +++ b/unittests/Support/ErrorTest.cpp @@ -475,6 +475,10 @@ TEST(Error, CantFailSuccess) { int X = cantFail(Expected<int>(42)); EXPECT_EQ(X, 42) << "Expected value modified by cantFail"; + + int Dummy = 42; + int &Y = cantFail(Expected<int&>(Dummy)); + EXPECT_EQ(&Dummy, &Y) << "Reference mangled by cantFail"; } // Test that cantFail results in a crash if you pass it a failure value. |