mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-26 18:36:05 +00:00

The existing tests for `vector<bool>` copy- and move-assignment operators are limited to 3 bits only, which are inadequate to cover realistic scenarios. Most `vector<bool>` operations have code paths that are executed only when multiple storage words are involved, with each storage word typically comprising 64 bits on a 64-bit platform. Furthermore, the existing tests fail to cover all combinations `POCCA`/`POCMA`, along with different allocator equality and/or reallocation scenarios, leaving some critical code paths untested. This patch enhances the test coverage by introducing new tests covering up to 5 storage words, ensuring that partial words in the front or tail, and whole words in the middle are all properly tested. Moreover, these new tests ensure that the copy- and move-assignment operators are tested under all combinations of `POCCA`/`POCMA` and various allocator equality scenarios, both with or without reallocations.