[libc-commits] [libc] [libc] Fix buggy AVX2 `memcmp` (PR #77081)

via libc-commits libc-commits at lists.llvm.org
Fri Jan 5 13:34:13 PST 2024


================
@@ -37,6 +37,13 @@ TEST(LlvmLibcMemcmpTest, LhsAfterRhsLexically) {
   EXPECT_GT(LIBC_NAMESPACE::memcmp(lhs, rhs, 2), 0);
 }
 
+TEST(LlvmLibcMemcmpTest, Issue77080) {
+  // https://github.com/llvm/llvm-project/issues/77080
+  constexpr char lhs[35] = "1.069cd68bbe76eb2143a3284d27ebe220";
+  constexpr char rhs[35] = "1.0500185b5d966a544e2d0fa40701b0f3";
+  EXPECT_GT(LIBC_NAMESPACE::memcmp(lhs, rhs, 34), 0);
----------------
michaelrj-google wrote:

nit: I think `ASSERT_GE(..., 1)` is clearer

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


More information about the libc-commits mailing list