aboutsummaryrefslogtreecommitdiff
path: root/src/test/fuzz/multiplication_overflow.cpp
diff options
context:
space:
mode:
authorHennadii Stepanov <32963518+hebasto@users.noreply.github.com>2024-04-18 10:27:25 +0100
committerHennadii Stepanov <32963518+hebasto@users.noreply.github.com>2024-04-18 10:27:25 +0100
commit19dceddf4bcdb74e84cf27229039a239b873d41b (patch)
tree406fbe87dc464b40a0c38cf1b7b4236639f698d9 /src/test/fuzz/multiplication_overflow.cpp
parent4c078d7bd278fa8b4db6e1da7b9b747f49a8ac4c (diff)
build, msvc: Build `fuzz.exe` binary
Diffstat (limited to 'src/test/fuzz/multiplication_overflow.cpp')
-rw-r--r--src/test/fuzz/multiplication_overflow.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/test/fuzz/multiplication_overflow.cpp b/src/test/fuzz/multiplication_overflow.cpp
index aeef4f24b7..a762a4dfe3 100644
--- a/src/test/fuzz/multiplication_overflow.cpp
+++ b/src/test/fuzz/multiplication_overflow.cpp
@@ -17,12 +17,18 @@ void TestMultiplicationOverflow(FuzzedDataProvider& fuzzed_data_provider)
const T i = fuzzed_data_provider.ConsumeIntegral<T>();
const T j = fuzzed_data_provider.ConsumeIntegral<T>();
const bool is_multiplication_overflow_custom = MultiplicationOverflow(i, j);
+#ifndef _MSC_VER
T result_builtin;
const bool is_multiplication_overflow_builtin = __builtin_mul_overflow(i, j, &result_builtin);
assert(is_multiplication_overflow_custom == is_multiplication_overflow_builtin);
if (!is_multiplication_overflow_custom) {
assert(i * j == result_builtin);
}
+#else
+ if (!is_multiplication_overflow_custom) {
+ (void)(i * j);
+ }
+#endif
}
} // namespace