1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152
|
//===-- ldexp_differential_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
//
//===----------------------------------------------------------------------===//
///
/// Differential fuzz test for llvm-libc ldexp implementation.
///
//===----------------------------------------------------------------------===//
#include "fuzzing/math/RemQuoDiff.h"
#include "fuzzing/math/SingleInputSingleOutputDiff.h"
#include "fuzzing/math/TwoInputSingleOutputDiff.h"
#include "src/math/ceil.h"
#include "src/math/ceilf.h"
#include "src/math/ceill.h"
#include "src/math/fdim.h"
#include "src/math/fdimf.h"
#include "src/math/fdiml.h"
#include "src/math/floor.h"
#include "src/math/floorf.h"
#include "src/math/floorl.h"
#include "src/math/frexp.h"
#include "src/math/frexpf.h"
#include "src/math/frexpl.h"
#include "src/math/hypotf.h"
#include "src/math/ldexp.h"
#include "src/math/ldexpf.h"
#include "src/math/ldexpl.h"
#include "src/math/logb.h"
#include "src/math/logbf.h"
#include "src/math/logbl.h"
#include "src/math/modf.h"
#include "src/math/modff.h"
#include "src/math/modfl.h"
#include "src/math/remainder.h"
#include "src/math/remainderf.h"
#include "src/math/remainderl.h"
#include "src/math/remquo.h"
#include "src/math/remquof.h"
#include "src/math/remquol.h"
#include "src/math/round.h"
#include "src/math/roundf.h"
#include "src/math/roundl.h"
#include "src/math/sqrt.h"
#include "src/math/sqrtf.h"
#include "src/math/sqrtl.h"
#include "src/math/trunc.h"
#include "src/math/truncf.h"
#include "src/math/truncl.h"
#include <math.h>
#include <stddef.h>
#include <stdint.h>
extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
SingleInputSingleOutputDiff<float>(&__llvm_libc::ceilf, &::ceilf, data, size);
SingleInputSingleOutputDiff<double>(&__llvm_libc::ceil, &::ceil, data, size);
SingleInputSingleOutputDiff<long double>(&__llvm_libc::ceill, &::ceill, data,
size);
SingleInputSingleOutputDiff<float>(&__llvm_libc::floorf, &::floorf, data,
size);
SingleInputSingleOutputDiff<double>(&__llvm_libc::floor, &::floor, data,
size);
SingleInputSingleOutputDiff<long double>(&__llvm_libc::floorl, &::floorl,
data, size);
SingleInputSingleOutputDiff<float>(&__llvm_libc::roundf, &::roundf, data,
size);
SingleInputSingleOutputDiff<double>(&__llvm_libc::round, &::round, data,
size);
SingleInputSingleOutputDiff<long double>(&__llvm_libc::roundl, &::roundl,
data, size);
SingleInputSingleOutputDiff<float>(&__llvm_libc::truncf, &::truncf, data,
size);
SingleInputSingleOutputDiff<double>(&__llvm_libc::trunc, &::trunc, data,
size);
SingleInputSingleOutputDiff<long double>(&__llvm_libc::truncl, &::truncl,
data, size);
SingleInputSingleOutputDiff<float>(&__llvm_libc::logbf, &::logbf, data, size);
SingleInputSingleOutputDiff<double>(&__llvm_libc::logb, &::logb, data, size);
SingleInputSingleOutputDiff<long double>(&__llvm_libc::logbl, &::logbl, data,
size);
TwoInputSingleOutputDiff<float, float>(&__llvm_libc::hypotf, &::hypotf, data,
size);
TwoInputSingleOutputDiff<float, float>(&__llvm_libc::remainderf,
&::remainderf, data, size);
TwoInputSingleOutputDiff<double, double>(&__llvm_libc::remainder,
&::remainder, data, size);
TwoInputSingleOutputDiff<long double, long double>(&__llvm_libc::remainderl,
&::remainderl, data, size);
TwoInputSingleOutputDiff<float, float>(&__llvm_libc::fdimf, &::fdimf, data,
size);
TwoInputSingleOutputDiff<double, double>(&__llvm_libc::fdim, &::fdim, data,
size);
TwoInputSingleOutputDiff<long double, long double>(&__llvm_libc::fdiml,
&::fdiml, data, size);
SingleInputSingleOutputDiff<float>(&__llvm_libc::sqrtf, &::sqrtf, data, size);
SingleInputSingleOutputDiff<double>(&__llvm_libc::sqrt, &::sqrt, data, size);
SingleInputSingleOutputDiff<long double>(&__llvm_libc::sqrtl, &::sqrtl, data,
size);
SingleInputSingleOutputWithSideEffectDiff<float, int>(&__llvm_libc::frexpf,
&::frexpf, data, size);
SingleInputSingleOutputWithSideEffectDiff<double, int>(&__llvm_libc::frexp,
&::frexp, data, size);
SingleInputSingleOutputWithSideEffectDiff<long double, int>(
&__llvm_libc::frexpl, &::frexpl, data, size);
SingleInputSingleOutputWithSideEffectDiff<float, float>(&__llvm_libc::modff,
&::modff, data, size);
SingleInputSingleOutputWithSideEffectDiff<double, double>(
&__llvm_libc::modf, &::modf, data, size);
SingleInputSingleOutputWithSideEffectDiff<long double, long double>(
&__llvm_libc::modfl, &::modfl, data, size);
TwoInputSingleOutputDiff<float, int>(&__llvm_libc::ldexpf, &::ldexpf, data,
size);
TwoInputSingleOutputDiff<double, int>(&__llvm_libc::ldexp, &::ldexp, data,
size);
TwoInputSingleOutputDiff<long double, int>(&__llvm_libc::ldexpl, &::ldexpl,
data, size);
RemQuoDiff<float>(&__llvm_libc::remquof, &::remquof, data, size);
RemQuoDiff<double>(&__llvm_libc::remquo, &::remquo, data, size);
RemQuoDiff<long double>(&__llvm_libc::remquol, &::remquol, data, size);
return 0;
}
|