diff options
author | Kostya Serebryany <kcc@google.com> | 2015-05-19 22:12:57 +0000 |
---|---|---|
committer | Kostya Serebryany <kcc@google.com> | 2015-05-19 22:12:57 +0000 |
commit | 490bbd6fa427ef320da238f40238ba6cfa85ddc0 (patch) | |
tree | be008dfaade17c4509c7e5a9b54622151e676f3b /llvm/lib/Fuzzer/test/InfiniteTest.cpp | |
parent | ff0e9ade5abf24b8d10b8b705374c153ab649ece (diff) | |
download | bcm5719-llvm-490bbd6fa427ef320da238f40238ba6cfa85ddc0.tar.gz bcm5719-llvm-490bbd6fa427ef320da238f40238ba6cfa85ddc0.zip |
[lib/Fuzzer] change the meaning of -timeout flag: now timeout is applied to every unit of work separately
llvm-svn: 237735
Diffstat (limited to 'llvm/lib/Fuzzer/test/InfiniteTest.cpp')
-rw-r--r-- | llvm/lib/Fuzzer/test/InfiniteTest.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/llvm/lib/Fuzzer/test/InfiniteTest.cpp b/llvm/lib/Fuzzer/test/InfiniteTest.cpp index 7c5c8c12713..b6d174ffdc9 100644 --- a/llvm/lib/Fuzzer/test/InfiniteTest.cpp +++ b/llvm/lib/Fuzzer/test/InfiniteTest.cpp @@ -6,6 +6,8 @@ static volatile int Sink; +static volatile int One = 1; + extern "C" void LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) { if (Size > 0 && Data[0] == 'H') { Sink = 1; @@ -13,6 +15,8 @@ extern "C" void LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) { Sink = 2; if (Size > 2 && Data[2] == '!') { Sink = 2; + while (One) + ; } } } |