diff options
author | Kostya Serebryany <kcc@google.com> | 2017-03-31 03:51:40 +0000 |
---|---|---|
committer | Kostya Serebryany <kcc@google.com> | 2017-03-31 03:51:40 +0000 |
commit | 7de1f1a826a9f1848e09f7c312fb47f00f8d589e (patch) | |
tree | bcc82656a40d4347fa0bd422edfeabe4ed0c2262 /llvm/lib/Fuzzer/test/SimpleCmpTest.cpp | |
parent | 163e4992b7a154719fe660f3e7b15e96a551dc2a (diff) | |
download | bcm5719-llvm-7de1f1a826a9f1848e09f7c312fb47f00f8d589e.tar.gz bcm5719-llvm-7de1f1a826a9f1848e09f7c312fb47f00f8d589e.zip |
[libFuzzer] tests: don't test 64-bit comparison on 32-bit builds
llvm-svn: 299179
Diffstat (limited to 'llvm/lib/Fuzzer/test/SimpleCmpTest.cpp')
-rw-r--r-- | llvm/lib/Fuzzer/test/SimpleCmpTest.cpp | 9 |
1 files changed, 5 insertions, 4 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__) && |