From aaaace2fd1299939c755c281b787df0bbf1747a0 Mon Sep 17 00:00:00 2001 From: MarcoFalke <*~=`'#}+{/-|&$^_@721217.xyz> Date: Tue, 9 Jan 2024 16:47:36 +0100 Subject: fuzz: Assume presence of __builtin_*_overflow, without checks --- src/test/fuzz/addition_overflow.cpp | 10 ---------- 1 file changed, 10 deletions(-) (limited to 'src/test/fuzz/addition_overflow.cpp') diff --git a/src/test/fuzz/addition_overflow.cpp b/src/test/fuzz/addition_overflow.cpp index 7b84bfda20..5100b6f438 100644 --- a/src/test/fuzz/addition_overflow.cpp +++ b/src/test/fuzz/addition_overflow.cpp @@ -11,14 +11,6 @@ #include #include -#if defined(__has_builtin) -#if __has_builtin(__builtin_add_overflow) -#define HAVE_BUILTIN_ADD_OVERFLOW -#endif -#elif defined(__GNUC__) -#define HAVE_BUILTIN_ADD_OVERFLOW -#endif - namespace { template void TestAdditionOverflow(FuzzedDataProvider& fuzzed_data_provider) @@ -32,14 +24,12 @@ void TestAdditionOverflow(FuzzedDataProvider& fuzzed_data_provider) assert(is_addition_overflow_custom == AdditionOverflow(j, i)); assert(maybe_add == CheckedAdd(j, i)); assert(sat_add == SaturatingAdd(j, i)); -#if defined(HAVE_BUILTIN_ADD_OVERFLOW) T result_builtin; const bool is_addition_overflow_builtin = __builtin_add_overflow(i, j, &result_builtin); assert(is_addition_overflow_custom == is_addition_overflow_builtin); if (!is_addition_overflow_custom) { assert(i + j == result_builtin); } -#endif if (is_addition_overflow_custom) { assert(sat_add == std::numeric_limits::min() || sat_add == std::numeric_limits::max()); } else { -- cgit v1.2.3