[all-commits] [llvm/llvm-project] 363519: [libc] Improve testing of mem functions

Guillaume Chatelet via All-commits all-commits at lists.llvm.org
Wed Nov 2 01:56:08 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 3635195e0d54162ba85124fdefcac39bff703149
      https://github.com/llvm/llvm-project/commit/3635195e0d54162ba85124fdefcac39bff703149
  Author: Guillaume Chatelet <gchatelet at google.com>
  Date:   2022-11-02 (Wed, 02 Nov 2022)

  Changed paths:
    M libc/test/src/string/bcmp_test.cpp
    M libc/test/src/string/bzero_test.cpp
    M libc/test/src/string/memcmp_test.cpp
    M libc/test/src/string/memcpy_test.cpp
    M libc/test/src/string/memmove_test.cpp
    A libc/test/src/string/memory_utils/memory_check_utils.h
    M libc/test/src/string/memory_utils/op_tests.cpp
    M libc/test/src/string/memset_test.cpp

  Log Message:
  -----------
  [libc] Improve testing of mem functions

This patch extracts the testing logic from `op_tests.cpp` into
`memory_check_utils.h` so we can reuse it for mem* function integration
tests.

This makes testing consistent and thorough.
For instance this catches a bug that got unnoticed during submission of
D136595 and D135134. Integration test for memcmp was only testing a
single size.

This also leverages ASAN to make sure that data is not read / written
outside permitted boundaries

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




More information about the All-commits mailing list