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

Michael Jones via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 11 11:07:21 PDT 2025


https://github.com/michaelrj-google created https://github.com/llvm/llvm-project/pull/158127

Adds tests and targets for the remaining inttypes functions.


>From f5b22517df49ba4a0d9552787d0ae8c63c0374e7 Mon Sep 17 00:00:00 2001
From: Michael Jones <michaelrj at google.com>
Date: Thu, 11 Sep 2025 18:05:36 +0000
Subject: [PATCH] [libc][bazel] Add tests and targets for inttypes

Adds tests and targets for the remaining inttypes functions.
---
 .../llvm-project-overlay/libc/BUILD.bazel     | 22 +++++++++++++++++++
 .../libc/test/src/inttypes/BUILD.bazel        | 18 +++++++++++++++
 2 files changed, 40 insertions(+)

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"],



More information about the llvm-commits mailing list