[libc-commits] [libc] [libc] [search] implement hcreate(_r)/hsearch(_r)/hdestroy(_r) (PR #73469)

via libc-commits libc-commits at lists.llvm.org
Mon Nov 27 21:19:22 PST 2023


================
@@ -0,0 +1,67 @@
+add_libc_test(
+  bitmask_test
+  SUITE
+    libc-support-tests
+  SRCS
+    bitmask_test.cpp
+  DEPENDS
+    libc.src.__support.HashTable.bitmask
+    libc.include.stdlib
+)
+add_libc_test(
+  table_test
+  SUITE
+    libc-support-tests
+  SRCS
+    table_test.cpp
+  DEPENDS
+    libc.src.__support.HashTable.randomness
+    libc.src.__support.HashTable.table
+    libc.src.__support.common
+  UNIT_TEST_ONLY
+)
+cpu_supports(CPU_SUPPORTS_SSE2 "SSE2")
+if (CPU_SUPPORTS_SSE2)
----------------
lntue wrote:

You can add automated testing for SSE2 as follow:
- define `SSE2_OPT` similar to `ROUND_OPT` flag in `libc/cmake/modules/LLVMLibCFlagRules.cmake`
- expand `${SSE2_OPT_FLAG}` similar to `${ROUND_OPT_FLAG}` in `libc/cmake/modules/LLVMLibCObjectRules.cmake`, function `_get_common_compile_options`
- add `FLAGS SSE2_OPT` inside `add_header_library(bitmask ...)` in `libc/src/__support/HashTable/CMakeLists.txt` above.

Then all tests and targets depending on `libc.src.__support.HashTable.bitmask` will be extended to both with and without SSE2.

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


More information about the libc-commits mailing list