summaryrefslogtreecommitdiff
path: root/libc/test/src/string/memcpy_test.cpp
AgeCommit message (Collapse)Author
2025-07-24[libc] Don't rely on LIBC_HAS_SANITIZER when enabling null checks. (#150341)Alexey Samsonov
LIBC_HAS_SANITIZER (which is defined if ASan, MSan, or UBSan is enabled) is currently used to implicitly disable null checks, normally enabled via LIBC_ADD_NULL_CHECKS config value. Remove this condition, and rely purely on the config value instead: * LIBC_HAS_SANITIZER will be true even for UBSan modes which doesn't rely on null checks at all (e.g. -fsanitize=alignment) * null checks today (implemented via __builtin_trap) should function normally today even when sanitizer is enabled - trap is still a trap * tests have been migrated to WITH_SIGNAL(-1) which doesn't prescript a particular signal / exit-code, and thus should pass even if sanitizers override the default ones.
2025-06-04[libc] Expand usage of libc null checks. (#116262)Aly ElAshram
Fixes #111546 --------- Co-authored-by: alyyelashram <150528548+alyyelashram@users.noreply.github.com>
2025-03-14[libc] Fix implicit conversion warnings in tests. (#131362)lntue
2024-07-12[libc] Migrate to using LIBC_NAMESPACE_DECL for namespace declaration (#98597)Petr Hosek
This is a part of #97655.
2024-07-12Revert "[libc] Migrate to using LIBC_NAMESPACE_DECL for namespace ↵Mehdi Amini
declaration" (#98593) Reverts llvm/llvm-project#98075 bots are broken
2024-07-11[libc] Migrate to using LIBC_NAMESPACE_DECL for namespace declaration (#98075)Petr Hosek
This is a part of #97655.
2024-05-14[libc][bug] Fix out of bound write in memcpy w/ software prefetching (#90591)Guillaume Chatelet
This patch adds tests for `memcpy` and `memset` making sure that we don't access buffers out of bounds. It relies on POSIX `mmap` / `mprotect` and works only when FULL_BUILD_MODE is disabled. The bug showed up while enabling software prefetching. `loop_and_tail_offset` is always running at least one iteration but in some configurations loop unrolled prefetching was actually needing only the tail operation and no loop iterations at all.
2023-09-26[libc] Mass replace enclosing namespace (#67032)Guillaume Chatelet
This is step 4 of https://discourse.llvm.org/t/rfc-customizable-namespace-to-allow-testing-the-libc-when-the-system-libc-is-also-llvms-libc/73079
2023-05-25[libc][test] Drastically reduce mem test runtimeGuillaume Chatelet
Reviewed By: lntue Differential Revision: https://reviews.llvm.org/D151450
2023-02-07[libc][NFC] Move UnitTest and IntegrationTest to the 'test' directory.Siva Chandra Reddy
This part of the effort to make all test related pieces into the `test` directory. This helps is excluding test related pieces in a straight forward manner if LLVM_INCLUDE_TESTS is OFF. Future patches will also move the MPFR wrapper and testutils into the 'test' directory.
2022-11-02[libc] Improve testing of mem functionsGuillaume Chatelet
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
2022-08-22[NFC][libc] Switch mem* tests from ArrayRef to spanGuillaume Chatelet
2022-08-01Reland [libc][NFC] Use STL case for arrayGuillaume Chatelet
This is a reland of https://reviews.llvm.org/D130773
2022-08-01Revert "[libc][NFC] Use STL case for array"Guillaume Chatelet
This reverts commit 7add0e5fdc5c7cb6f59f60cd436bf161cf9f9eb7.
2022-08-01[libc][NFC] Use STL case for arrayGuillaume Chatelet
Migrating all private STL code to the standard STL case but keeping it under the CPP namespace to avoid confusion. Differential Revision: https://reviews.llvm.org/D130773
2021-12-22[libc] apply formatting to testsMichael Jones
Apply the formatting rules that were applied to the libc/src directory to the libc/test directory, as well as the files in libc/utils that are included by the tests. This does not include automated enforcement. Reviewed By: sivachandra, lntue Differential Revision: https://reviews.llvm.org/D116127
2021-10-28[libc][NFC] Move utils/CPP to src/__support/CPP.Siva Chandra Reddy
The idea is to move all pieces related to the actual libc sources to the "src" directory. This allows downstream users to ship and build just the "src" directory. Reviewed By: michaelrj Differential Revision: https://reviews.llvm.org/D112653
2021-01-20[libc][NFC] add "LlvmLibc" as a prefix to all test namesMichael Jones
Summary: Having a consistent prefix makes selecting all of the llvm libc tests easier on any platform that is also using the gtest framework. This also modifies the TEST and TEST_F macros to enforce this change moving forward. Reviewers: sivachandra Subscribers:
2020-05-20[libc] Add memset and bzero implementationsGuillaume Chatelet
Summary: This patch adds general purpose `memset` and `bzero` implementations. Reviewers: sivachandra, abrachet Subscribers: mgorny, tschuett, ecnelises, libc-commits, courbet Tags: #libc-project Differential Revision: https://reviews.llvm.org/D80010
2020-03-18[libc] Adding memcpy implementation for x86_64Guillaume Chatelet
Summary: The patch is not ready yet and is here to discuss a few options: - How do we customize the implementation? (i.e. how to define `kRepMovsBSize`), - How do we specify custom compilation flags? (We'd need `-fno-builtin-memcpy` to be passed in), - How do we build? We may want to test in debug but build the libc with `-march=native` for instance, - Clang has a brand new builtin `__builtin_memcpy_inline` which makes the implementation easy and efficient, but: - If we compile with `gcc` or `msvc` we can't use it, resorting on less efficient code generation, - With gcc we can use `__builtin_memcpy` but then we'd need a postprocess step to check that the final assembly do not contain call to `memcpy` (unlikely but allowed), - For msvc we'd need to resort on the compiler optimization passes. Reviewers: sivachandra, abrachet Subscribers: mgorny, MaskRay, tschuett, libc-commits, courbet Tags: #libc-project Differential Revision: https://reviews.llvm.org/D74397