[llvm] [libc][bazel] Add tests and targets for inttypes (PR #158127)

via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 11 11:07:56 PDT 2025


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-libc

Author: Michael Jones (michaelrj-google)

<details>
<summary>Changes</summary>

Adds tests and targets for the remaining inttypes functions.


---
Full diff: https://github.com/llvm/llvm-project/pull/158127.diff


2 Files Affected:

- (modified) utils/bazel/llvm-project-overlay/libc/BUILD.bazel (+22) 
- (modified) utils/bazel/llvm-project-overlay/libc/test/src/inttypes/BUILD.bazel (+18) 


``````````diff
diff --git a/utils/bazel/llvm-project-overlay/libc/BUILD.bazel b/utils/bazel/llvm-project-overlay/libc/BUILD.bazel
index 173e5b528237e..eefee5cb9f8a0 100644
--- a/utils/bazel/llvm-project-overlay/libc/BUILD.bazel
+++ b/utils/bazel/llvm-project-overlay/libc/BUILD.bazel
@@ -4608,6 +4608,28 @@ libc_math_function(name = "ufromfpxf16")
 
 ############################## inttypes targets ##############################
 
+libc_function(
+    name = "strtoimax",
+    srcs = ["src/inttypes/strtoimax.cpp"],
+    hdrs = ["src/inttypes/strtoimax.h"],
+    deps = [
+        ":__support_common",
+        ":__support_str_to_integer",
+        ":errno",
+    ],
+)
+
+libc_function(
+    name = "strtoumax",
+    srcs = ["src/inttypes/strtoumax.cpp"],
+    hdrs = ["src/inttypes/strtoumax.h"],
+    deps = [
+        ":__support_common",
+        ":__support_str_to_integer",
+        ":errno",
+    ],
+)
+
 libc_function(
     name = "imaxabs",
     srcs = ["src/inttypes/imaxabs.cpp"],
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 3dd4ab379efe0..03b8cbeecc247 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
@@ -10,6 +10,24 @@ package(default_visibility = ["//visibility:public"])
 
 licenses(["notice"])
 
+libc_test(
+    name = "strtoimax_test",
+    srcs = ["strtoimax_test.cpp"],
+    deps = [
+        "//libc:strtoimax",
+        "//libc/test/src/stdlib:strtol_test_helper",
+    ],
+)
+
+libc_test(
+    name = "strtoumax_test",
+    srcs = ["strtoumax_test.cpp"],
+    deps = [
+        "//libc:strtoumax",
+        "//libc/test/src/stdlib:strtol_test_helper",
+    ],
+)
+
 libc_test(
     name = "imaxabs_test",
     srcs = ["imaxabs_test.cpp"],

``````````

</details>


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


More information about the llvm-commits mailing list