aboutsummaryrefslogtreecommitdiff
path: root/utils
diff options
context:
space:
mode:
authorGuillaume Chatelet <gchatelet@google.com>2023-11-22 16:36:37 +0100
committerGitHub <noreply@github.com>2023-11-22 16:36:37 +0100
commitf12be145ecceaf874fb1430f68fc13118d243833 (patch)
tree9e034babcba1d122dcf8942772ccbfac45e94e82 /utils
parentc4c59192e6e913dcb0c68ad1632efb277d329cc7 (diff)
downloadllvm-f12be145ecceaf874fb1430f68fc13118d243833.zip
llvm-f12be145ecceaf874fb1430f68fc13118d243833.tar.gz
llvm-f12be145ecceaf874fb1430f68fc13118d243833.tar.bz2
[libc][bazel] Enable __support tests (#73125)
Diffstat (limited to 'utils')
-rw-r--r--utils/bazel/llvm-project-overlay/libc/BUILD.bazel25
-rw-r--r--utils/bazel/llvm-project-overlay/libc/test/src/__support/BUILD.bazel90
2 files changed, 115 insertions, 0 deletions
diff --git a/utils/bazel/llvm-project-overlay/libc/BUILD.bazel b/utils/bazel/llvm-project-overlay/libc/BUILD.bazel
index c89c1f7..748bf16 100644
--- a/utils/bazel/llvm-project-overlay/libc/BUILD.bazel
+++ b/utils/bazel/llvm-project-overlay/libc/BUILD.bazel
@@ -339,6 +339,15 @@ libc_support_library(
)
libc_support_library(
+ name = "__support_blockstore",
+ hdrs = ["src/__support/blockstore.h"],
+ deps = [
+ ":__support_cpp_new",
+ ":__support_libc_assert",
+ ],
+)
+
+libc_support_library(
name = "__support_arg_list",
hdrs = ["src/__support/arg_list.h"],
deps = [
@@ -355,6 +364,22 @@ libc_support_library(
)
libc_support_library(
+ name = "__support_fixedvector",
+ hdrs = ["src/__support/fixedvector.h"],
+ deps = [
+ ":__support_cpp_array",
+ ],
+)
+
+libc_support_library(
+ name = "__support_char_vector",
+ hdrs = ["src/__support/char_vector.h"],
+ deps = [
+ ":__support_common",
+ ],
+)
+
+libc_support_library(
name = "__support_error_or",
hdrs = ["src/__support/error_or.h"],
deps = [
diff --git a/utils/bazel/llvm-project-overlay/libc/test/src/__support/BUILD.bazel b/utils/bazel/llvm-project-overlay/libc/test/src/__support/BUILD.bazel
new file mode 100644
index 0000000..b286eb7
--- /dev/null
+++ b/utils/bazel/llvm-project-overlay/libc/test/src/__support/BUILD.bazel
@@ -0,0 +1,90 @@
+# This file is licensed under the Apache License v2.0 with LLVM Exceptions.
+# See https://llvm.org/LICENSE.txt for license information.
+# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+
+# Tests for LLVM libc __support functions.
+
+load("//libc/test:libc_test_rules.bzl", "libc_test")
+
+package(default_visibility = ["//visibility:public"])
+
+licenses(["notice"])
+
+# This test is currently disabled because of an issue in
+# `libc/src/__support/CPP/new.h` which currently fails with
+# "error: cannot apply asm label to function after its first use"
+# libc_test(
+# name = "blockstore_test",
+# srcs = ["blockstore_test.cpp"],
+# deps = ["//libc:__support_blockstore"],
+# )
+
+libc_test(
+ name = "endian_test",
+ srcs = ["endian_test.cpp"],
+ deps = ["//libc:__support_common"],
+)
+
+libc_test(
+ name = "high_precision_decimal_test",
+ srcs = ["high_precision_decimal_test.cpp"],
+ deps = [
+ "//libc:__support_str_to_float",
+ "//libc:__support_uint128",
+ ],
+)
+
+libc_test(
+ name = "str_to_float_test",
+ srcs = ["str_to_float_test.cpp"],
+ deps = [
+ "//libc:__support_fputil_fp_bits",
+ "//libc:__support_str_to_float",
+ "//libc:__support_uint128",
+ ],
+)
+
+libc_test(
+ name = "integer_to_string_test",
+ srcs = ["integer_to_string_test.cpp"],
+ deps = [
+ "//libc:__support_cpp_span",
+ "//libc:__support_cpp_string_view",
+ "//libc:__support_integer_to_string",
+ "//libc:__support_uint",
+ "//libc:__support_uint128",
+ ],
+)
+
+libc_test(
+ name = "arg_list_test",
+ srcs = ["arg_list_test.cpp"],
+ deps = [
+ "//libc:__support_arg_list",
+ ],
+)
+
+libc_test(
+ name = "uint_test",
+ srcs = ["uint_test.cpp"],
+ deps = [
+ "//libc:__support_cpp_optional",
+ "//libc:__support_uint",
+ ],
+)
+
+libc_test(
+ name = "fixedvector_test",
+ srcs = ["fixedvector_test.cpp"],
+ deps = [
+ "//libc:__support_fixedvector",
+ ],
+)
+
+libc_test(
+ name = "char_vector_test",
+ srcs = ["char_vector_test.cpp"],
+ deps = [
+ "//libc:__support_char_vector",
+ ],
+)