Skip to content

[libc] created fuzz test for sin function #101411

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 1, 2024

Conversation

RoseZhang03
Copy link
Contributor

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.

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.
@llvmbot llvmbot added the libc label Jul 31, 2024
@llvmbot
Copy link
Member

llvmbot commented Jul 31, 2024

@llvm/pr-subscribers-libc

Author: None (RoseZhang03)

Changes

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.


Full diff: https://github.com/llvm/llvm-project/pull/101411.diff

3 Files Affected:

  • (modified) libc/fuzzing/CMakeLists.txt (+1-1)
  • (modified) libc/fuzzing/math/CMakeLists.txt (+9)
  • (added) libc/fuzzing/math/sin_fuzz.cpp (+40)
diff --git a/libc/fuzzing/CMakeLists.txt b/libc/fuzzing/CMakeLists.txt
index 816691b4bd440..e2dcecca7f7df 100644
--- a/libc/fuzzing/CMakeLists.txt
+++ b/libc/fuzzing/CMakeLists.txt
@@ -3,7 +3,7 @@ add_custom_target(libc-fuzzer)
 
 add_subdirectory(__support)
 # TODO(#85680): Re-enable math fuzzing after headers are sorted out
-# add_subdirectory(math)
+add_subdirectory(math)
 add_subdirectory(stdlib)
 add_subdirectory(stdio)
 add_subdirectory(string)
diff --git a/libc/fuzzing/math/CMakeLists.txt b/libc/fuzzing/math/CMakeLists.txt
index 6990a04922a5c..ad163cc53eae3 100644
--- a/libc/fuzzing/math/CMakeLists.txt
+++ b/libc/fuzzing/math/CMakeLists.txt
@@ -61,3 +61,12 @@ add_libc_fuzzer(
     libc.src.math.nextafterf
     libc.src.math.nextafterl
 )
+
+add_libc_fuzzer(
+  sin_fuzz
+  NEED_MPFR
+  SRCS
+    sin_fuzz.cpp
+  DEPENDS
+    libc.src.math.sin
+)
diff --git a/libc/fuzzing/math/sin_fuzz.cpp b/libc/fuzzing/math/sin_fuzz.cpp
new file mode 100644
index 0000000000000..ee9eee5ae5bff
--- /dev/null
+++ b/libc/fuzzing/math/sin_fuzz.cpp
@@ -0,0 +1,40 @@
+//===-- sin_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 sin implementation.
+///
+//===----------------------------------------------------------------------===//
+
+#include "src/math/sin.h"
+#include <cmath>
+#include <mpfr.h>
+
+extern "C" int LLVMFuzzerTestOneInput(const double x) {
+  // remove NaN and inf as preconditions
+  if (std::isnan(x))
+    return 0;
+  if (std::isinf(x))
+    return 0;
+  // signed zeros already tested in unit tests
+  if (std::signbit(x) && x == 0.0)
+    return 0;
+  mpfr_t input;
+  mpfr_init2(input, 64);
+  mpfr_set_d(input, x, MPFR_RNDN);
+  int output = mpfr_sin(input, input, MPFR_RNDN);
+  mpfr_subnormalize(input, output, MPFR_RNDN);
+  double to_compare = mpfr_get_d(input, MPFR_RNDN);
+
+  double result = LIBC_NAMESPACE::sin(x);
+
+  if (result != to_compare)
+    __builtin_trap();
+
+  mpfr_clear(input);
+  return 0;
+}

Copy link
Contributor

@michaelrj-google michaelrj-google left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall LGTM with one nit

if (std::signbit(x) && x == 0.0)
return 0;
mpfr_t input;
mpfr_init2(input, 64);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For MPFR it's generally best to match exactly the precision you're trying to compare against. A double precision float has an effective precision of 53 since its mantissa is 52 bits + 1 for the implicit leading bit, so instead of 64 this number should be 53.

@RoseZhang03 RoseZhang03 merged commit 90065da into llvm:main Aug 1, 2024
6 checks passed
@llvm-ci
Copy link
Collaborator

llvm-ci commented Aug 1, 2024

LLVM Buildbot has detected a new failure on builder libc-x86_64-debian running on libc-x86_64-debian while building libc at step 4 "annotate".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/43/builds/3483

Here is the relevant piece of the build log for the reference:

