diff options
Diffstat (limited to 'llvm/lib/Fuzzer/test')
-rw-r--r-- | llvm/lib/Fuzzer/test/SimpleCmpTest.cpp | 9 | ||||
-rw-r--r-- | llvm/lib/Fuzzer/test/SwapCmpTest.cpp | 3 |
2 files changed, 7 insertions, 5 deletions
diff --git a/llvm/lib/Fuzzer/test/SimpleCmpTest.cpp b/llvm/lib/Fuzzer/test/SimpleCmpTest.cpp index 0220c30f9a6..12b5cdda066 100644 --- a/llvm/lib/Fuzzer/test/SimpleCmpTest.cpp +++ b/llvm/lib/Fuzzer/test/SimpleCmpTest.cpp @@ -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__) && diff --git a/llvm/lib/Fuzzer/test/SwapCmpTest.cpp b/llvm/lib/Fuzzer/test/SwapCmpTest.cpp index f79db4ccf71..b90ac72c22c 100644 --- a/llvm/lib/Fuzzer/test/SwapCmpTest.cpp +++ b/llvm/lib/Fuzzer/test/SwapCmpTest.cpp @@ -19,8 +19,9 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) { x = __builtin_bswap64(x); y = __builtin_bswap32(y); z = __builtin_bswap16(z); + const bool k32bit = sizeof(void*) == 4; - if (x == 0x46555A5A5A5A5546ULL && + if ((k32bit || x == 0x46555A5A5A5A5546ULL) && z == 0x4F4B && y == 0x66757A7A && true |