summaryrefslogtreecommitdiffstats
path: root/llvm/unittests/ADT/SmallVectorTest.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/unittests/ADT/SmallVectorTest.cpp')
-rw-r--r--llvm/unittests/ADT/SmallVectorTest.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/llvm/unittests/ADT/SmallVectorTest.cpp b/llvm/unittests/ADT/SmallVectorTest.cpp
index d5bfe768003..c2542d614e2 100644
--- a/llvm/unittests/ADT/SmallVectorTest.cpp
+++ b/llvm/unittests/ADT/SmallVectorTest.cpp
@@ -413,4 +413,17 @@ TEST_F(SmallVectorTest, IteratorTest) {
theVector.insert(theVector.end(), L.begin(), L.end());
}
+struct notassignable {
+ int &x;
+ notassignable(int &x) : x(x) {}
+};
+
+TEST_F(SmallVectorTest, NoAssignTest) {
+ int x = 0;
+ SmallVector<notassignable, 2> vec;
+ vec.push_back(notassignable(x));
+ x = 42;
+ EXPECT_EQ(42, vec.pop_back_val().x);
+}
+
}
OpenPOWER on IntegriCloud