diff options
Diffstat (limited to 'llvm/lib/Fuzzer/test')
| -rw-r--r-- | llvm/lib/Fuzzer/test/CMakeLists.txt | 37 | ||||
| -rw-r--r-- | llvm/lib/Fuzzer/test/ExactTest.cpp | 22 | ||||
| -rw-r--r-- | llvm/lib/Fuzzer/test/InfiniteTest.cpp | 20 | ||||
| -rw-r--r-- | llvm/lib/Fuzzer/test/NullDerefTest.cpp | 22 | ||||
| -rw-r--r-- | llvm/lib/Fuzzer/test/SimpleTest.cpp | 21 | ||||
| -rw-r--r-- | llvm/lib/Fuzzer/test/TestFuzzerCrossOver.cpp | 13 | ||||
| -rw-r--r-- | llvm/lib/Fuzzer/test/TimeoutTest.cpp | 22 | ||||
| -rw-r--r-- | llvm/lib/Fuzzer/test/fuzzer.test | 13 | ||||
| -rw-r--r-- | llvm/lib/Fuzzer/test/lit.cfg | 6 | ||||
| -rw-r--r-- | llvm/lib/Fuzzer/test/lit.site.cfg.in | 2 |
10 files changed, 0 insertions, 178 deletions
diff --git a/llvm/lib/Fuzzer/test/CMakeLists.txt b/llvm/lib/Fuzzer/test/CMakeLists.txt deleted file mode 100644 index 0c2118f31b0..00000000000 --- a/llvm/lib/Fuzzer/test/CMakeLists.txt +++ /dev/null @@ -1,37 +0,0 @@ -set(Tests - ExactTest - InfiniteTest - NullDerefTest - SimpleTest - TimeoutTest - ) - -set(TestBinaries) - -foreach(Test ${Tests}) - add_executable(LLVMFuzzer-${Test} - EXCLUDE_FROM_ALL - ${Test}.cpp - ) - target_link_libraries(LLVMFuzzer-${Test} - LLVMFuzzer - ) - set(TestBinaries ${TestBinaries} LLVMFuzzer-${Test}) -endforeach() - -set_target_properties(${TestBinaries} - PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} - ) - -set(EXCLUDE_FROM_ALL TRUE) -add_lit_testsuite(check-fuzzer "Running Fuzzer tests" - ${CMAKE_CURRENT_BINARY_DIR} - DEPENDS ${TestBinaries} - ) -set(EXCLUDE_FROM_ALL FALSE) - -configure_lit_site_cfg( - ${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.in - ${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg - ) - diff --git a/llvm/lib/Fuzzer/test/ExactTest.cpp b/llvm/lib/Fuzzer/test/ExactTest.cpp deleted file mode 100644 index c9898f3c811..00000000000 --- a/llvm/lib/Fuzzer/test/ExactTest.cpp +++ /dev/null @@ -1,22 +0,0 @@ -// Simple test for a fuzzer. The fuzzer must find the string "FUZZER". -#include <cstdint> -#include <cstdlib> -#include <cstddef> -#include <iostream> - -static volatile int Sink; - -extern "C" void TestOneInput(const uint8_t *Data, size_t Size) { - int bits = 0; - if (Size > 0 && Data[0] == 'F') bits |= 1; - if (Size > 1 && Data[1] == 'U') bits |= 2; - if (Size > 2 && Data[2] == 'Z') bits |= 4; - if (Size > 3 && Data[3] == 'Z') bits |= 8; - if (Size > 4 && Data[4] == 'E') bits |= 16; - if (Size > 5 && Data[5] == 'R') bits |= 32; - if (bits == 63) { - std::cerr << "BINGO!\n"; - abort(); - } -} - diff --git a/llvm/lib/Fuzzer/test/InfiniteTest.cpp b/llvm/lib/Fuzzer/test/InfiniteTest.cpp deleted file mode 100644 index ee1635d1996..00000000000 --- a/llvm/lib/Fuzzer/test/InfiniteTest.cpp +++ /dev/null @@ -1,20 +0,0 @@ -// Simple test for a fuzzer. The fuzzer must find the string "Hi!". -#include <cstdint> -#include <cstdlib> -#include <cstddef> -#include <iostream> - -static volatile int Sink; - -extern "C" void TestOneInput(const uint8_t *Data, size_t Size) { - if (Size > 0 && Data[0] == 'H') { - Sink = 1; - if (Size > 1 && Data[1] == 'i') { - Sink = 2; - if (Size > 2 && Data[2] == '!') { - Size = 2; - } - } - } -} - diff --git a/llvm/lib/Fuzzer/test/NullDerefTest.cpp b/llvm/lib/Fuzzer/test/NullDerefTest.cpp deleted file mode 100644 index 8811e386f9d..00000000000 --- a/llvm/lib/Fuzzer/test/NullDerefTest.cpp +++ /dev/null @@ -1,22 +0,0 @@ -// Simple test for a fuzzer. The fuzzer must find the string "Hi!". -#include <cstdint> -#include <cstdlib> -#include <cstddef> -#include <iostream> - -static volatile int Sink; -static volatile int *Null = 0; - -extern "C" void TestOneInput(const uint8_t *Data, size_t Size) { - if (Size > 0 && Data[0] == 'H') { - Sink = 1; - if (Size > 1 && Data[1] == 'i') { - Sink = 2; - if (Size > 2 && Data[2] == '!') { - std::cout << "Found the target, dereferencing NULL\n"; - *Null = 1; - } - } - } -} - diff --git a/llvm/lib/Fuzzer/test/SimpleTest.cpp b/llvm/lib/Fuzzer/test/SimpleTest.cpp deleted file mode 100644 index adb90cebe86..00000000000 --- a/llvm/lib/Fuzzer/test/SimpleTest.cpp +++ /dev/null @@ -1,21 +0,0 @@ -// Simple test for a fuzzer. The fuzzer must find the string "Hi!". -#include <cstdint> -#include <cstdlib> -#include <cstddef> -#include <iostream> - -static volatile int Sink; - -extern "C" void TestOneInput(const uint8_t *Data, size_t Size) { - if (Size > 0 && Data[0] == 'H') { - Sink = 1; - if (Size > 1 && Data[1] == 'i') { - Sink = 2; - if (Size > 2 && Data[2] == '!') { - std::cout << "Found the target, exiting\n"; - exit(0); - } - } - } -} - diff --git a/llvm/lib/Fuzzer/test/TestFuzzerCrossOver.cpp b/llvm/lib/Fuzzer/test/TestFuzzerCrossOver.cpp deleted file mode 100644 index 7f7619618ec..00000000000 --- a/llvm/lib/Fuzzer/test/TestFuzzerCrossOver.cpp +++ /dev/null @@ -1,13 +0,0 @@ -#include "FuzzerInternal.h" - -int main() { - using namespace fuzzer; - Unit A({0, 1, 2, 3, 4}), B({5, 6, 7, 8, 9}); - Unit C; - for (size_t Len = 1; Len < 15; Len++) { - for (int Iter = 0; Iter < 1000; Iter++) { - CrossOver(A, B, &C, Len); - Print(C); - } - } -} diff --git a/llvm/lib/Fuzzer/test/TimeoutTest.cpp b/llvm/lib/Fuzzer/test/TimeoutTest.cpp deleted file mode 100644 index 266ead646a5..00000000000 --- a/llvm/lib/Fuzzer/test/TimeoutTest.cpp +++ /dev/null @@ -1,22 +0,0 @@ -// Simple test for a fuzzer. The fuzzer must find the string "Hi!". -#include <cstdint> -#include <cstdlib> -#include <cstddef> -#include <iostream> - -static volatile int Sink; - -extern "C" void TestOneInput(const uint8_t *Data, size_t Size) { - if (Size > 0 && Data[0] == 'H') { - Sink = 1; - if (Size > 1 && Data[1] == 'i') { - Sink = 2; - if (Size > 2 && Data[2] == '!') { - Size = 2; - while (Sink) - ; - } - } - } -} - diff --git a/llvm/lib/Fuzzer/test/fuzzer.test b/llvm/lib/Fuzzer/test/fuzzer.test deleted file mode 100644 index 5f013109f62..00000000000 --- a/llvm/lib/Fuzzer/test/fuzzer.test +++ /dev/null @@ -1,13 +0,0 @@ -RUN: ./LLVMFuzzer-SimpleTest 2>&1 | FileCheck %s --check-prefix=SimpleTest -SimpleTest: Found the target, exiting - -RUN: not ./LLVMFuzzer-InfiniteTest -timeout=2 2>&1 | FileCheck %s --check-prefix=InfiniteTest -InfiniteTest: ALARM: working on the last Unit for -InfiniteTest-NOT: CRASHED; file written to timeout - -RUN: not ./LLVMFuzzer-TimeoutTest -timeout=5 2>&1 | FileCheck %s --check-prefix=TimeoutTest -TimeoutTest: ALARM: working on the last Unit for -TimeoutTest: CRASHED; file written to timeout - -RUN: not ./LLVMFuzzer-NullDerefTest 2>&1 | FileCheck %s --check-prefix=NullDerefTest -NullDerefTest: CRASHED; file written to crash- diff --git a/llvm/lib/Fuzzer/test/lit.cfg b/llvm/lib/Fuzzer/test/lit.cfg deleted file mode 100644 index d1c85051b47..00000000000 --- a/llvm/lib/Fuzzer/test/lit.cfg +++ /dev/null @@ -1,6 +0,0 @@ -import lit.formats - -config.name = "LLVMFuzzer" -config.test_format = lit.formats.ShTest(True) -config.suffixes = ['.test'] -config.test_source_root = os.path.dirname(__file__) diff --git a/llvm/lib/Fuzzer/test/lit.site.cfg.in b/llvm/lib/Fuzzer/test/lit.site.cfg.in deleted file mode 100644 index 5fedc1dff6f..00000000000 --- a/llvm/lib/Fuzzer/test/lit.site.cfg.in +++ /dev/null @@ -1,2 +0,0 @@ -config.test_exec_root = "@CMAKE_CURRENT_BINARY_DIR@" -lit_config.load_config(config, "@CMAKE_CURRENT_SOURCE_DIR@/lit.cfg") |

