summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Fuzzer/test/ShrinkControlFlowTest.cpp
diff options
context:
space:
mode:
authorKostya Serebryany <kcc@google.com>2017-08-04 23:49:53 +0000
committerKostya Serebryany <kcc@google.com>2017-08-04 23:49:53 +0000
commita84a6c1e484e40a2b37c0f95cc9c88a466c078d7 (patch)
treeb23a864a7c8bd676ced13a4515de10e253df9866 /llvm/lib/Fuzzer/test/ShrinkControlFlowTest.cpp
parent4a8a0a2a88df617e002d62034849db8b432092c6 (diff)
downloadbcm5719-llvm-a84a6c1e484e40a2b37c0f95cc9c88a466c078d7.tar.gz
bcm5719-llvm-a84a6c1e484e40a2b37c0f95cc9c88a466c078d7.zip
[libFuzzer] use the in-binary pc table (instead of PCs captured at run-time) to implement -exit_on_src_pos
llvm-svn: 310151
Diffstat (limited to 'llvm/lib/Fuzzer/test/ShrinkControlFlowTest.cpp')
-rw-r--r--llvm/lib/Fuzzer/test/ShrinkControlFlowTest.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/llvm/lib/Fuzzer/test/ShrinkControlFlowTest.cpp b/llvm/lib/Fuzzer/test/ShrinkControlFlowTest.cpp
index d0954296362..1957c1f90fc 100644
--- a/llvm/lib/Fuzzer/test/ShrinkControlFlowTest.cpp
+++ b/llvm/lib/Fuzzer/test/ShrinkControlFlowTest.cpp
@@ -10,6 +10,10 @@
static volatile int Sink;
+void Foo() {
+ Sink++;
+}
+
extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) {
int8_t Ids[256];
memset(Ids, -1, sizeof(Ids));
@@ -20,8 +24,7 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) {
int U = Ids[(unsigned char)'U'];
int Z = Ids[(unsigned char)'Z'];
if (F >= 0 && U > F && Z > U) {
- Sink++;
- //fprintf(stderr, "IDS: %d %d %d\n", F, U, Z);
+ Foo();
}
return 0;
}
OpenPOWER on IntegriCloud