summaryrefslogtreecommitdiffstats
path: root/gnu/llvm/lib/Fuzzer/test/SimpleCmpTest.cpp
diff options
context:
space:
mode:
authorpatrick <patrick@openbsd.org>2017-10-04 20:27:34 +0000
committerpatrick <patrick@openbsd.org>2017-10-04 20:27:34 +0000
commit31eb748944903b7f4f38afda9851951ca9dfc1ae (patch)
tree9b95b6ea45d0874d75eb05b90c0840e191416439 /gnu/llvm/lib/Fuzzer/test/SimpleCmpTest.cpp
parentDon't try to handle IPv4-compatible IPv6 addresses (diff)
downloadwireguard-openbsd-31eb748944903b7f4f38afda9851951ca9dfc1ae.tar.xz
wireguard-openbsd-31eb748944903b7f4f38afda9851951ca9dfc1ae.zip
Import LLVM 5.0.0 release including clang, lld and lldb.
Diffstat (limited to 'gnu/llvm/lib/Fuzzer/test/SimpleCmpTest.cpp')
-rw-r--r--gnu/llvm/lib/Fuzzer/test/SimpleCmpTest.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/gnu/llvm/lib/Fuzzer/test/SimpleCmpTest.cpp b/gnu/llvm/lib/Fuzzer/test/SimpleCmpTest.cpp
index 0220c30f9a6..8acad4ac77e 100644
--- a/gnu/llvm/lib/Fuzzer/test/SimpleCmpTest.cpp
+++ b/gnu/llvm/lib/Fuzzer/test/SimpleCmpTest.cpp
@@ -3,9 +3,9 @@
// Simple test for a fuzzer. The fuzzer must find several narrow ranges.
#include <cstdint>
+#include <cstdio>
#include <cstdlib>
#include <cstring>
-#include <cstdio>
extern int AllLines[];
@@ -26,12 +26,13 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) {
memcpy(&y, Data + 8, 8); // 16
memcpy(&z, Data + 16, sizeof(z)); // 20
memcpy(&a, Data + 20, sizeof(a)); // 22
+ const bool k32bit = sizeof(void*) == 4;
- if (x > 1234567890 && PrintOnce(__LINE__) &&
- x < 1234567895 && PrintOnce(__LINE__) &&
+ if ((k32bit || x > 1234567890) && PrintOnce(__LINE__) &&
+ (k32bit || x < 1234567895) && PrintOnce(__LINE__) &&
a == 0x4242 && PrintOnce(__LINE__) &&
- y >= 987654321 && PrintOnce(__LINE__) &&
- y <= 987654325 && PrintOnce(__LINE__) &&
+ (k32bit || y >= 987654321) && PrintOnce(__LINE__) &&
+ (k32bit || y <= 987654325) && PrintOnce(__LINE__) &&
z < -10000 && PrintOnce(__LINE__) &&
z >= -10005 && PrintOnce(__LINE__) &&
z != -10003 && PrintOnce(__LINE__) &&