Skip to content

[libc][bazel] Fold "libc_function_deps" into "deps" for libc_tests. #135835

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 16, 2025

Conversation

vonosmas
Copy link
Contributor

libc_function_deps and deps are now identical, as we no longer need or have special treatment for libc_function targets. Merge these attributes passed to the libc_test macro, and fix all relevant libc_test macro invocations. This change is a no-op.

This concludes cleanup started in 9b13d34.

libc_function_deps and deps are now identical, as we no longer need or
have special treatment for libc_function targets. Merge these attributes
passed to the libc_test macro, and fix all relevant libc_test macro
invocations. This change is a no-op.

This concludes cleanup started in 9b13d34.
@llvmbot llvmbot added libc bazel "Peripheral" support tier build system: utils/bazel labels Apr 15, 2025
@llvmbot
Copy link
Member

llvmbot commented Apr 15, 2025

@llvm/pr-subscribers-libc

Author: Alexey Samsonov (vonosmas)

Changes

libc_function_deps and deps are now identical, as we no longer need or have special treatment for libc_function targets. Merge these attributes passed to the libc_test macro, and fix all relevant libc_test macro invocations. This change is a no-op.

This concludes cleanup started in 9b13d34.


Patch is 38.11 KiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/135835.diff

13 Files Affected:

  • (modified) utils/bazel/llvm-project-overlay/libc/test/libc_test_rules.bzl (+3-4)
  • (modified) utils/bazel/llvm-project-overlay/libc/test/src/complex/BUILD.bazel (+4-8)
  • (modified) utils/bazel/llvm-project-overlay/libc/test/src/fenv/BUILD.bazel (+17-35)
  • (modified) utils/bazel/llvm-project-overlay/libc/test/src/inttypes/BUILD.bazel (+2-4)
  • (modified) utils/bazel/llvm-project-overlay/libc/test/src/math/libc_math_test_rules.bzl (+1-2)
  • (modified) utils/bazel/llvm-project-overlay/libc/test/src/stdbit/BUILD.bazel (+6-5)
  • (modified) utils/bazel/llvm-project-overlay/libc/test/src/stdio/BUILD.bazel (+18-28)
  • (modified) utils/bazel/llvm-project-overlay/libc/test/src/stdlib/BUILD.bazel (+63-37)
  • (modified) utils/bazel/llvm-project-overlay/libc/test/src/string/BUILD.bazel (+20-28)
  • (modified) utils/bazel/llvm-project-overlay/libc/test/src/strings/BUILD.bazel (+3-9)
  • (modified) utils/bazel/llvm-project-overlay/libc/test/src/sys/epoll/BUILD.bazel (+19-31)
  • (modified) utils/bazel/llvm-project-overlay/libc/test/src/sys/socket/BUILD.bazel (+16-26)
  • (modified) utils/bazel/llvm-project-overlay/libc/test/src/unistd/BUILD.bazel (+36-64)
diff --git a/utils/bazel/llvm-project-overlay/libc/test/libc_test_rules.bzl b/utils/bazel/llvm-project-overlay/libc/test/libc_test_rules.bzl
index 7e798429ef19b..123e05727aeff 100644
--- a/utils/bazel/llvm-project-overlay/libc/test/libc_test_rules.bzl
+++ b/utils/bazel/llvm-project-overlay/libc/test/libc_test_rules.bzl
@@ -15,14 +15,13 @@ When performing tests we make sure to always use the internal version.
 load("//libc:libc_build_rules.bzl", "libc_common_copts")
 load("//libc:libc_configure_options.bzl", "LIBC_CONFIGURE_OPTIONS")
 
-def libc_test(name, libc_function_deps = [], copts = [], deps = [], local_defines = [], **kwargs):
+def libc_test(name, copts = [], deps = [], local_defines = [], **kwargs):
     """Add target for a libc test.
 
     Args:
       name: Test target name
-      libc_function_deps: List of libc_function targets used by this test.
       copts: The list of options to add to the C++ compilation command.
-      deps: The list of other libraries to be linked in to the test target.
+      deps: The list of libc functions and libraries to be linked in.
       local_defines: The list of target local_defines if any.
       **kwargs: Attributes relevant for a cc_test.
     """
