summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Fuzzer/test
diff options
context:
space:
mode:
authorKostya Serebryany <kcc@google.com>2017-07-25 02:09:46 +0000
committerKostya Serebryany <kcc@google.com>2017-07-25 02:09:46 +0000
commit6f7befd10f071e50266b56c8c53ec8b248b60689 (patch)
treeba594e2122e84a1ddc10b0329657848677f20a1e /llvm/lib/Fuzzer/test
parentc485ca05ac279b7bced1caa77f05666090af2ad6 (diff)
downloadbcm5719-llvm-6f7befd10f071e50266b56c8c53ec8b248b60689.tar.gz
bcm5719-llvm-6f7befd10f071e50266b56c8c53ec8b248b60689.zip
[libFuzzer] make one test faster, fix compiler warnings in tests
llvm-svn: 308945
Diffstat (limited to 'llvm/lib/Fuzzer/test')
-rw-r--r--llvm/lib/Fuzzer/test/SingleMemcmpTest.cpp2
-rw-r--r--llvm/lib/Fuzzer/test/StrcmpTest.cpp2
-rw-r--r--llvm/lib/Fuzzer/test/StrncmpTest.cpp2
-rw-r--r--llvm/lib/Fuzzer/test/value-profile-cmp2.test2
4 files changed, 4 insertions, 4 deletions
diff --git a/llvm/lib/Fuzzer/test/SingleMemcmpTest.cpp b/llvm/lib/Fuzzer/test/SingleMemcmpTest.cpp
index 83c09e0428e..19781ba4cd7 100644
--- a/llvm/lib/Fuzzer/test/SingleMemcmpTest.cpp
+++ b/llvm/lib/Fuzzer/test/SingleMemcmpTest.cpp
@@ -8,7 +8,7 @@
#include <cstring>
extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) {
- char *S = (char*)Data;
+ const char *S = (const char*)Data;
if (Size >= 6 && !memcmp(S, "qwerty", 6)) {
fprintf(stderr, "BINGO\n");
exit(1);
diff --git a/llvm/lib/Fuzzer/test/StrcmpTest.cpp b/llvm/lib/Fuzzer/test/StrcmpTest.cpp
index e7636e8812f..81f041d913e 100644
--- a/llvm/lib/Fuzzer/test/StrcmpTest.cpp
+++ b/llvm/lib/Fuzzer/test/StrcmpTest.cpp
@@ -13,7 +13,7 @@ bool Eq(const uint8_t *Data, size_t Size, const char *Str) {
size_t Len = strlen(Str);
if (Size < Len) return false;
if (Len >= sizeof(Buff)) return false;
- memcpy(Buff, (char*)Data, Len);
+ memcpy(Buff, (const char*)Data, Len);
Buff[Len] = 0;
int res = strcmp(Buff, Str);
return res == 0;
diff --git a/llvm/lib/Fuzzer/test/StrncmpTest.cpp b/llvm/lib/Fuzzer/test/StrncmpTest.cpp
index f71f01ee309..a40e05690a0 100644
--- a/llvm/lib/Fuzzer/test/StrncmpTest.cpp
+++ b/llvm/lib/Fuzzer/test/StrncmpTest.cpp
@@ -11,7 +11,7 @@ static volatile int sink;
extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) {
// TODO: check other sizes.
- char *S = (char*)Data;
+ const char *S = (const char*)Data;
if (Size >= 8 && strncmp(S, "123", 8))
sink = 1;
if (Size >= 8 && strncmp(S, "01234567", 8) == 0) {
diff --git a/llvm/lib/Fuzzer/test/value-profile-cmp2.test b/llvm/lib/Fuzzer/test/value-profile-cmp2.test
index 43d62400d97..d6a40447d79 100644
--- a/llvm/lib/Fuzzer/test/value-profile-cmp2.test
+++ b/llvm/lib/Fuzzer/test/value-profile-cmp2.test
@@ -1,2 +1,2 @@
CHECK: BINGO
-RUN: not LLVMFuzzer-SimpleHashTest -seed=1 -use_cmp=0 -use_value_profile=1 -runs=100000000 2>&1 | FileCheck %s
+RUN: not LLVMFuzzer-SimpleHashTest -seed=1 -use_cmp=0 -use_value_profile=1 -runs=100000000 -max_len=64 2>&1 | FileCheck %s
OpenPOWER on IntegriCloud