[libc-commits] [libc] [libc][test] make `str_to_float_comparison_test` independent of C++ headers. (PR #133978)

Muhammad Bassiouni via libc-commits libc-commits at lists.llvm.org
Tue Apr 1 20:07:47 PDT 2025


================
@@ -249,31 +249,22 @@ add_libc_test(
     libc.src.__support.memory_size
 )
 
-# FIXME: We shouldn't have regular executables created because we could be
-#        cross-compiling the tests and running through an emulator.
 if(NOT LIBC_TARGET_OS_IS_GPU)
-  add_executable(
-    libc_str_to_float_comparison_test
-    str_to_float_comparison_test.cpp
-  )
-
-  target_link_libraries(libc_str_to_float_comparison_test
-    PRIVATE
-      "${LIBC_TARGET}"
-  )
-
-  add_executable(
-    libc_system_str_to_float_comparison_test
-    str_to_float_comparison_test.cpp
+  add_libc_test(
+    str_to_float_comparison_test
+    SUITE
+      libc-support-tests
+    SRCS
+      str_to_float_comparison_test.cpp
+    DEPENDS
+      libc.src.stdio.printf
+      libc.src.stdio.fopen
+      libc.src.stdio.fclose
+      libc.src.stdio.fgets
+      libc.src.stdlib.strtof
+      libc.src.stdlib.strtod
+    NO_RUN_POSTBUILD
----------------
bassiounix wrote:

it can't be moved right before `SUITE`, only in the order I put that the test is properly configured.

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


More information about the libc-commits mailing list