@@ -37,7 +36,7 @@ def libc_test(name, libc_function_deps = [], copts = [], deps = [], local_define
             "//libc:func_free",
             "//libc:func_malloc",
             "//libc:func_realloc",
-        ] + libc_function_deps + deps,
+        ] + deps,
         copts = copts + libc_common_copts(),
         linkstatic = 1,
         **kwargs
diff --git a/utils/bazel/llvm-project-overlay/libc/test/src/complex/BUILD.bazel b/utils/bazel/llvm-project-overlay/libc/test/src/complex/BUILD.bazel
index d0965bb2ee147..cc3a8d8b4b96a 100644
--- a/utils/bazel/llvm-project-overlay/libc/test/src/complex/BUILD.bazel
+++ b/utils/bazel/llvm-project-overlay/libc/test/src/complex/BUILD.bazel
@@ -7,8 +7,7 @@ load("//libc/test:libc_test_rules.bzl", "libc_test")
             "CImagTest.h",
             func_name + "_test.cpp",
         ],
-        libc_function_deps = ["//libc:func_name".replace("func_name", func_name)],
-        deps = [
+        deps = ["//libc:func_name".replace("func_name", func_name)] + [
             "//libc:hdr_math_macros",
             "//libc/test/UnitTest:fp_test_helpers",
         ],
@@ -29,8 +28,7 @@ load("//libc/test:libc_test_rules.bzl", "libc_test")
             "ConjTest.h",
             func_name + "_test.cpp",
         ],
-        libc_function_deps = ["//libc:func_name".replace("func_name", func_name)],
-        deps = [
+        deps = ["//libc:func_name".replace("func_name", func_name)] + [
             "//libc:hdr_math_macros",
             "//libc/test/UnitTest:fp_test_helpers",
         ],
@@ -51,8 +49,7 @@ load("//libc/test:libc_test_rules.bzl", "libc_test")
             "CprojTest.h",
             func_name + "_test.cpp",
         ],
-        libc_function_deps = ["//libc:func_name".replace("func_name", func_name)],
-        deps = [
+        deps = ["//libc:func_name".replace("func_name", func_name)] + [
             "//libc:hdr_math_macros",
             "//libc/test/UnitTest:fp_test_helpers",
         ] + (["//libc/utils/MPCWrapper:mpc_wrapper"] if func_name == "cprojf" else []),
@@ -73,8 +70,7 @@ load("//libc/test:libc_test_rules.bzl", "libc_test")
             "CRealTest.h",
             func_name + "_test.cpp",
         ],
