[libc-commits] [libc] lfind_test.cpp: put helpers in an anonymous namespace. (PR #137821)

via libc-commits libc-commits at lists.llvm.org
Tue Apr 29 07:44:12 PDT 2025


https://github.com/enh-google created https://github.com/llvm/llvm-project/pull/137821

This matches other tests and allows the tests to be built together (as Android is doing).

>From 6a252b6f60435dd125dc8a8ecd1e7023e9e8aa0d Mon Sep 17 00:00:00 2001
From: enh-google <53129816+enh-google at users.noreply.github.com>
Date: Tue, 29 Apr 2025 10:41:21 -0400
Subject: [PATCH] lfind_test.cpp: put helpers in an anonymous namespace.

This matches other tests and allows the tests to be built together (as Android is doing).
---
 libc/test/src/search/lfind_test.cpp | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/libc/test/src/search/lfind_test.cpp b/libc/test/src/search/lfind_test.cpp
index 00384f7eec14e..8c67bd4aefe1c 100644
--- a/libc/test/src/search/lfind_test.cpp
+++ b/libc/test/src/search/lfind_test.cpp
@@ -9,10 +9,14 @@
 #include "src/search/lfind.h"
 #include "test/UnitTest/Test.h"
 
+namespace {
+
 int compar(const void *a, const void *b) {
   return *reinterpret_cast<const int *>(a) != *reinterpret_cast<const int *>(b);
 }
 
+};
+
 TEST(LlvmLibcLfindTest, SearchHead) {
   int list[3] = {1, 2, 3};
   size_t len = 3;



More information about the libc-commits mailing list