Step 4 (annotate) failure: 'python ../llvm-zorg/zorg/buildbot/builders/annotated/libc-linux.py ...' (failure)
...
[       OK ] LlvmLibcTestFilterTest.NoFilter (2 us)
Ran 1 tests.  PASS: 1  FAIL: 0
[950/950] Running unit test libc.test.utils.FPUtil.x86_long_double_test
[==========] Running 1 test from 1 test suite.
[ RUN      ] LlvmLibcX86LongDoubleTest.is_nan
[       OK ] LlvmLibcX86LongDoubleTest.is_nan (8 ms)
Ran 1 tests.  PASS: 1  FAIL: 0
@@@BUILD_STEP libc-fuzzer@@@
Running: ninja libc-fuzzer
[1/7] Building CXX object projects/libc/fuzzing/math/CMakeFiles/libc.fuzzing.math.nextafter_differential_fuzz.dir/nextafter_differential_fuzz.cpp.o
FAILED: projects/libc/fuzzing/math/CMakeFiles/libc.fuzzing.math.nextafter_differential_fuzz.dir/nextafter_differential_fuzz.cpp.o 
/usr/bin/clang++ -DLIBC_NAMESPACE=__llvm_libc_19_0_0_git -I/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian/libc-x86_64-debian/build/projects/libc/fuzzing/math -I/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian/libc-x86_64-debian/llvm-project/libc/fuzzing/math -I/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian/libc-x86_64-debian/llvm-project/libc -isystem /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian/libc-x86_64-debian/build/projects/libc/include -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic -Wno-long-long -Wc++98-compat-extra-semi -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wstring-conversion -Wmisleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -ffunction-sections -fdata-sections -fsanitize=fuzzer -O3 -DNDEBUG -std=c++17 -MD -MT projects/libc/fuzzing/math/CMakeFiles/libc.fuzzing.math.nextafter_differential_fuzz.dir/nextafter_differential_fuzz.cpp.o -MF projects/libc/fuzzing/math/CMakeFiles/libc.fuzzing.math.nextafter_differential_fuzz.dir/nextafter_differential_fuzz.cpp.o.d -o projects/libc/fuzzing/math/CMakeFiles/libc.fuzzing.math.nextafter_differential_fuzz.dir/nextafter_differential_fuzz.cpp.o -c /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian/libc-x86_64-debian/llvm-project/libc/fuzzing/math/nextafter_differential_fuzz.cpp
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian/libc-x86_64-debian/llvm-project/libc/fuzzing/math/nextafter_differential_fuzz.cpp:22:43: error: no member named 'nextafterf' in the global namespace; did you mean '__llvm_libc_19_0_0_git::nextafterf'?
                                         &::nextafterf, data, size);
                                          ^~~~~~~~~~~~
                                          __llvm_libc_19_0_0_git::nextafterf
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian/libc-x86_64-debian/llvm-project/libc/src/math/nextafterf.h:16:7: note: '__llvm_libc_19_0_0_git::nextafterf' declared here
float nextafterf(float x, float y);
      ^
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian/libc-x86_64-debian/llvm-project/libc/fuzzing/math/nextafter_differential_fuzz.cpp:24:45: error: no member named 'nextafter' in the global namespace; did you mean '__llvm_libc_19_0_0_git::nextafter'?
                                           &::nextafter, data, size);
                                            ^~~~~~~~~~~
                                            __llvm_libc_19_0_0_git::nextafter
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian/libc-x86_64-debian/llvm-project/libc/src/math/nextafter.h:16:8: note: '__llvm_libc_19_0_0_git::nextafter' declared here
double nextafter(double x, double y);
       ^
