Skip to content

Commit 7a8e9df

Browse files
authored
[bazel][libc][NFC] Add missing layering deps (#107947)
After 2773719 e.g. ``` external/llvm-project/libc/test/src/math/smoke/NextTowardTest.h:12:10: error: module llvm-project//libc/test/src/math/smoke:nexttowardf_test does not depend on a module exporting 'src/__support/CPP/bit.h' ```
1 parent 1ca411c commit 7a8e9df

File tree

3 files changed

+37
-13
lines changed

3 files changed

+37
-13
lines changed

utils/bazel/llvm-project-overlay/libc/test/src/math/BUILD.bazel

Lines changed: 30 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
# Tests for LLVM libc math.h functions.
66

7-
load("//libc:libc_build_rules.bzl", "libc_support_library")
87
load("//libc/test/src/math:libc_math_test_rules.bzl", "math_mpfr_test")
98

109
package(default_visibility = ["//visibility:public"])
@@ -53,6 +52,9 @@ math_mpfr_test(name = "cos")
5352
math_mpfr_test(
5453
name = "cosf",
5554
hdrs = ["sdcomp26094.h"],
55+
deps = [
56+
"//libc:__support_cpp_array",
57+
],
5658
)
5759

5860
math_mpfr_test(
@@ -65,6 +67,9 @@ math_mpfr_test(
6567
math_mpfr_test(
6668
name = "cospif",
6769
hdrs = ["sdcomp26094.h"],
70+
deps = [
71+
"//libc:__support_cpp_array",
72+
],
6873
)
6974

7075
math_mpfr_test(
@@ -107,7 +112,7 @@ math_mpfr_test(
107112
name = "exp2m1f",
108113
deps = [
109114
"//libc:__support_cpp_array",
110-
]
115+
],
111116
)
112117

113118
math_mpfr_test(name = "expm1")
@@ -211,8 +216,8 @@ math_mpfr_test(
211216
math_mpfr_test(
212217
name = "hypotf",
213218
hdrs = [
214-
"hypotf_hard_to_round.h",
215219
"HypotTest.h",
220+
"hypotf_hard_to_round.h",
216221
],
217222
)
218223

@@ -297,16 +302,25 @@ math_mpfr_test(
297302
math_mpfr_test(
298303
name = "nearbyint",
299304
hdrs = ["NearbyIntTest.h"],
305+
deps = [
306+
"//libc:__support_cpp_array",
307+
],
300308
)
301309

302310
math_mpfr_test(
303311
name = "nearbyintf",
304312
hdrs = ["NearbyIntTest.h"],
313+
deps = [
314+
"//libc:__support_cpp_array",
315+
],
305316
)
306317

307318
math_mpfr_test(
308319
name = "nearbyintl",
309320
hdrs = ["NearbyIntTest.h"],
321+
deps = [
322+
"//libc:__support_cpp_array",
323+
],
310324
)
311325

312326
math_mpfr_test(name = "pow")
@@ -378,25 +392,34 @@ math_mpfr_test(name = "sin")
378392
math_mpfr_test(
379393
name = "sinf",
380394
hdrs = ["sdcomp26094.h"],
395+
deps = [
396+
"//libc:__support_cpp_array",
397+
],
381398
)
382399

383400
math_mpfr_test(name = "sincos")
384401

385402
math_mpfr_test(
386403
name = "sincosf",
387404
hdrs = ["sdcomp26094.h"],
405+
deps = [
406+
"//libc:__support_cpp_array",
407+
],
388408
)
389409

390410
math_mpfr_test(
391411
name = "sinhf",
392412
deps = [
393413
"//libc:__support_cpp_array",
394-
]
414+
],
395415
)
396416

397417
math_mpfr_test(
398418
name = "sinpif",
399419
hdrs = ["sdcomp26094.h"],
420+
deps = [
421+
"//libc:__support_cpp_array",
422+
],
400423
)
401424

402425
math_mpfr_test(
@@ -419,6 +442,9 @@ math_mpfr_test(name = "tan")
419442
math_mpfr_test(
420443
name = "tanf",
421444
hdrs = ["sdcomp26094.h"],
445+
deps = [
446+
"//libc:__support_cpp_array",
447+
],
422448
)
423449

424450
math_mpfr_test(name = "tanhf")

utils/bazel/llvm-project-overlay/libc/test/src/math/libc_math_test_rules.bzl

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,9 @@ def math_test(name, hdrs = [], deps = [], **kwargs):
2525
srcs = [test_name + ".cpp"] + hdrs,
2626
libc_function_deps = ["//libc:func_name".replace("func_name", name)],
2727
deps = [
28-
"//libc/test/UnitTest:fp_test_helpers",
2928
"//libc:__support_cpp_algorithm",
29+
"//libc:__support_cpp_bit",
30+
"//libc:__support_cpp_limits",
3031
"//libc:__support_fputil_basic_operations",
3132
"//libc:__support_fputil_fenv_impl",
3233
"//libc:__support_fputil_fp_bits",
@@ -36,7 +37,10 @@ def math_test(name, hdrs = [], deps = [], **kwargs):
3637
"//libc:__support_macros_properties_architectures",
3738
"//libc:__support_math_extras",
3839
"//libc:__support_uint128",
40+
"//libc:hdr_errno_macros",
41+
"//libc:hdr_fenv_macros",
3942
"//libc:hdr_math_macros",
43+
"//libc/test/UnitTest:fp_test_helpers",
4044
] + deps,
4145
**kwargs
4246
)

utils/bazel/llvm-project-overlay/libc/test/src/math/smoke/BUILD.bazel

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
# Smoke tests for LLVM libc math.h functions.
66

7-
load("//libc:libc_build_rules.bzl", "libc_support_library")
87
load("//libc/test/src/math:libc_math_test_rules.bzl", "math_test")
98

109
package(default_visibility = ["//visibility:public"])
@@ -951,12 +950,7 @@ math_test(
951950
hdrs = ["NextUpTest.h"],
952951
)
953952

954-
math_test(
955-
name = "pow",
956-
deps = [
957-
"//libc:hdr_fenv_macros",
958-
],
959-
)
953+
math_test(name = "pow")
960954

961955
math_test(name = "powf")
962956

@@ -1156,7 +1150,7 @@ math_test(
11561150
name = "sinhf",
11571151
deps = [
11581152
"//libc:__support_cpp_array",
1159-
]
1153+
],
11601154
)
11611155

11621156
math_test(name = "sinpif")

0 commit comments

Comments
 (0)