[libc][bazel] Add targets for Double functions/tests to bazel files
- Dominant language
- LLVM
- Stars
- 40.5k
- Forks
- 18.7k
- PR merge metrics
- PR metrics pending
Description
Part of #221801
## 1. Public Headers & Support Libraries
Check `utils/bazel/llvm-project-overlay/libc/BUILD.bazel` for `double` functions.
The end result should be that every implemented `double` function has both its internal support library (`libc_support_library`) and public entrypoint target (`libc_math_function` / `libc_function`) in the Bazel file.
## 2. Tests
For every `double` function implemented so far:
* Check whether a regular MPFR-based test exists under `libc/test/src/math/`. If it exists, check whether it is added to `utils/bazel/llvm-project-overlay/libc/test/src/math/BUILD.bazel`. If not, add it.
* Check whether a smoke test exists under `libc/test/src/math/smoke/`. If it exists, check whether it is added to `utils/bazel/llvm-project-overlay/libc/test/src/math/smoke/BUILD.bazel`. If not, add it.
This should be done for all `double` math functions implemented so far.
## Additional Guidelines:
- Please split into 3 separate PRs (one for each file to be edited: `libc/BUILD.bazel`, `libc/test/src/math/BUILD.bazel`, and `libc/test/src/math/smoke/BUILD.bazel`).
- Please also cross-reference https://libc.llvm.org/headers/math/index.html to identify which functions have implementations/tests in CMake but are missing from Bazel.
Example case:
- `asinpi`: Implemented in `libc/src/math/asinpi.h` + has smoke test in `libc/test/src/math/smoke/asinpi_test.cpp` + has MPFR test in `libc/test/src/math/asinpi_test.cpp`.
Requires adding entrypoints in `libc/BUILD.bazel`, the MPFR test target in `libc/test/src/math/BUILD.bazel`, and the smoke test target in `libc/test/src/math/smoke/BUILD.bazel`.
(formatted using gemini)
Contributor guide
Research direction
Start by comparing the implemented double functions listed in libc/src/math and the math header index with utils/bazel/llvm-project-overlay/libc/BUILD.bazel. Then check libc/test/src/math/BUILD.bazel and libc/test/src/math/smoke/BUILD.bazel against the existing MPFR and smoke test files, using asinpi as the example. Done means all applicable double entrypoints and tests are represented, with changes split into the three requested PRs.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- build-system, testing-qa
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100