[all-commits] [llvm/llvm-project] e3dd9f: [libc++] Safe allocator tests

Tacet via All-commits all-commits at lists.llvm.org
Thu Mar 9 04:22:12 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: e3dd9f7e66fec22986605da2dcd8120a7864455d
      https://github.com/llvm/llvm-project/commit/e3dd9f7e66fec22986605da2dcd8120a7864455d
  Author: Advenam Tacet <advenam.tacet at trailofbits.com>
  Date:   2023-03-09 (Thu, 09 Mar 2023)

  Changed paths:
    M libcxx/test/std/containers/sequences/vector/access.pass.cpp
    M libcxx/test/std/containers/sequences/vector/contiguous.pass.cpp
    M libcxx/test/std/containers/sequences/vector/vector.capacity/empty.pass.cpp
    M libcxx/test/std/containers/sequences/vector/vector.capacity/reserve.pass.cpp
    M libcxx/test/std/containers/sequences/vector/vector.capacity/resize_size.pass.cpp
    M libcxx/test/std/containers/sequences/vector/vector.capacity/resize_size_value.pass.cpp
    M libcxx/test/std/containers/sequences/vector/vector.capacity/shrink_to_fit.pass.cpp
    M libcxx/test/std/containers/sequences/vector/vector.capacity/size.pass.cpp
    M libcxx/test/std/containers/sequences/vector/vector.capacity/swap.pass.cpp
    M libcxx/test/std/containers/sequences/vector/vector.cons/assign_copy.pass.cpp
    M libcxx/test/std/containers/sequences/vector/vector.cons/assign_move.pass.cpp
    M libcxx/test/std/containers/sequences/vector/vector.cons/construct_iter_iter.pass.cpp
    M libcxx/test/std/containers/sequences/vector/vector.cons/construct_iter_iter_alloc.pass.cpp
    M libcxx/test/std/containers/sequences/vector/vector.cons/construct_size.pass.cpp
    M libcxx/test/std/containers/sequences/vector/vector.cons/construct_size_value.pass.cpp
    M libcxx/test/std/containers/sequences/vector/vector.cons/construct_size_value_alloc.pass.cpp
    M libcxx/test/std/containers/sequences/vector/vector.cons/copy.pass.cpp
    M libcxx/test/std/containers/sequences/vector/vector.cons/copy_alloc.pass.cpp
    M libcxx/test/std/containers/sequences/vector/vector.cons/initializer_list.pass.cpp
    M libcxx/test/std/containers/sequences/vector/vector.cons/initializer_list_alloc.pass.cpp
    M libcxx/test/std/containers/sequences/vector/vector.cons/move.pass.cpp
    M libcxx/test/std/containers/sequences/vector/vector.cons/move_alloc.pass.cpp
    M libcxx/test/std/containers/sequences/vector/vector.data/data.pass.cpp
    M libcxx/test/std/containers/sequences/vector/vector.data/data_const.pass.cpp
    M libcxx/test/std/containers/sequences/vector/vector.erasure/erase.pass.cpp
    M libcxx/test/std/containers/sequences/vector/vector.erasure/erase_if.pass.cpp
    M libcxx/test/std/containers/sequences/vector/vector.modifiers/clear.pass.cpp
    M libcxx/test/std/containers/sequences/vector/vector.modifiers/emplace.pass.cpp
    M libcxx/test/std/containers/sequences/vector/vector.modifiers/emplace_back.pass.cpp
    M libcxx/test/std/containers/sequences/vector/vector.modifiers/emplace_extra.pass.cpp
    M libcxx/test/std/containers/sequences/vector/vector.modifiers/insert_iter_lvalue.pass.cpp
    M libcxx/test/std/containers/sequences/vector/vector.modifiers/insert_iter_rvalue.pass.cpp
    M libcxx/test/std/containers/sequences/vector/vector.modifiers/insert_iter_size_value.pass.cpp
    M libcxx/test/std/containers/sequences/vector/vector.special/swap.pass.cpp
    M libcxx/test/support/min_allocator.h

  Log Message:
  -----------
  [libc++] Safe allocator tests

This revision adds:
- New test allocator, which cleans memory during allocation and deallocation,
- tests using that allocator to vector.

This patch is part of our efforts to add support for ASan annotations with every
allocator.

This commit adds a new allocator for testing purposes only. The safe allocator
ensures that memory is cleand (zeroed) during allocation and deallocation, and
is intendted to test ASan annotations for every allocator in std::vector.
Check: D136765

Those tests should work correctly, even if support for every allocator in std::vector
is not yet available.

Support in ASan API was added here: rGdd1b7b797a116eed588fd752fbe61d34deeb24e4

Reviewed By: philnik, #libc

Spies: libcxx-commits

Differential Revision: https://reviews.llvm.org/D145597




More information about the All-commits mailing list