summaryrefslogtreecommitdiff
path: root/libc/fuzzing/math
AgeCommit message (Collapse)Author
2025-07-25[libc] Fuzz tests for fsqrt, f16sqrt, and hypot (#150489)sribee8
Added fuzz tests for f16sqrt, fsqrt, and hypot --------- Co-authored-by: Sriya Pratipati <sriyap@google.com>
2025-07-22[libc] cbrt fuzz test (#150063)sribee8
Implemented fuzz test for cbrt Co-authored-by: Sriya Pratipati <sriyap@google.com>
2025-07-16[libc] Updated exp fuzz tests (#148912)sribee8
Fuzz tests were previously in the wrong format, updated them to correct format. --------- Co-authored-by: Sriya Pratipati <sriyap@google.com>
2025-07-16[libc] Updated fuzz tests for trig functions (#148891)sribee8
Fuzz tests were set up incorrectly so updated trig functions to match the correct format. --------- Co-authored-by: Sriya Pratipati <sriyap@google.com>
2025-07-15[libc] sqrt and log functions fuzz tests (#148006)sribee8
added fuzz tests for sqrt and log functions --------- Co-authored-by: Sriya Pratipati <sriyap@google.com>
2025-07-14[libc] exp fuzz tests (#148086)sribee8
Created fuzz tests for exp functions --------- Co-authored-by: Sriya Pratipati <sriyap@google.com>
2025-07-10[libc] asin fuzz testing (#147786)sribee8
Added fuzz test for asin --------- Co-authored-by: Sriya Pratipati <sriyap@google.com>
2025-07-10[libc] Fuzz tests for acos and atan (#147843)sribee8
created fuzz tests for acos and atan --------- Co-authored-by: Sriya Pratipati <sriyap@google.com>
2025-07-10[libc] sincos fuzz test (#147855)sribee8
Created fuzz test for sincos --------- Co-authored-by: Sriya Pratipati <sriyap@google.com>
2024-11-21[libc] Fix wrong name in Compare.h (#117223)Chuvak
Fix for some mistakes in source code found using PVS Studio. Inspired by: https://pvs-studio.com/en/blog/posts/cpp/1188/ Fixed: - [Bug 5](https://pvs-studio.com/en/blog/posts/cpp/1188/#IDF23EA2CEAB)
2024-08-07[libc] math fuzzing MPFR include statement (#102358)RoseZhang03
Updated the include statement for MPFR
2024-08-01[libc] created tan function fuzzer (#101570)RoseZhang03
Also edited file header formatting on sin_fuz and cos_fuzz
2024-08-01[libc] added cos function fuzzing test (#101556)RoseZhang03
2024-08-01[libc] Fix math fuzzers (#101529)Michael Jones
Fix minor typos that accumulated while the math fuzzers were disabled.
2024-08-01[libc] created fuzz test for sin function (#101411)RoseZhang03
Verifies that sin function output is correct by comparing with MPFR output. NaN and inf are not tested (as our output will vary compared to MPFR), and signed zeroes are already tested in unit tests.
2024-07-28[libc] Fix the remaining isnan and isinf in tests. (#100969)lntue
Fixes https://github.com/llvm/llvm-project/issues/100964
2024-04-05[libc] Add proxy header math_macros.h. (#87598)lntue
Context: https://github.com/llvm/llvm-project/pull/87017 - Add proxy header `libc/hdr/math_macros.h` that will: - include `<math.h>` in overlay mode, - include `"include/llvm-libc-macros/math-macros.h"` in full build mode. - Its corresponding CMake target `libc.hdr.math_macros` will only depend on `libc.include.math` and `libc.include.llvm-libc-macros.math_macros` in full build mode. - Replace all `#include "include/llvm-libc-macros/math-macros.h"` with `#include "hdr/math_macros.h"`. - Add dependency to `libc.hdr.math_macros` CMake target when using `add_fp_unittest`. - Update the remaining dependency. - Update bazel overlay: add `libc:hdr_math_macros` target, and replacing all dependency on `libc:llvm_libc_macros_math_macros` with `libc:hdr_math_macros`.
2024-03-18[libc] Remove direct math.h includes (#85324)Michael Jones
Reland of #84991 A downstream overlay mode user ran into issues with the isnan macro not working in our sources with a specific libc configuration. This patch replaces the last direct includes of math.h with our internal math_macros.h, along with the necessary build system changes.
2023-09-26[libc] Mass replace enclosing namespace (#67032)Guillaume Chatelet
This is step 4 of https://discourse.llvm.org/t/rfc-customizable-namespace-to-allow-testing-the-libc-when-the-system-libc-is-also-llvms-libc/73079
2022-12-20[libc] add fuzz target for strtointeger functionsMichael Jones
The string to integer conversion functions are well suited to differential fuzzing, and this patch adds a target to enable just that. It also fixes a bug in the fuzzing comparison logic and changes atoi slightly to match the behavior described in the C standard. Reviewed By: sivachandra, lntue Differential Revision: https://reviews.llvm.org/D140178
2022-08-31[libc][cmake] split fputil into individual targetsMichael Jones
The libc.src.__support.FPUtil.fputil target encompassed many unrelated files, and provided a lot of hidden dependencies. This patch splits out all of these files into component parts and cleans up the cmake files that used them. It does not touch any source files for simplicity, but there may be changes made to them in future patches. Reviewed By: lntue Differential Revision: https://reviews.llvm.org/D132980
2022-07-29[libc][NFC] Use STL case for type_traitsGuillaume Chatelet
Migrating all private STL code to the standard STL case but keeping it under the CPP namespace to avoid confusion. Starting with the type_traits header. Differential Revision: https://reviews.llvm.org/D130727
2022-03-08[libc][NFC] split standalone_cpp into single headersMichael Jones
Previously, the entire support/CPP folder was in one header library, which meant that a lot of headers were included where they shouldn't be. This patch splits each header into its own target, as well as adjusting each place they were included to only include what is used. Reviewed By: sivachandra, lntue Differential Revision: https://reviews.llvm.org/D121237
2021-12-07[libc] apply new lint rulesMichael Jones
This patch applies the lint rules described in the previous patch. There was also a significant amount of effort put into manually fixing things, since all of the templated functions, or structs defined in /spec, were not updated and had to be handled manually. Reviewed By: sivachandra, lntue Differential Revision: https://reviews.llvm.org/D114302
2021-11-19[libc][Obvious][NFC] A bunch of cosmetic cleanup.Siva Chandra Reddy
* Added missing header guards. * Fixed license header format in a few files. * Renamed files to more suitable names.
2021-10-28[libc][NFC] Move utils/CPP to src/__support/CPP.Siva Chandra Reddy
The idea is to move all pieces related to the actual libc sources to the "src" directory. This allows downstream users to ship and build just the "src" directory. Reviewed By: michaelrj Differential Revision: https://reviews.llvm.org/D112653
2021-08-06[libc][nfc] move ctype_utils and FPUtils to __supportMichael Jones
Some ctype functions are called from other libc functions (e.g. isspace is used in atoi). By moving ctype_utils.h to __support it becomes easier to include just the implementations of these functions. For these reasons the implementation for isspace was moved into ctype_utils as well. FPUtils was moved to simplify the build order, and to clarify which files are a part of the actual libc. Many files were modified to accomodate these changes, mostly changing the #include paths. Reviewed By: sivachandra Differential Revision: https://reviews.llvm.org/D107600
2021-04-13[libc] Make FPBits a union.Siva Chandra Reddy
This helps us avoid the uncomfortable reinterpret-casts. Avoiding the reinterpret casts prevents us from tripping the sanitizers as well. Reviewed By: lntue Differential Revision: https://reviews.llvm.org/D100360
2021-01-05[libc] Add implementations of nextafter[f|l] functions.Siva Chandra Reddy
A differential fuzzer for these functions has also been added. Along the way, a small correction has been done to the normal/subnormal limits of x86 long double values. Reviewed By: lntue Differential Revision: https://reviews.llvm.org/D94109
2020-11-20[libc] Combine all math differential fuzzers into one target.Siva Chandra Reddy
Also added diffing of a few more math functions. Combining the diff check for all of these functions helps us meet the OSS fuzz bar of a minimum of 100 program edges. Reviewed By: lntue Differential Revision: https://reviews.llvm.org/D91817
2020-11-19[libc] Add differential fuzzers for ldexp and remquo.Siva Chandra Reddy
Reviewed By: lntue Differential Revision: https://reviews.llvm.org/D91763