Skip to content

Commit f12be14

Browse files
authored
[libc][bazel] Enable __support tests (#73125)
1 parent c4c5919 commit f12be14

File tree

3 files changed

+116
-1
lines changed

3 files changed

+116
-1
lines changed

libc/src/__support/char_vector.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
#ifndef LLVM_LIBC_SRC___SUPPORT_CHARVECTOR_H
1010
#define LLVM_LIBC_SRC___SUPPORT_CHARVECTOR_H
1111

12-
#include "src/__support/common.h"
12+
#include "src/__support/common.h" // LIBC_INLINE
1313

1414
#include <stddef.h>
1515
#include <stdlib.h> // For allocation.

utils/bazel/llvm-project-overlay/libc/BUILD.bazel

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -338,6 +338,15 @@ libc_support_library(
338338
],
339339
)
340340

341+
libc_support_library(
342+
name = "__support_blockstore",
343+
hdrs = ["src/__support/blockstore.h"],
344+
deps = [
345+
":__support_cpp_new",
346+
":__support_libc_assert",
347+
],
348+
)
349+
341350
libc_support_library(
342351
name = "__support_arg_list",
343352
hdrs = ["src/__support/arg_list.h"],
@@ -354,6 +363,22 @@ libc_support_library(
354363
],
355364
)
356365

366+
libc_support_library(
367+
name = "__support_fixedvector",
368+
hdrs = ["src/__support/fixedvector.h"],
369+
deps = [
370+
":__support_cpp_array",
371+
],
372+
)
373+
374+
libc_support_library(
375+
name = "__support_char_vector",
376+
hdrs = ["src/__support/char_vector.h"],
377+
deps = [
378+
":__support_common",
379+
],
380+
)
381+
357382
libc_support_library(
358383
name = "__support_error_or",
359384
hdrs = ["src/__support/error_or.h"],
Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
# This file is licensed under the Apache License v2.0 with LLVM Exceptions.
2+
# See https://llvm.org/LICENSE.txt for license information.
3+
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
4+
5+
# Tests for LLVM libc __support functions.
6+
7+
load("//libc/test:libc_test_rules.bzl", "libc_test")
8+
9+
package(default_visibility = ["//visibility:public"])
10+
11+
licenses(["notice"])
12+
13+
# This test is currently disabled because of an issue in
14+
# `libc/src/__support/CPP/new.h` which currently fails with
15+
# "error: cannot apply asm label to function after its first use"
16+
# libc_test(
17+
# name = "blockstore_test",
18+
# srcs = ["blockstore_test.cpp"],
19+
# deps = ["//libc:__support_blockstore"],
20+
# )
21+
22+
libc_test(
23+
name = "endian_test",
24+
srcs = ["endian_test.cpp"],
25+
deps = ["//libc:__support_common"],
26+
)
27+
28+
libc_test(
29+
name = "high_precision_decimal_test",
30+
srcs = ["high_precision_decimal_test.cpp"],
31+
deps = [
32+
"//libc:__support_str_to_float",
33+
"//libc:__support_uint128",
34+
],
35+
)
36+
37+
libc_test(
38+
name = "str_to_float_test",
39+
srcs = ["str_to_float_test.cpp"],
40+
deps = [
41+
"//libc:__support_fputil_fp_bits",
42+
"//libc:__support_str_to_float",
43+
"//libc:__support_uint128",
44+
],
45+
)
46+
47+
libc_test(
48+
name = "integer_to_string_test",
49+
srcs = ["integer_to_string_test.cpp"],
50+
deps = [
51+
"//libc:__support_cpp_span",
52+
"//libc:__support_cpp_string_view",
53+
"//libc:__support_integer_to_string",
54+
"//libc:__support_uint",
55+
"//libc:__support_uint128",
56+
],
57+
)
58+
59+
libc_test(
60+
name = "arg_list_test",
61+
srcs = ["arg_list_test.cpp"],
62+
deps = [
63+
"//libc:__support_arg_list",
64+
],
65+
)
66+
67+
libc_test(
68+
name = "uint_test",
69+
srcs = ["uint_test.cpp"],
70+
deps = [
71+
"//libc:__support_cpp_optional",
72+
"//libc:__support_uint",
73+
],
74+
)
75+
76+
libc_test(
77+
name = "fixedvector_test",
78+
srcs = ["fixedvector_test.cpp"],
79+
deps = [
80+
"//libc:__support_fixedvector",
81+
],
82+
)
83+
84+
libc_test(
85+
name = "char_vector_test",
86+
srcs = ["char_vector_test.cpp"],
87+
deps = [
88+
"//libc:__support_char_vector",
89+
],
90+
)

0 commit comments

Comments
 (0)