From 08bbd35a80bf7765fe0d3043f9eb5a2f2786b649 Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Mon, 26 Jun 2017 20:32:52 +0000 Subject: Vendor import of llvm trunk r306325: https://llvm.org/svn/llvm-project/llvm/trunk@306325 --- unittests/Support/ErrorTest.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'unittests/Support/ErrorTest.cpp') 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(42)); EXPECT_EQ(X, 42) << "Expected value modified by cantFail"; + + int Dummy = 42; + int &Y = cantFail(Expected(Dummy)); + EXPECT_EQ(&Dummy, &Y) << "Reference mangled by cantFail"; } // Test that cantFail results in a crash if you pass it a failure value. -- cgit v1.2.3