2 errors generated.
[2/7] Building CXX object projects/libc/fuzzing/math/CMakeFiles/libc.fuzzing.math.math_differential_fuzz.dir/math_differential_fuzz.cpp.o
FAILED: projects/libc/fuzzing/math/CMakeFiles/libc.fuzzing.math.math_differential_fuzz.dir/math_differential_fuzz.cpp.o 
/usr/bin/clang++ -DLIBC_NAMESPACE=__llvm_libc_19_0_0_git -I/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian/libc-x86_64-debian/build/projects/libc/fuzzing/math -I/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian/libc-x86_64-debian/llvm-project/libc/fuzzing/math -I/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian/libc-x86_64-debian/llvm-project/libc -isystem /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian/libc-x86_64-debian/build/projects/libc/include -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic -Wno-long-long -Wc++98-compat-extra-semi -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wstring-conversion -Wmisleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -ffunction-sections -fdata-sections -fsanitize=fuzzer -O3 -DNDEBUG -std=c++17 -MD -MT projects/libc/fuzzing/math/CMakeFiles/libc.fuzzing.math.math_differential_fuzz.dir/math_differential_fuzz.cpp.o -MF projects/libc/fuzzing/math/CMakeFiles/libc.fuzzing.math.math_differential_fuzz.dir/math_differential_fuzz.cpp.o.d -o projects/libc/fuzzing/math/CMakeFiles/libc.fuzzing.math.math_differential_fuzz.dir/math_differential_fuzz.cpp.o -c /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian/libc-x86_64-debian/llvm-project/libc/fuzzing/math/math_differential_fuzz.cpp
In file included from /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian/libc-x86_64-debian/llvm-project/libc/fuzzing/math/math_differential_fuzz.cpp:13:
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian/libc-x86_64-debian/llvm-project/libc/fuzzing/math/RemQuoDiff.h:37:7: error: use of undeclared identifier 'bit1'; did you mean 'bits1'?
  if (bit1.is_nan()) {
      ^~~~
      bits1
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian/libc-x86_64-debian/llvm-project/libc/fuzzing/math/RemQuoDiff.h:34:37: note: 'bits1' declared here
  LIBC_NAMESPACE::fputil::FPBits<T> bits1(remainder1);
                                    ^
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian/libc-x86_64-debian/llvm-project/libc/fuzzing/math/RemQuoDiff.h:38:10: error: use of undeclared identifier 'bit2'; did you mean 'bits2'?
    if (!bit2.is_nan())
         ^~~~
         bits2
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian/libc-x86_64-debian/llvm-project/libc/fuzzing/math/RemQuoDiff.h:35:37: note: 'bits2' declared here
  LIBC_NAMESPACE::fputil::FPBits<T> bits2(remainder2);
                                    ^
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian/libc-x86_64-debian/llvm-project/libc/fuzzing/math/RemQuoDiff.h:43:7: error: use of undeclared identifier 'bit1'; did you mean 'bits1'?
  if (bit1.is_inf() != bit2.is_inf())
      ^~~~
      bits1

@llvm-ci
Copy link
Collaborator

llvm-ci commented Aug 1, 2024

LLVM Buildbot has detected a new failure on builder libc-x86_64-debian-dbg running on libc-x86_64-debian while building libc at step 4 "annotate".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/93/builds/3389

Here is the relevant piece of the build log for the reference:

Step 4 (annotate) failure: 'python ../llvm-zorg/zorg/buildbot/builders/annotated/libc-linux.py ...' (failure)
...
[ RUN      ] LlvmLibcStrtouint64Test.CleanBaseSixteenDecode
[       OK ] LlvmLibcStrtouint64Test.CleanBaseSixteenDecode (8 us)
[ RUN      ] LlvmLibcStrtouint64Test.MessyBaseSixteenDecode
[       OK ] LlvmLibcStrtouint64Test.MessyBaseSixteenDecode (3 us)
[ RUN      ] LlvmLibcStrtouint64Test.AutomaticBaseSelection
[       OK ] LlvmLibcStrtouint64Test.AutomaticBaseSelection (3 us)
Ran 14 tests.  PASS: 14  FAIL: 0
@@@BUILD_STEP libc-fuzzer@@@
Running: ninja libc-fuzzer
[1/7] Building CXX object projects/libc/fuzzing/math/CMakeFiles/libc.fuzzing.math.nextafter_differential_fuzz.dir/nextafter_differential_fuzz.cpp.o
FAILED: projects/libc/fuzzing/math/CMakeFiles/libc.fuzzing.math.nextafter_differential_fuzz.dir/nextafter_differential_fuzz.cpp.o 
/usr/bin/clang++ -DLIBC_NAMESPACE=__llvm_libc_19_0_0_git -D_DEBUG -I/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian/libc-x86_64-debian-dbg/build/projects/libc/fuzzing/math -I/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian/libc-x86_64-debian-dbg/llvm-project/libc/fuzzing/math -I/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian/libc-x86_64-debian-dbg/llvm-project/libc -isystem /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian/libc-x86_64-debian-dbg/build/projects/libc/include -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic -Wno-long-long -Wc++98-compat-extra-semi -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wstring-conversion -Wmisleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -fsanitize=fuzzer -g -std=c++17 -MD -MT projects/libc/fuzzing/math/CMakeFiles/libc.fuzzing.math.nextafter_differential_fuzz.dir/nextafter_differential_fuzz.cpp.o -MF projects/libc/fuzzing/math/CMakeFiles/libc.fuzzing.math.nextafter_differential_fuzz.dir/nextafter_differential_fuzz.cpp.o.d -o projects/libc/fuzzing/math/CMakeFiles/libc.fuzzing.math.nextafter_differential_fuzz.dir/nextafter_differential_fuzz.cpp.o -c /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian/libc-x86_64-debian-dbg/llvm-project/libc/fuzzing/math/nextafter_differential_fuzz.cpp
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian/libc-x86_64-debian-dbg/llvm-project/libc/fuzzing/math/nextafter_differential_fuzz.cpp:22:43: error: no member named 'nextafterf' in the global namespace; did you mean '__llvm_libc_19_0_0_git::nextafterf'?
                                         &::nextafterf, data, size);
                                          ^~~~~~~~~~~~
                                          __llvm_libc_19_0_0_git::nextafterf
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian/libc-x86_64-debian-dbg/llvm-project/libc/src/math/nextafterf.h:16:7: note: '__llvm_libc_19_0_0_git::nextafterf' declared here
float nextafterf(float x, float y);
      ^
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian/libc-x86_64-debian-dbg/llvm-project/libc/fuzzing/math/nextafter_differential_fuzz.cpp:24:45: error: no member named 'nextafter' in the global namespace; did you mean '__llvm_libc_19_0_0_git::nextafter'?
                                           &::nextafter, data, size);
                                            ^~~~~~~~~~~
                                            __llvm_libc_19_0_0_git::nextafter
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian/libc-x86_64-debian-dbg/llvm-project/libc/src/math/nextafter.h:16:8: note: '__llvm_libc_19_0_0_git::nextafter' declared here
double nextafter(double x, double y);
       ^
