summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChandler Carruth <chandlerc@gmail.com>2013-11-09 04:49:27 +0000
committerChandler Carruth <chandlerc@gmail.com>2013-11-09 04:49:27 +0000
commitff272ac0e1b0c2e16ca37fc2bfb2705598be4b63 (patch)
tree992d9d898158d9786119680cee239e10db68acb2
parentb3b79ce63266d36f18af3ef0f65eafe3ec2d9c87 (diff)
downloadbcm5719-llvm-ff272ac0e1b0c2e16ca37fc2bfb2705598be4b63.tar.gz
bcm5719-llvm-ff272ac0e1b0c2e16ca37fc2bfb2705598be4b63.zip
Use something really explicit to test "move semantics" on builds without
r-value references. I still want to test that when we have them, llvm_move is actually a move. Have I mentioned that I really want to move to C++11? ;] llvm-svn: 194318
-rw-r--r--llvm/unittests/ADT/polymorphic_ptr_test.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/llvm/unittests/ADT/polymorphic_ptr_test.cpp b/llvm/unittests/ADT/polymorphic_ptr_test.cpp
index 90c3385c4f2..ce001d1e309 100644
--- a/llvm/unittests/ADT/polymorphic_ptr_test.cpp
+++ b/llvm/unittests/ADT/polymorphic_ptr_test.cpp
@@ -57,6 +57,10 @@ TEST(polymorphic_ptr_test, Basic) {
EXPECT_EQ(42, p->x);
polymorphic_ptr<S> p2((llvm_move(p)));
+#if !LLVM_HAS_RVALUE_REFERENCES
+ // 'p' may not have been moved from in C++98, fake it for the test.
+ p2 = p.take();
+#endif
EXPECT_FALSE((bool)p);
EXPECT_TRUE(!p);
EXPECT_TRUE((bool)p2);
OpenPOWER on IntegriCloud