[libc-commits] [libc] [libc] Don't match the byte after the range in vector find_first_character (PR #235288)

Michael Jones via libc-commits libc-commits at lists.llvm.org
Wed Nov 4 15:53:35 PST 2026


================
@@ -120,4 +120,37 @@ TEST_F(LlvmLibcWideAccessMemoryTest, FindFirstChar) {
   });
 }
 
+TEST_F(LlvmLibcWideAccessMemoryTest, FindFirstCharAfterRange) {
+  // All implementations, since the configured one is usually not vectorized.
+  static constexpr void *(*kImpls[])(const unsigned char *, unsigned char,
+                                     size_t) = {
+      internal::element::find_first_character,
+      internal::word::find_first_character,
+#if LIBC_HAS_VECTOR_TYPE
+      clang_vector::find_first_character,
+#endif
+#ifdef LIBC_TARGET_ARCH_IS_X86
+      internal::arch_vector::find_first_character,
+#endif
----------------
michaelrj-google wrote:

this is a good test to have, I wish there was a cleaner way to set this up. For now please add a comment that other arches should be added to this list when we add target specific `find_first_character` implementations.

https://github.com/llvm/llvm-project/pull/235288


More information about the libc-commits mailing list