llvm / llvm/llvm-project

[libc][bazel] Add targets for long double functions/tests to bazel files

Open
#223,717 7 comments 0 reactions 0 assignees View on GitHub
bazel good first issue libc
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 `long double` functions.
The end result should be that every implemented `long 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 `long 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 `long 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:
- `atan2l`: Implemented in `libc/src/math/atan2l.h` + has smoke test in `libc/test/src/math/smoke/atan2l_test.cpp` + has no MPFR test in `libc/test/src/math/`.
Requires adding entrypoints in `libc/BUILD.bazel` and the smoke test target in `libc/test/src/math/smoke/BUILD.bazel`.
( formatted using gemini)

Contributor guide

Open the contributing guide

Research direction

Start with utils/bazel/llvm-project-overlay/libc/BUILD.bazel and compare its long double coverage with the math header index and CMake implementations. Then inspect libc/test/src/math/BUILD.bazel and libc/test/src/math/smoke/BUILD.bazel alongside the existing tests. Done means three separate PRs add every implemented long double function's required entrypoint, support-library, and existing test targets.

Written by the indexing model from the issue text.

Assessment

Tech stack
cmake, cpp
Domain
build-system, testing
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.