-        libc_function_deps = ["//libc:func_name".replace("func_name", func_name)],
-        deps = [
+        deps = ["//libc:func_name".replace("func_name", func_name)] + [
             "//libc:hdr_math_macros",
             "//libc/test/UnitTest:fp_test_helpers",
         ],
diff --git a/utils/bazel/llvm-project-overlay/libc/test/src/fenv/BUILD.bazel b/utils/bazel/llvm-project-overlay/libc/test/src/fenv/BUILD.bazel
index c6ae534b0f640..1af1a984db92a 100644
--- a/utils/bazel/llvm-project-overlay/libc/test/src/fenv/BUILD.bazel
+++ b/utils/bazel/llvm-project-overlay/libc/test/src/fenv/BUILD.bazel
@@ -16,14 +16,12 @@ libc_test(
         "exception_status_test.cpp",
         "excepts.h",
     ],
-    libc_function_deps = [
+    deps = [
+        "//libc:__support_fputil_fenv_impl",
         "//libc:feclearexcept",
         "//libc:feraiseexcept",
         "//libc:fesetexcept",
         "//libc:fetestexcept",
-    ],
-    deps = [
-        "//libc:__support_fputil_fenv_impl",
         "//libc:hdr_fenv_macros",
         "//libc/test/UnitTest:fp_test_helpers",
     ],
@@ -35,11 +33,9 @@ libc_test(
         "excepts.h",
         "rounding_mode_test.cpp",
     ],
-    libc_function_deps = [
+    deps = [
         "//libc:fegetround",
         "//libc:fesetround",
-    ],
-    deps = [
         "//libc:hdr_fenv_macros",
         "//libc/test/UnitTest:fp_test_helpers",
     ],
@@ -51,16 +47,14 @@ libc_test(
         "enabled_exceptions_test.cpp",
         "excepts.h",
     ],
-    libc_function_deps = [
-        "//libc:feclearexcept",
-        "//libc:feraiseexcept",
-        "//libc:fetestexcept",
-    ],
     tags = ["nosan"],
     deps = [
         "//libc:__support_common",
         "//libc:__support_fputil_fenv_impl",
         "//libc:__support_macros_properties_architectures",
+        "//libc:feclearexcept",
+        "//libc:feraiseexcept",
+        "//libc:fetestexcept",
         "//libc:hdr_fenv_macros",
         "//libc/test/UnitTest:fp_test_helpers",
     ],
@@ -72,14 +66,12 @@ libc_test(
         "excepts.h",
         "feholdexcept_test.cpp",
     ],
-    libc_function_deps = [
-        "//libc:feholdexcept",
-    ],
     tags = ["nosan"],
     deps = [
         "//libc:__support_common",
         "//libc:__support_fputil_fenv_impl",
         "//libc:__support_macros_properties_architectures",
+        "//libc:feholdexcept",
         "//libc:hdr_fenv_macros",
         "//libc:types_fenv_t",
         "//libc/test/UnitTest:fp_test_helpers",
@@ -92,13 +84,11 @@ libc_test(
         "exception_flags_test.cpp",
         "excepts.h",
     ],
-    libc_function_deps = [
+    deps = [
+        "//libc:__support_fputil_fenv_impl",
         "//libc:fegetexceptflag",
         "//libc:fesetexceptflag",
         "//libc:fetestexceptflag",
-    ],
-    deps = [
-        "//libc:__support_fputil_fenv_impl",
         "//libc:hdr_fenv_macros",
         "//libc:types_fexcept_t",
         "//libc/test/UnitTest:fp_test_helpers",
@@ -111,11 +101,9 @@ libc_test(
         "excepts.h",
         "feclearexcept_test.cpp",
     ],
-    libc_function_deps = [
-        "//libc:feclearexcept",
-    ],
     deps = [
         "//libc:__support_fputil_fenv_impl",
+        "//libc:feclearexcept",
         "//libc:hdr_fenv_macros",
         "//libc/test/UnitTest:fp_test_helpers",
     ],
@@ -127,14 +115,12 @@ libc_test(
         "excepts.h",
         "feenableexcept_test.cpp",
     ],
-    libc_function_deps = [
-        "//libc:fedisableexcept",
-        "//libc:feenableexcept",
-        "//libc:fegetexcept",
-    ],
     deps = [
         "//libc:__support_common",
         "//libc:__support_macros_properties_architectures",
+        "//libc:fedisableexcept",
+        "//libc:feenableexcept",
+        "//libc:fegetexcept",
         "//libc:hdr_fenv_macros",
         "//libc/test/UnitTest:fp_test_helpers",
     ],
@@ -146,11 +132,9 @@ libc_test(
         "excepts.h",
         "feupdateenv_test.cpp",
     ],
-    libc_function_deps = [
-        "//libc:feupdateenv",
-    ],
     deps = [
         "//libc:__support_fputil_fenv_impl",
+        "//libc:feupdateenv",
         "//libc:hdr_fenv_macros",
         "//libc:types_fenv_t",
         "//libc/test/UnitTest:fp_test_helpers",
@@ -163,15 +147,13 @@ libc_test(
         "excepts.h",
         "getenv_and_setenv_test.cpp",
     ],
-    libc_function_deps = [
+    deps = [
+        "//libc:__support_fputil_fenv_impl",
+        "//libc:__support_macros_properties_os",
         "//libc:fegetenv",
         "//libc:fegetround",
         "//libc:fesetenv",
         "//libc:fesetround",
-    ],
-    deps = [
-        "//libc:__support_fputil_fenv_impl",
-        "//libc:__support_macros_properties_os",
         "//libc:hdr_fenv_macros",
         "//libc:types_fenv_t",
         "//libc/test/UnitTest:fp_test_helpers",
diff --git a/utils/bazel/llvm-project-overlay/libc/test/src/inttypes/BUILD.bazel b/utils/bazel/llvm-project-overlay/libc/test/src/inttypes/BUILD.bazel
index bda7245d1f677..3dd4ab379efe0 100644
--- a/utils/bazel/llvm-project-overlay/libc/test/src/inttypes/BUILD.bazel
+++ b/utils/bazel/llvm-project-overlay/libc/test/src/inttypes/BUILD.bazel
@@ -13,7 +13,7 @@ licenses(["notice"])
 libc_test(
     name = "imaxabs_test",
     srcs = ["imaxabs_test.cpp"],
-    libc_function_deps = [
+    deps = [
         "//libc:imaxabs",
     ],
 )
@@ -21,10 +21,8 @@ libc_test(
 libc_test(
     name = "imaxdiv_test",
     srcs = ["imaxdiv_test.cpp"],
-    libc_function_deps = [
-        "//libc:imaxdiv",
-    ],
     deps = [
+        "//libc:imaxdiv",
         "//libc/test/src/stdlib:div_test_helper",
     ],
 )
diff --git a/utils/bazel/llvm-project-overlay/libc/test/src/math/libc_math_test_rules.bzl b/utils/bazel/llvm-project-overlay/libc/test/src/math/libc_math_test_rules.bzl
index 16845ab66dfd4..d2297d51383cc 100644
--- a/utils/bazel/llvm-project-overlay/libc/test/src/math/libc_math_test_rules.bzl
+++ b/utils/bazel/llvm-project-overlay/libc/test/src/math/libc_math_test_rules.bzl
@@ -23,8 +23,7 @@ def math_test(name, hdrs = [], deps = [], **kwargs):
     libc_test(
         name = test_name,
         srcs = [test_name + ".cpp"] + hdrs,
-        libc_function_deps = ["//libc:func_name".replace("func_name", name)],
-        deps = [
+        deps = ["//libc:func_name".replace("func_name", name)] + [
             "//libc:__support_cpp_algorithm",
             "//libc:__support_cpp_bit",
             "//libc:__support_cpp_limits",
diff --git a/utils/bazel/llvm-project-overlay/libc/test/src/stdbit/BUILD.bazel b/utils/bazel/llvm-project-overlay/libc/test/src/stdbit/BUILD.bazel
index b9d153947dc7d..119d7d5337750 100644
--- a/utils/bazel/llvm-project-overlay/libc/test/src/stdbit/BUILD.bazel
+++ b/utils/bazel/llvm-project-overlay/libc/test/src/stdbit/BUILD.bazel
@@ -39,11 +39,12 @@ bit_prefix_list = [
     libc_test(
         name = bit_prefix + bit_suffix + "_test",
         srcs = [bit_prefix + bit_suffix + "_test.cpp"],
-        libc_function_deps = ["//libc:func_name".replace(
-            "func_name",
-            bit_prefix + bit_suffix,
-        )],
-        deps = ["//libc:__support_cpp_limits"],
+        deps = [
+            "//libc:func_name".replace(
+                "func_name",
+                bit_prefix + bit_suffix,
+            ),
+        ] + ["//libc:__support_cpp_limits"],
     )
     for bit_prefix in bit_prefix_list
     for bit_suffix in bit_suffix_list
diff --git a/utils/bazel/llvm-project-overlay/libc/test/src/stdio/BUILD.bazel b/utils/bazel/llvm-project-overlay/libc/test/src/stdio/BUILD.bazel
index c3865ea07ea91..484d3e5e0a24e 100644
--- a/utils/bazel/llvm-project-overlay/libc/test/src/stdio/BUILD.bazel
+++ b/utils/bazel/llvm-project-overlay/libc/test/src/stdio/BUILD.bazel
@@ -13,8 +13,6 @@ licenses(["notice"])
 libc_test(
     name = "printf_parser_test",
     srcs = ["printf_core/parser_test.cpp"],
-    libc_function_deps = [
-    ],
     deps = [
         "//libc:__support_arg_list",
         "//libc:__support_cpp_bit",
@@ -28,8 +26,6 @@ libc_test(
 libc_test(
     name = "printf_writer_test",
     srcs = ["printf_core/writer_test.cpp"],
-    libc_function_deps = [
-    ],
     deps = [
         "//libc:__support_arg_list",
         "//libc:__support_cpp_string_view",
@@ -42,8 +38,6 @@ libc_test(
 libc_test(
     name = "printf_converter_test",
     srcs = ["printf_core/converter_test.cpp"],
-    libc_function_deps = [
-    ],
     deps = [
         "//libc:__support_arg_list",
         "//libc:__support_cpp_string_view",
@@ -56,11 +50,9 @@ libc_test(
 libc_test(
     name = "sprintf_test",
     srcs = ["sprintf_test.cpp"],
-    libc_function_deps = [
-        "//libc:sprintf",
-    ],
     deps = [
         "//libc:__support_fputil_fp_bits",
+        "//libc:sprintf",
         "//libc/test/UnitTest:fp_test_helpers",
     ],
 )
@@ -68,7 +60,7 @@ libc_test(
 libc_test(
     name = "snprintf_test",
     srcs = ["snprintf_test.cpp"],
-    libc_function_deps = [
+    deps = [
         "//libc:snprintf",
     ],
 )
@@ -76,7 +68,7 @@ libc_test(
 libc_test(
     name = "printf_test",
     srcs = ["printf_test.cpp"],
-    libc_function_deps = [
+    deps = [
         "//libc:printf",
     ],
 )
@@ -84,7 +76,7 @@ libc_test(
 libc_test(
     name = "fprintf_test",
     srcs = ["fprintf_test.cpp"],
-    libc_function_deps = [
+    deps = [
         "//libc:fprintf",
     ],
 )
@@ -92,7 +84,7 @@ libc_test(
 libc_test(
     name = "vsprintf_test",
     srcs = ["vsprintf_test.cpp"],
-    libc_function_deps = [
+    deps = [
         "//libc:vsprintf",
     ],
 )
@@ -100,7 +92,7 @@ libc_test(
 libc_test(
     name = "vsnprintf_test",
     srcs = ["vsnprintf_test.cpp"],
-    libc_function_deps = [
+    deps = [
         "//libc:vsnprintf",
     ],
 )
@@ -108,7 +100,7 @@ libc_test(
 libc_test(
     name = "vprintf_test",
     srcs = ["vprintf_test.cpp"],
-    libc_function_deps = [
+    deps = [
         "//libc:vprintf",
     ],
 )
@@ -116,7 +108,7 @@ libc_test(
 libc_test(
     name = "vfprintf_test",
     srcs = ["vfprintf_test.cpp"],
-    libc_function_deps = [
+    deps = [
         "//libc:vfprintf",
     ],
 )
@@ -124,25 +116,23 @@ libc_test(
 libc_test(
     name = "remove_test",
     srcs = ["remove_test.cpp"],
-    libc_function_deps = [
-        "//libc:remove",
-        "//libc:open",
-        "//libc:mkdirat",
+    deps = [
         "//libc:access",
         "//libc:close",
+        "//libc:mkdirat",
+        "//libc:open",
+        "//libc:remove",
     ],
 )
 
 libc_test(
     name = "sscanf_test",
     srcs = ["sscanf_test.cpp"],
-    libc_function_deps = [
-        "//libc:sscanf",
-    ],
     deps = [
         "//libc:__support_cpp_limits",
         "//libc:__support_fputil_fp_bits",
         "//libc:hdr_stdio_macros",
+        "//libc:sscanf",
         "//libc/test/UnitTest:fp_test_helpers",
     ],
 )
@@ -150,16 +140,16 @@ libc_test(
 libc_test(
     name = "fscanf_test",
     srcs = ["fscanf_test.cpp"],
-    libc_function_deps = [
+    deps = [
+        "//libc:__support_cpp_string_view",
         "//libc:fscanf",
     ],
-    deps = ["//libc:__support_cpp_string_view"],
 )
 
 libc_test(
     name = "vsscanf_test",
     srcs = ["vsscanf_test.cpp"],
-    libc_function_deps = [
+    deps = [
         "//libc:vsscanf",
     ],
 )
@@ -167,8 +157,8 @@ libc_test(
 libc_test(
     name = "vfscanf_test",
     srcs = ["vfscanf_test.cpp"],
-    libc_function_deps = [
+    deps = [
+        "//libc:__support_cpp_string_view",
         "//libc:vfscanf",
     ],
-    deps = ["//libc:__support_cpp_string_view"],
 )
diff --git a/utils/bazel/llvm-project-overlay/libc/test/src/stdlib/BUILD.bazel b/utils/bazel/llvm-project-overlay/libc/test/src/stdlib/BUILD.bazel
index 5f43ec7c7a109..40f672d8099f1 100644
--- a/utils/bazel/llvm-project-overlay/libc/test/src/stdlib/BUILD.bazel
+++ b/utils/bazel/llvm-project-overlay/libc/test/src/stdlib/BUILD.bazel
@@ -13,19 +13,19 @@ licenses(["notice"])
 libc_test(
     name = "abs_test",
     srcs = ["abs_test.cpp"],
-    libc_function_deps = ["//libc:abs"],
+    deps = ["//libc:abs"],
 )
 
 libc_test(
     name = "labs_test",
     srcs = ["labs_test.cpp"],
-    libc_function_deps = ["//libc:labs"],
+    deps = ["//libc:labs"],
 )
 
 libc_test(
     name = "llabs_test",
     srcs = ["llabs_test.cpp"],
-    libc_function_deps = ["//libc:llabs"],
+    deps = ["//libc:llabs"],
 )
 
 libc_test_library(
@@ -37,9 +37,9 @@ libc_test_library(
 libc_test(
     name = "div_test",
     srcs = ["div_test.cpp"],
-    libc_function_deps = ["//libc:div"],
     deps = [
         ":div_test_helper",
+        "//libc:div",
         "//libc:types_div_t",
     ],
 )
@@ -47,9 +47,9 @@ libc_test(
 libc_test(
     name = "ldiv_test",
     srcs = ["ldiv_test.cpp"],
-    libc_function_deps = ["//libc:ldiv"],
     deps = [
         ":div_test_helper",
+        "//libc:ldiv",
         "//libc:types_ldiv_t",
     ],
 )
@@ -57,9 +57,9 @@ libc_test(
 libc_test(
     name = "lldiv_test",
     srcs = ["lldiv_test.cpp"],
-    libc_function_deps = ["//libc:lldiv"],
     deps = [
         ":div_test_helper",
+        "//libc:lldiv",
         "//libc:types_lldiv_t",
     ],
 )
@@ -77,36 +77,46 @@ libc_test_library(
 libc_test(
     name = "atoi_test",
     srcs = ["atoi_test.cpp"],
-    libc_function_deps = ["//libc:atoi"],
-    deps = [":atoi_test_helper"],
+    deps = [
+        ":atoi_test_helper",
+        "//libc:atoi",
+    ],
 )
 
 libc_test(
     name = "atol_test",
     srcs = ["atol_test.cpp"],
-    libc_function_deps = ["//libc:atol"],
-    deps = [":atoi_test_helper"],
+    deps = [
+        ":atoi_test_helper",
+        "//libc:atol",
+    ],
 )
 
 libc_test(
     name = "atoll_test",
     srcs = ["atoll_test.cpp"],
-    libc_function_deps = ["//libc:atoll"],
-    deps = [":atoi_test_helper"],
+    deps = [
+        ":atoi_test_helper",
+        "//libc:atoll",
+    ],
 )
 
 libc_test(
     name = "atof_test",
     srcs = ["atof_test.cpp"],
-    libc_function_deps = ["//libc:atof"],
-    deps = ["//libc:__support_fputil_fp_bits"],
+    deps = [
+        "//libc:__support_fputil_fp_bits",
+        "//libc:atof",
+    ],
 )
 
 libc_test(
     name = "bsearch_test",
     srcs = ["bsearch_test.cpp"],
-    libc_function_deps = ["//libc:bsearch"],
-    deps = ["//libc:types_size_t"],
+    deps = [
+        "//libc:bsearch",
+        "//libc:types_size_t",
+    ],
 )
 
 libc_test_library(
@@ -121,9 +131,9 @@ libc_test_library(
 libc_test(
     name = "quick_sort_test",
     srcs = ["quick_sort_test.cpp"],
-    libc_function_deps = ["//libc:qsort"],
     deps = [
         ":qsort_test_helper",
+        "//libc:qsort",
         "//libc:qsort_util",
         "//libc:types_size_t",
     ],
@@ -132,9 +142,9 @@ libc_test(
 libc_test(
     name = "heap_sort_test",
     srcs = ["heap_sort_test.cpp"],
-    libc_function_deps = ["//libc:qsort"],
     deps = [
         ":qsort_test_helper",
+        "//libc:qsort",
         "//libc:qsort_util",
         "//libc:types_size_t",
     ],
@@ -143,8 +153,10 @@ libc_test(
 libc_test(
     name = "qsort_r_test",
     srcs = ["qsort_r_test.cpp"],
-    libc_function_deps = ["//libc:qsort_r"],
-    deps = ["//libc:types_size_t"],
+    deps = [
+        "//libc:qsort_r",
+        "//libc:types_size_t",
+    ],
 )
 
 libc_test_library(
@@ -160,22 +172,28 @@ libc_test_library(
 libc_test(
     name = "strfromf_test",
     srcs = ["strfromf_test.cpp"],
-    libc_function_deps = ["//libc:strfromf"],
-    deps = [":strfrom_test_helper"],
+    deps = [
+        ":strfrom_test_helper",
+        "//libc:strfromf",
+    ],
 )
 
 libc_test(
     name = "strfromd_test",
     srcs = ["strfromd_test.cpp"],
-    libc_function_deps = ["//libc:strfromd"],
-    deps = [":strfrom_test_helper"],
+    deps = [
+        ":strfrom_test_helper",
+        "//libc:strfromd",
+    ],
 )
 
 libc_test(
     name = "strfroml_test",
     srcs = ["strfroml_test.cpp"],
-    libc_function_deps = ["//libc:strfroml"],
-    deps = [":strfrom_test_helper"],
+    deps = [
+        ":strfrom_test_helper",
+        "//libc:strfroml",
+    ],
 )
 
 libc_test_library(
@@ -194,37 +212,45 @@ libc_test_library(
 libc_test(
     name = "strtol_test",
     srcs = ["strtol_test.cpp"],
-    libc_function_deps = ["//libc:strtol"],
-    deps = [":strtol_test_helper"],
+    deps = [
+        ":strtol_test_helper",
+        "//libc:strtol",
+    ],
 )
 
 libc_test(
     name = "strtoll_test",
     srcs = ["strtoll_test.cpp"],
-    libc_function_deps = ["//libc:strtoll"],
-    deps = [":strtol_test_helper"],
+    deps = [
+        ":strtol_test_helper",
+        "//libc:strtoll",
+    ],
 )
 
 libc_test(
     name = "strtoul_test",
     srcs = ["strtoul_test.cpp"],
-    libc_function_deps = ["//libc:strtoul"],
-    deps = [":strtol_test_helper"],
+    deps = [
+        ":strtol_test_helper",
+        "//libc:strtoul",
+    ],
 )
 
 libc_test(
     name = "strtoull_test",
     srcs = ["strtoull_test.cpp"],
-    libc_function_deps = ["//libc:strtoull"],
-    deps = [":strtol_test_helper"],
+    deps = [
+        ":strtol_test_helper",
+        "//libc:s...
[truncated]

Copy link
Contributor

@michaelrj-google michaelrj-google left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks for the cleanup

@vonosmas
Copy link
Contributor Author

Thank you for the quick review!

@vonosmas vonosmas merged commit 71d0916 into llvm:main Apr 16, 2025
12 checks passed
@vonosmas vonosmas deleted the libc-bazel-test-update branch April 16, 2025 03:12
var-const pushed a commit to ldionne/llvm-project that referenced this pull request Apr 17, 2025
…lvm#135835)

libc_function_deps and deps are now identical, as we no longer need or
have special treatment for libc_function targets. Merge these attributes
passed to the libc_test macro, and fix all relevant libc_test macro
invocations. This change is a no-op.

This concludes cleanup started in
9b13d34.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bazel "Peripheral" support tier build system: utils/bazel libc
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants