[libcxx-commits] [PATCH] D88421: Add a regression test for erasing from a vector

Louis Dionne via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Tue Sep 29 09:19:42 PDT 2020


This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG7bed95a856f1: [libc++] Add a regression test for erasing from a vector (authored by arthur.j.odwyer, committed by ldionne).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D88421/new/

https://reviews.llvm.org/D88421

Files:
  libcxx/test/std/containers/sequences/vector/vector.modifiers/erase_iter.pass.cpp


Index: libcxx/test/std/containers/sequences/vector/vector.modifiers/erase_iter.pass.cpp
===================================================================
--- libcxx/test/std/containers/sequences/vector/vector.modifiers/erase_iter.pass.cpp
+++ libcxx/test/std/containers/sequences/vector/vector.modifiers/erase_iter.pass.cpp
@@ -35,6 +35,21 @@
 
 int main(int, char**)
 {
+    {
+    int a1[] = {1, 2, 3, 4, 5};
+    std::vector<int> l1(a1, a1+5);
+    l1.erase(l1.begin());
+    assert(is_contiguous_container_asan_correct(l1));
+    assert(l1 == std::vector<int>(a1+1, a1+5));
+    }
+    {
+    int a1[] = {1, 2, 3, 4, 5};
+    int e1[] = {1, 3, 4, 5};
+    std::vector<int> l1(a1, a1+5);
+    l1.erase(l1.begin() + 1);
+    assert(is_contiguous_container_asan_correct(l1));
+    assert(l1 == std::vector<int>(e1, e1+4));
+    }
     {
     int a1[] = {1, 2, 3};
     std::vector<int> l1(a1, a1+3);


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D88421.295017.patch
Type: text/x-patch
Size: 903 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20200929/71b2e804/attachment.bin>


More information about the libcxx-commits mailing list