2 errors generated.
[2/7] Building CXX object projects/libc/fuzzing/math/CMakeFiles/libc.fuzzing.math.math_differential_fuzz.dir/math_differential_fuzz.cpp.o
FAILED: projects/libc/fuzzing/math/CMakeFiles/libc.fuzzing.math.math_differential_fuzz.dir/math_differential_fuzz.cpp.o 
/usr/bin/clang++ -DLIBC_NAMESPACE=__llvm_libc_19_0_0_git -D_DEBUG -I/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian/libc-x86_64-debian-dbg/build/projects/libc/fuzzing/math -I/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian/libc-x86_64-debian-dbg/llvm-project/libc/fuzzing/math -I/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian/libc-x86_64-debian-dbg/llvm-project/libc -isystem /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian/libc-x86_64-debian-dbg/build/projects/libc/include -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic -Wno-long-long -Wc++98-compat-extra-semi -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wstring-conversion -Wmisleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -fsanitize=fuzzer -g -std=c++17 -MD -MT projects/libc/fuzzing/math/CMakeFiles/libc.fuzzing.math.math_differential_fuzz.dir/math_differential_fuzz.cpp.o -MF projects/libc/fuzzing/math/CMakeFiles/libc.fuzzing.math.math_differential_fuzz.dir/math_differential_fuzz.cpp.o.d -o projects/libc/fuzzing/math/CMakeFiles/libc.fuzzing.math.math_differential_fuzz.dir/math_differential_fuzz.cpp.o -c /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian/libc-x86_64-debian-dbg/llvm-project/libc/fuzzing/math/math_differential_fuzz.cpp
In file included from /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian/libc-x86_64-debian-dbg/llvm-project/libc/fuzzing/math/math_differential_fuzz.cpp:13:
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian/libc-x86_64-debian-dbg/llvm-project/libc/fuzzing/math/RemQuoDiff.h:37:7: error: use of undeclared identifier 'bit1'; did you mean 'bits1'?
  if (bit1.is_nan()) {
      ^~~~
      bits1
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian/libc-x86_64-debian-dbg/llvm-project/libc/fuzzing/math/RemQuoDiff.h:34:37: note: 'bits1' declared here
  LIBC_NAMESPACE::fputil::FPBits<T> bits1(remainder1);
                                    ^
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian/libc-x86_64-debian-dbg/llvm-project/libc/fuzzing/math/RemQuoDiff.h:38:10: error: use of undeclared identifier 'bit2'; did you mean 'bits2'?
    if (!bit2.is_nan())
         ^~~~
         bits2
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian/libc-x86_64-debian-dbg/llvm-project/libc/fuzzing/math/RemQuoDiff.h:35:37: note: 'bits2' declared here
  LIBC_NAMESPACE::fputil::FPBits<T> bits2(remainder2);
                                    ^
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian/libc-x86_64-debian-dbg/llvm-project/libc/fuzzing/math/RemQuoDiff.h:43:7: error: use of undeclared identifier 'bit1'; did you mean 'bits1'?
  if (bit1.is_inf() != bit2.is_inf())
      ^~~~
      bits1

@llvm-ci
Copy link
Collaborator

llvm-ci commented Aug 1, 2024

LLVM Buildbot has detected a new failure on builder libc-x86_64-debian-dbg-asan running on libc-x86_64-debian while building libc at step 4 "annotate".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/147/builds/3381

Here is the relevant piece of the build log for the reference:

Step 4 (annotate) failure: 'python ../llvm-zorg/zorg/buildbot/builders/annotated/libc-linux.py ...' (failure)
...
[ RUN      ] LlvmLibcStrtouint64Test.CleanBaseSixteenDecode
[       OK ] LlvmLibcStrtouint64Test.CleanBaseSixteenDecode (8 us)
[ RUN      ] LlvmLibcStrtouint64Test.MessyBaseSixteenDecode
[       OK ] LlvmLibcStrtouint64Test.MessyBaseSixteenDecode (4 us)
[ RUN      ] LlvmLibcStrtouint64Test.AutomaticBaseSelection
[       OK ] LlvmLibcStrtouint64Test.AutomaticBaseSelection (4 us)
Ran 14 tests.  PASS: 14  FAIL: 0
@@@BUILD_STEP libc-fuzzer@@@
Running: ninja libc-fuzzer
[1/7] Building CXX object projects/libc/fuzzing/math/CMakeFiles/libc.fuzzing.math.nextafter_differential_fuzz.dir/nextafter_differential_fuzz.cpp.o
FAILED: projects/libc/fuzzing/math/CMakeFiles/libc.fuzzing.math.nextafter_differential_fuzz.dir/nextafter_differential_fuzz.cpp.o 
/usr/bin/clang++ -DLIBC_NAMESPACE=__llvm_libc_19_0_0_git -D_DEBUG -I/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian/libc-x86_64-debian-dbg-asan/build/projects/libc/fuzzing/math -I/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian/libc-x86_64-debian-dbg-asan/llvm-project/libc/fuzzing/math -I/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian/libc-x86_64-debian-dbg-asan/llvm-project/libc -isystem /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian/libc-x86_64-debian-dbg-asan/build/projects/libc/include -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic -Wno-long-long -Wc++98-compat-extra-semi -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wstring-conversion -Wmisleading-indentation -Wctad-maybe-unsupported -fno-omit-frame-pointer -O1 -fsanitize=address -fdiagnostics-color -fsanitize=fuzzer -g -std=c++17 -MD -MT projects/libc/fuzzing/math/CMakeFiles/libc.fuzzing.math.nextafter_differential_fuzz.dir/nextafter_differential_fuzz.cpp.o -MF projects/libc/fuzzing/math/CMakeFiles/libc.fuzzing.math.nextafter_differential_fuzz.dir/nextafter_differential_fuzz.cpp.o.d -o projects/libc/fuzzing/math/CMakeFiles/libc.fuzzing.math.nextafter_differential_fuzz.dir/nextafter_differential_fuzz.cpp.o -c /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian/libc-x86_64-debian-dbg-asan/llvm-project/libc/fuzzing/math/nextafter_differential_fuzz.cpp
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian/libc-x86_64-debian-dbg-asan/llvm-project/libc/fuzzing/math/nextafter_differential_fuzz.cpp:22:43: error: no member named 'nextafterf' in the global namespace; did you mean '__llvm_libc_19_0_0_git::nextafterf'?
                                         &::nextafterf, data, size);
                                          ^~~~~~~~~~~~
                                          __llvm_libc_19_0_0_git::nextafterf
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian/libc-x86_64-debian-dbg-asan/llvm-project/libc/src/math/nextafterf.h:16:7: note: '__llvm_libc_19_0_0_git::nextafterf' declared here
float nextafterf(float x, float y);
      ^
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian/libc-x86_64-debian-dbg-asan/llvm-project/libc/fuzzing/math/nextafter_differential_fuzz.cpp:24:45: error: no member named 'nextafter' in the global namespace; did you mean '__llvm_libc_19_0_0_git::nextafter'?
                                           &::nextafter, data, size);
                                            ^~~~~~~~~~~
                                            __llvm_libc_19_0_0_git::nextafter
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian/libc-x86_64-debian-dbg-asan/llvm-project/libc/src/math/nextafter.h:16:8: note: '__llvm_libc_19_0_0_git::nextafter' declared here
double nextafter(double x, double y);
       ^
