-
Notifications
You must be signed in to change notification settings - Fork 13.6k
[libc][bazel] Add targets for strfrom<float> #128956
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
[libc][bazel] Add targets for strfrom<float> #128956
Conversation
Add targets and tests for strfromf, strfromd and strfroml. No idea why the standard committee decided that the long double function should be "strfroml" instead of "strfromld" which would match "strtold" and leave them space to add string from integer functions in future.
@llvm/pr-subscribers-libc Author: Michael Jones (michaelrj-google) ChangesAdd targets and tests for strfromf, strfromd and strfroml. No idea why the standard committee decided that the long double function Full diff: https://github.com/llvm/llvm-project/pull/128956.diff 2 Files Affected:
diff --git a/utils/bazel/llvm-project-overlay/libc/BUILD.bazel b/utils/bazel/llvm-project-overlay/libc/BUILD.bazel
index c7654ed0b8797..b45145acc2cfe 100644
--- a/utils/bazel/llvm-project-overlay/libc/BUILD.bazel
+++ b/utils/bazel/llvm-project-overlay/libc/BUILD.bazel
@@ -3571,6 +3571,49 @@ libc_function(
],
)
+libc_support_library(
+ name = "str_from_util",
+ hdrs = ["src/stdlib/str_from_util.h"],
+ deps = [
+ ":__support_common",
+ ":__support_cpp_type_traits",
+ ":__support_str_to_integer",
+ ":printf_converter",
+ ":printf_core_structs",
+ ":printf_writer",
+ ],
+)
+
+libc_function(
+ name = "strfromf",
+ srcs = ["src/stdlib/strfromf.cpp"],
+ hdrs = ["src/stdlib/strfromf.h"],
+ deps = [
+ ":__support_common",
+ ":str_from_util",
+ ],
+)
+
+libc_function(
+ name = "strfromd",
+ srcs = ["src/stdlib/strfromd.cpp"],
+ hdrs = ["src/stdlib/strfromd.h"],
+ deps = [
+ ":__support_common",
+ ":str_from_util",
+ ],
+)
+
+libc_function(
+ name = "strfroml",
+ srcs = ["src/stdlib/strfroml.cpp"],
+ hdrs = ["src/stdlib/strfroml.h"],
+ deps = [
+ ":__support_common",
+ ":str_from_util",
+ ],
+)
+
libc_function(
name = "strtol",
srcs = ["src/stdlib/strtol.cpp"],
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 a8b37c5ddcc2c..2566607fc053b 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
@@ -149,6 +149,37 @@ libc_test(
deps = ["//libc:types_size_t"],
)
+libc_support_library(
+ name = "strfrom_test_support",
+ hdrs = ["StrfromTest.h"],
+ deps = [
+ "//libc:__support_cpp_type_traits",
+ "//libc:__support_fputil_fp_bits",
+ "//libc/test/UnitTest:LibcUnitTest",
+ ],
+)
+
+libc_test(
+ name = "strfromf_test",
+ srcs = ["strfromf_test.cpp"],
+ libc_function_deps = ["//libc:strfromf"],
+ deps = [":strfrom_test_support"],
+)
+
+libc_test(
+ name = "strfromd_test",
+ srcs = ["strfromd_test.cpp"],
+ libc_function_deps = ["//libc:strfromd"],
+ deps = [":strfrom_test_support"],
+)
+
+libc_test(
+ name = "strfroml_test",
+ srcs = ["strfroml_test.cpp"],
+ libc_function_deps = ["//libc:strfroml"],
+ deps = [":strfrom_test_support"],
+)
+
libc_support_library(
name = "strtol_test_helper",
hdrs = ["StrtolTest.h"],
|
utils/bazel/llvm-project-overlay/libc/test/src/stdlib/BUILD.bazel
Outdated
Show resolved
Hide resolved
Add targets and tests for strfromf, strfromd and strfroml. No idea why the standard committee decided that the long double function should be "strfroml" instead of "strfromld" which would match "strtold" and leave them space to add string from integer functions in future.
Add targets and tests for strfromf, strfromd and strfroml.
No idea why the standard committee decided that the long double function
should be "strfroml" instead of "strfromld" which would match "strtold"
and leave them space to add string from integer functions in future.