summaryrefslogtreecommitdiffstats
path: root/llvm/unittests
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2014-01-09 19:47:39 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2014-01-09 19:47:39 +0000
commitcd56deb6bf6ce6fa192b3ef255fa2cc1e538ed7e (patch)
treeff6c742998641a959463c30ace4e4f1b2380e4b7 /llvm/unittests
parent96af9886eff421ddc653fd19baf47493551c1d28 (diff)
downloadbcm5719-llvm-cd56deb6bf6ce6fa192b3ef255fa2cc1e538ed7e.tar.gz
bcm5719-llvm-cd56deb6bf6ce6fa192b3ef255fa2cc1e538ed7e.zip
Add a unit test for the copy constructor.
I would not normally add tests like these, but the copy constructor is not used at all in our codebase with c++11, so having this tests might prevent breaking the c++03 build again. llvm-svn: 198886
Diffstat (limited to 'llvm/unittests')
-rw-r--r--llvm/unittests/Support/ErrorOrTest.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/llvm/unittests/Support/ErrorOrTest.cpp b/llvm/unittests/Support/ErrorOrTest.cpp
index 98174e8cd70..8a5b068d479 100644
--- a/llvm/unittests/Support/ErrorOrTest.cpp
+++ b/llvm/unittests/Support/ErrorOrTest.cpp
@@ -23,6 +23,9 @@ TEST(ErrorOr, SimpleValue) {
EXPECT_TRUE(a);
EXPECT_EQ(1, *a);
+ ErrorOr<int> b = a;
+ EXPECT_EQ(1, *b);
+
a = t2();
EXPECT_FALSE(a);
EXPECT_EQ(errc::invalid_argument, a.getError());
OpenPOWER on IntegriCloud