From 4b3c35b34c62dc619b1c706e5562e90c089f2419 Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Mon, 21 Sep 2020 17:23:03 -0700 Subject: Fuzz with negative zero more often (#3133) We did so earlier sometimes, as we would pick 0 and then tweak it with a negation. But that favored positive 0. This makes coverage symmetric. --- src/tools/fuzzing.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/tools/fuzzing.h b/src/tools/fuzzing.h index 7ef24bbac..cab33e3b5 100644 --- a/src/tools/fuzzing.h +++ b/src/tools/fuzzing.h @@ -1699,7 +1699,8 @@ private: std::numeric_limits::max())); break; case Type::f32: - value = Literal(pick(0, + value = Literal(pick(0.0f, + -0.0f, std::numeric_limits::min(), std::numeric_limits::max(), std::numeric_limits::min(), @@ -1710,7 +1711,8 @@ private: std::numeric_limits::max())); break; case Type::f64: - value = Literal(pick(0, + value = Literal(pick(0.0, + -0.0, std::numeric_limits::min(), std::numeric_limits::max(), std::numeric_limits::min(), -- cgit v1.2.3