aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsribee8 <sriya.pratipati@gmail.com>2025-07-14 16:43:05 +0000
committerGitHub <noreply@github.com>2025-07-14 16:43:05 +0000
commit666ce63483c5f6b7df5833de855f8800ad2b0108 (patch)
tree29eb2fe26dd271c8e3037b56fed3c088d09f2dd8
parent4775b9689844e1ec7b425e039aff4fcbb758b4d4 (diff)
downloadllvm-revert-148086-exp-fuzz-tests.zip
llvm-revert-148086-exp-fuzz-tests.tar.gz
llvm-revert-148086-exp-fuzz-tests.tar.bz2
Revert "[libc] exp fuzz tests (#148086)"revert-148086-exp-fuzz-tests
This reverts commit 1f97c9432d010c7c5eefc5ebe2648af2d9d5863d.
-rw-r--r--libc/fuzzing/math/CMakeLists.txt36
-rw-r--r--libc/fuzzing/math/exp10_fuzz.cpp38
-rw-r--r--libc/fuzzing/math/exp2_fuzz.cpp38
-rw-r--r--libc/fuzzing/math/exp_fuzz.cpp38
-rw-r--r--libc/fuzzing/math/expm1_fuzz.cpp38
5 files changed, 0 insertions, 188 deletions
diff --git a/libc/fuzzing/math/CMakeLists.txt b/libc/fuzzing/math/CMakeLists.txt
index bf2be5c..e3c2965 100644
--- a/libc/fuzzing/math/CMakeLists.txt
+++ b/libc/fuzzing/math/CMakeLists.txt
@@ -63,42 +63,6 @@ add_libc_fuzzer(
)
add_libc_fuzzer(
- exp_fuzz
- NEED_MPFR
- SRCS
- exp_fuzz.cpp
- DEPENDS
- libc.src.math.exp
-)
-
-add_libc_fuzzer(
- exp10_fuzz
- NEED_MPFR
- SRCS
- exp10_fuzz.cpp
- DEPENDS
- libc.src.math.exp10
-)
-
-add_libc_fuzzer(
- exp2_fuzz
- NEED_MPFR
- SRCS
- exp2_fuzz.cpp
- DEPENDS
- libc.src.math.exp2
-)
-
-add_libc_fuzzer(
- expm1_fuzz
- NEED_MPFR
- SRCS
- expm1_fuzz.cpp
- DEPENDS
- libc.src.math.expm1
-)
-
-add_libc_fuzzer(
asin_fuzz
NEED_MPFR
SRCS
diff --git a/libc/fuzzing/math/exp10_fuzz.cpp b/libc/fuzzing/math/exp10_fuzz.cpp
deleted file mode 100644
index 2baef03..0000000
--- a/libc/fuzzing/math/exp10_fuzz.cpp
+++ /dev/null
@@ -1,38 +0,0 @@
-//===-- exp10_fuzz.cpp ----------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-///
-/// Fuzzing test for llvm-libc exp10 implementation.
-///
-//===----------------------------------------------------------------------===//
-
-#include "src/math/exp10.h"
-#include "utils/MPFRWrapper/mpfr_inc.h"
-#include <math.h>
-
-extern "C" int LLVMFuzzerTestOneInput(double x) {
- // remove NaN and inf
- if (isnan(x) || isinf(x))
- return 0;
- // signed zeros already tested in unit tests
- if (signbit(x) && x == 0.0)
- return 0;
- mpfr_t input;
- mpfr_init2(input, 53);
- mpfr_set_d(input, x, MPFR_RNDN);
- int output = mpfr_exp10(input, input, MPFR_RNDN);
- mpfr_subnormalize(input, output, MPFR_RNDN);
- double to_compare = mpfr_get_d(input, MPFR_RNDN);
-
- double result = LIBC_NAMESPACE::exp10(x);
-
- if (result != to_compare)
- __builtin_trap();
-
- mpfr_clear(input);
- return 0;
-}
diff --git a/libc/fuzzing/math/exp2_fuzz.cpp b/libc/fuzzing/math/exp2_fuzz.cpp
deleted file mode 100644
index 8a29590..0000000
--- a/libc/fuzzing/math/exp2_fuzz.cpp
+++ /dev/null
@@ -1,38 +0,0 @@
-//===-- exp2_fuzz.cpp -----------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-///
-/// Fuzzing test for llvm-libc exp2 implementation.
-///
-//===----------------------------------------------------------------------===//
-
-#include "src/math/exp2.h"
-#include "utils/MPFRWrapper/mpfr_inc.h"
-#include <math.h>
-
-extern "C" int LLVMFuzzerTestOneInput(double x) {
- // remove NaN and inf
- if (isnan(x) || isinf(x))
- return 0;
- // signed zeros already tested in unit tests
- if (signbit(x) && x == 0.0)
- return 0;
- mpfr_t input;
- mpfr_init2(input, 53);
- mpfr_set_d(input, x, MPFR_RNDN);
- int output = mpfr_exp2(input, input, MPFR_RNDN);
- mpfr_subnormalize(input, output, MPFR_RNDN);
- double to_compare = mpfr_get_d(input, MPFR_RNDN);
-
- double result = LIBC_NAMESPACE::exp2(x);
-
- if (result != to_compare)
- __builtin_trap();
-
- mpfr_clear(input);
- return 0;
-}
diff --git a/libc/fuzzing/math/exp_fuzz.cpp b/libc/fuzzing/math/exp_fuzz.cpp
deleted file mode 100644
index 97bc12d..0000000
--- a/libc/fuzzing/math/exp_fuzz.cpp
+++ /dev/null
@@ -1,38 +0,0 @@
-//===-- exp_fuzz.cpp ------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-///
-/// Fuzzing test for llvm-libc exp implementation.
-///
-//===----------------------------------------------------------------------===//
-
-#include "src/math/exp.h"
-#include "utils/MPFRWrapper/mpfr_inc.h"
-#include <math.h>
-
-extern "C" int LLVMFuzzerTestOneInput(double x) {
- // remove NaN and inf
- if (isnan(x) || isinf(x))
- return 0;
- // signed zeros already tested in unit tests
- if (signbit(x) && x == 0.0)
- return 0;
- mpfr_t input;
- mpfr_init2(input, 53);
- mpfr_set_d(input, x, MPFR_RNDN);
- int output = mpfr_exp(input, input, MPFR_RNDN);
- mpfr_subnormalize(input, output, MPFR_RNDN);
- double to_compare = mpfr_get_d(input, MPFR_RNDN);
-
- double result = LIBC_NAMESPACE::exp(x);
-
- if (result != to_compare)
- __builtin_trap();
-
- mpfr_clear(input);
- return 0;
-}
diff --git a/libc/fuzzing/math/expm1_fuzz.cpp b/libc/fuzzing/math/expm1_fuzz.cpp
deleted file mode 100644
index db507bb..0000000
--- a/libc/fuzzing/math/expm1_fuzz.cpp
+++ /dev/null
@@ -1,38 +0,0 @@
-//===-- expm1_fuzz.cpp ----------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-///
-/// Fuzzing test for llvm-libc expm1 implementation.
-///
-//===----------------------------------------------------------------------===//
-
-#include "src/math/expm1.h"
-#include "utils/MPFRWrapper/mpfr_inc.h"
-#include <math.h>
-
-extern "C" int LLVMFuzzerTestOneInput(double x) {
- // remove NaN and inf
- if (isnan(x) || isinf(x))
- return 0;
- // signed zeros already tested in unit tests
- if (signbit(x) && x == 0.0)
- return 0;
- mpfr_t input;
- mpfr_init2(input, 53);
- mpfr_set_d(input, x, MPFR_RNDN);
- int output = mpfr_expm1(input, input, MPFR_RNDN);
- mpfr_subnormalize(input, output, MPFR_RNDN);
- double to_compare = mpfr_get_d(input, MPFR_RNDN);
-
- double result = LIBC_NAMESPACE::expm1(x);
-
- if (result != to_compare)
- __builtin_trap();
-
- mpfr_clear(input);
- return 0;
-}