Skip to content
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] fix fenv tests after refactor #89839

Closed

Conversation

michaelrj-google
Copy link
Contributor

The PR #89658 updated up the fenv tests work, this patch updates the
bazel to match.

The PR llvm#89658 updated up the fenv tests work, this patch updates the
bazel to match.
@llvmbot llvmbot added libc bazel "Peripheral" support tier build system: utils/bazel labels Apr 23, 2024
@llvmbot
Copy link
Collaborator

llvmbot commented Apr 23, 2024

@llvm/pr-subscribers-libc

Author: Michael Jones (michaelrj-google)

Changes

The PR #89658 updated up the fenv tests work, this patch updates the
bazel to match.


Full diff: https://github.com/llvm/llvm-project/pull/89839.diff

2 Files Affected:

  • (modified) utils/bazel/llvm-project-overlay/libc/test/UnitTest/BUILD.bazel (+4-2)
  • (modified) utils/bazel/llvm-project-overlay/libc/test/src/fenv/BUILD.bazel (+36-9)
diff --git a/utils/bazel/llvm-project-overlay/libc/test/UnitTest/BUILD.bazel b/utils/bazel/llvm-project-overlay/libc/test/UnitTest/BUILD.bazel
index 1dff8a8c51b74d..ee90516949f62a 100644
--- a/utils/bazel/llvm-project-overlay/libc/test/UnitTest/BUILD.bazel
+++ b/utils/bazel/llvm-project-overlay/libc/test/UnitTest/BUILD.bazel
@@ -84,13 +84,15 @@ libc_support_library(
         "//libc:__support_cpp_bitset",
         "//libc:__support_cpp_span",
         "//libc:__support_cpp_type_traits",
+        "//libc:__support_cpp_utility",
         "//libc:__support_fputil_fenv_impl",
         "//libc:__support_fputil_fp_bits",
         "//libc:__support_fputil_fpbits_str",
         "//libc:__support_fputil_rounding_mode",
+        "//libc:__support_macros_properties_architectures",
+        "//libc:hdr_fenv_macros",
         "//libc:hdr_math_macros",
-	    "//libc:hdr_fenv_macros",
-	    "//libc:types_fenv_t",
+        "//libc:types_fenv_t",
     ],
 )
 
diff --git a/utils/bazel/llvm-project-overlay/libc/test/src/fenv/BUILD.bazel b/utils/bazel/llvm-project-overlay/libc/test/src/fenv/BUILD.bazel
index fc3ab3da3587c5..2db71af1b31783 100644
--- a/utils/bazel/llvm-project-overlay/libc/test/src/fenv/BUILD.bazel
+++ b/utils/bazel/llvm-project-overlay/libc/test/src/fenv/BUILD.bazel
@@ -4,12 +4,21 @@
 
 # Tests for LLVM libc math.h functions.
 
+load("//libc:libc_build_rules.bzl", "libc_support_library")
 load("//libc/test:libc_test_rules.bzl", "libc_test")
 
 package(default_visibility = ["//visibility:public"])
 
 licenses(["notice"])
 
+libc_support_library(
+    name = "excepts",
+    hdrs = ["excepts.h"],
+    deps = [
+        "//libc:hdr_fenv_macros",
+    ],
+)
+
 libc_test(
     name = "exception_status_test",
     srcs = ["exception_status_test.cpp"],
@@ -20,8 +29,10 @@ libc_test(
         "//libc:fetestexcept",
     ],
     deps = [
+        ":excepts",
         "//libc:__support_fputil_fenv_impl",
-	"//libc:hdr_fenv_macros",
+        "//libc:hdr_fenv_macros",
+        "//libc/test/UnitTest:fp_test_helpers",
     ],
 )
 
@@ -32,7 +43,11 @@ libc_test(
         "//libc:fegetround",
         "//libc:fesetround",
     ],
-    deps = ["//libc:hdr_fenv_macros"],
+    deps = [
+        ":excepts",
+        "//libc:hdr_fenv_macros",
+        "//libc/test/UnitTest:fp_test_helpers",
+    ],
 )
 
 libc_test(
@@ -45,11 +60,12 @@ libc_test(
     ],
     tags = ["nosan"],
     deps = [
+        ":excepts",
         "//libc:__support_common",
         "//libc:__support_fputil_fenv_impl",
         "//libc:__support_macros_properties_architectures",
+        "//libc:hdr_fenv_macros",
         "//libc/test/UnitTest:fp_test_helpers",
-	"//libc:hdr_fenv_macros",
     ],
 )
 
@@ -61,11 +77,12 @@ libc_test(
     ],
     tags = ["nosan"],
     deps = [
+        ":excepts",
         "//libc:__support_common",
         "//libc:__support_fputil_fenv_impl",
         "//libc:__support_macros_properties_architectures",
+        "//libc:types_fenv_t",
         "//libc/test/UnitTest:fp_test_helpers",
-	"//libc:types_fenv_t",
     ],
 )
 
@@ -78,8 +95,10 @@ libc_test(
         "//libc:fetestexceptflag",
     ],
     deps = [
+        ":excepts",
         "//libc:__support_fputil_fenv_impl",
-	"//libc:types_fexcept_t",
+        "//libc:types_fexcept_t",
+        "//libc/test/UnitTest:fp_test_helpers",
     ],
 )
 
@@ -90,8 +109,10 @@ libc_test(
         "//libc:feclearexcept",
     ],
     deps = [
+        ":excepts",
         "//libc:__support_fputil_fenv_impl",
-	"//libc:hdr_fenv_macros",
+        "//libc:hdr_fenv_macros",
+        "//libc/test/UnitTest:fp_test_helpers",
     ],
 )
 
@@ -104,9 +125,11 @@ libc_test(
         "//libc:fegetexcept",
     ],
     deps = [
+        ":excepts",
         "//libc:__support_common",
         "//libc:__support_macros_properties_architectures",
-	"//libc:hdr_fenv_macros",
+        "//libc:hdr_fenv_macros",
+        "//libc/test/UnitTest:fp_test_helpers",
     ],
 )
 
@@ -117,8 +140,10 @@ libc_test(
         "//libc:feupdateenv",
     ],
     deps = [
+        ":excepts",
         "//libc:__support_fputil_fenv_impl",
-	"//libc:types_fenv_t",
+        "//libc:types_fenv_t",
+        "//libc/test/UnitTest:fp_test_helpers",
     ],
 )
 
@@ -132,7 +157,9 @@ libc_test(
         "//libc:fesetround",
     ],
     deps = [
+        ":excepts",
         "//libc:__support_fputil_fenv_impl",
-	"//libc:types_fenv_t",
+        "//libc:types_fenv_t",
+        "//libc/test/UnitTest:fp_test_helpers",
     ],
 )

@pranavk
Copy link
Contributor

pranavk commented Apr 23, 2024

Oops. I am sorry. I didn't know about this PR and pushed a fix for Bazel breakage to main already (688c10d)

@michaelrj-google
Copy link
Contributor Author

ah, I'll close this patch then. In future could you send those sorts of libc bazel fixes as PRs?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bazel "Peripheral" support tier build system: utils/bazel libc
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants