[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:48 PDT 2025
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-libc
Author: None (enh-google)
<details>
<summary>Changes</summary>
This matches other tests and allows the tests to be built together (as Android is doing).
---
Full diff: https://github.com/llvm/llvm-project/pull/137821.diff
1 Files Affected:
- (modified) libc/test/src/search/lfind_test.cpp (+4)
``````````diff
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;
``````````
</details>
https://github.com/llvm/llvm-project/pull/137821
More information about the libc-commits
mailing list