2 errors generated.
[2/7] Building CXX object projects/libc/fuzzing/math/CMakeFiles/libc.fuzzing.math.math_differential_fuzz.dir/math_differential_fuzz.cpp.o
FAILED: projects/libc/fuzzing/math/CMakeFiles/libc.fuzzing.math.math_differential_fuzz.dir/math_differential_fuzz.cpp.o 
/usr/bin/clang++ -DLIBC_NAMESPACE=__llvm_libc_19_0_0_git -D_DEBUG -I/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian/libc-x86_64-debian-dbg-asan/build/projects/libc/fuzzing/math -I/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian/libc-x86_64-debian-dbg-asan/llvm-project/libc/fuzzing/math -I/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian/libc-x86_64-debian-dbg-asan/llvm-project/libc -isystem /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian/libc-x86_64-debian-dbg-asan/build/projects/libc/include -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic -Wno-long-long -Wc++98-compat-extra-semi -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wstring-conversion -Wmisleading-indentation -Wctad-maybe-unsupported -fno-omit-frame-pointer -O1 -fsanitize=address -fdiagnostics-color -fsanitize=fuzzer -g -std=c++17 -MD -MT projects/libc/fuzzing/math/CMakeFiles/libc.fuzzing.math.math_differential_fuzz.dir/math_differential_fuzz.cpp.o -MF projects/libc/fuzzing/math/CMakeFiles/libc.fuzzing.math.math_differential_fuzz.dir/math_differential_fuzz.cpp.o.d -o projects/libc/fuzzing/math/CMakeFiles/libc.fuzzing.math.math_differential_fuzz.dir/math_differential_fuzz.cpp.o -c /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian/libc-x86_64-debian-dbg-asan/llvm-project/libc/fuzzing/math/math_differential_fuzz.cpp
In file included from /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian/libc-x86_64-debian-dbg-asan/llvm-project/libc/fuzzing/math/math_differential_fuzz.cpp:13:
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian/libc-x86_64-debian-dbg-asan/llvm-project/libc/fuzzing/math/RemQuoDiff.h:37:7: error: use of undeclared identifier 'bit1'; did you mean 'bits1'?
  if (bit1.is_nan()) {
      ^~~~
      bits1
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian/libc-x86_64-debian-dbg-asan/llvm-project/libc/fuzzing/math/RemQuoDiff.h:34:37: note: 'bits1' declared here
  LIBC_NAMESPACE::fputil::FPBits<T> bits1(remainder1);
                                    ^
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian/libc-x86_64-debian-dbg-asan/llvm-project/libc/fuzzing/math/RemQuoDiff.h:38:10: error: use of undeclared identifier 'bit2'; did you mean 'bits2'?
    if (!bit2.is_nan())
         ^~~~
         bits2
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian/libc-x86_64-debian-dbg-asan/llvm-project/libc/fuzzing/math/RemQuoDiff.h:35:37: note: 'bits2' declared here
  LIBC_NAMESPACE::fputil::FPBits<T> bits2(remainder2);
                                    ^
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian/libc-x86_64-debian-dbg-asan/llvm-project/libc/fuzzing/math/RemQuoDiff.h:43:7: error: use of undeclared identifier 'bit1'; did you mean 'bits1'?
  if (bit1.is_inf() != bit2.is_inf())
      ^~~~
      bits1

@RoseZhang03 RoseZhang03 deleted the rosezhang21 branch August 1, 2024 20:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants