summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Fuzzer/test/CMakeLists.txt
Commit message (Collapse)AuthorAgeFilesLines
* Moving libFuzzer from LLVM to compiler-rt.George Karpenkov2017-08-211-66/+0
| | | | | | | | | This change only removes libFuzzer tests and CMake machinery, the source copy temporarily remains at the old location. Differential Revision: https://reviews.llvm.org/D36980 llvm-svn: 311405
* [libFuzzer tests] Only enable libFuzzer tests ifGeorge Karpenkov2017-08-041-17/+14
| | | | | | -DLIBFUZZER_ENABLE_TESTS=ON is set. llvm-svn: 310100
* Fixing buildbots: do not register check-fuzzer if clang or asan are notGeorge Karpenkov2017-08-041-12/+15
| | | | | | present. llvm-svn: 310077
* Drop Windows support from libFuzzer tests.George Karpenkov2017-08-041-41/+5
| | | | | | Differential Revision: https://reviews.llvm.org/D36205 llvm-svn: 310076
* Port libFuzzer tests to LIT. Do not require two-stage build for check-fuzzer.George Karpenkov2017-08-041-195/+18
| | | | | | | | | | | | | | | | | | | | | This revision ports all libFuzzer tests apart from the unittest to LIT. The advantages of doing so include: - Tests being self-contained - Much easier debugging of a single test - No need for using a two-stage compilation The unit-test is still compiled using CMake, but it does not need a freshly built compiler. NOTE: The previous two-stage bot configuration will NOT work, as in the second stage build LLVM_USE_SANITIZER is set, which disables ASAN from being built. Thus bots will be reconfigured in the next few commits. Differential Revision: https://reviews.llvm.org/D36295 llvm-svn: 310075
* [libFuzzer] temporarty remove pc-tables and disable ↵Kostya Serebryany2017-08-011-1/+1
| | | | | | test/fuzzer-printcovpcs.test until this can be fixed on Windows llvm-svn: 309716
* [libFuzzer] enable -fsanitize-coverage=pc-table for all testsKostya Serebryany2017-08-011-1/+1
| | | | llvm-svn: 309646
* Revert "Revert "[libFuzzer] Add a dependency on symbolizer from libFuzzer ↵George Karpenkov2017-07-241-1/+1
| | | | | | | | | | tests"" This reverts commit 15425f2bc6eac6249ee957a2a280511306c07547. Should work now that atos is a default symbolizer on Darwin. llvm-svn: 308910
* [libFuzzer] add DeepRecursionTest, inspired by ↵Kostya Serebryany2017-07-201-0/+1
| | | | | | https://guidovranken.wordpress.com/2017/07/08/libfuzzer-gv-new-techniques-for-dramatically-faster-fuzzing/ (Stack-depth-guided fuzzing). libFuzzer does not solve it yet. llvm-svn: 308571
* Fix fuzzer-flags.test on WindowsReid Kleckner2017-07-191-0/+1
| | | | | | | | | | | The optional external function callbacks have to be exported in order for them to be called. The test was failing because libFuzzer wasn't calling LLVMFuzzerInitialize. We can reconsider if this is the best way to mark these optional callbacks exported later. llvm-svn: 308548
* Revert "[libFuzzer] Add a dependency on symbolizer from libFuzzer tests"George Karpenkov2017-07-171-1/+1
| | | | | | | | This reverts commit 546e006a023cccd0fd32afd442ab992d3515d4b8. Reverting until I can figure out llvm-symbolizer breakages on mac os. llvm-svn: 308202
* [libFuzzer] Allow non-fuzzer args after -ignore_remaining_args=1Justin Bogner2017-07-141-0/+1
| | | | | | | | | | | With this change, libFuzzer will ignore any arguments after a sigil argument, but it will preserve these arguments at the end of the command line when launching subprocesses. Using this, its possible to handle positional and single-dash arguments to the program under test by discarding everything up to -ignore_remaining_args=1 in LLVMFuzzerInitialize. llvm-svn: 308069
* [libFuzzer] experimental feature -reduce_inputs (off by default) that tries ↵Kostya Serebryany2017-07-131-0/+1
| | | | | | to replace elements in the corpus with smaller ones that have the same feature set. Still needs tuning llvm-svn: 307873
* [libFuzzer] Add a dependency on symbolizer from libFuzzer testsGeorge Karpenkov2017-07-121-1/+1
| | | | | | | | | Some libFuzzer tests on Linux would fail with bizarre error messages unless llvm-symbolizer binary is present. Differential Revision: https://reviews.llvm.org/D35313 llvm-svn: 307826
* Fixing section name for Darwin platforms for sanitizer coverageGeorge Karpenkov2017-06-141-1/+1
| | | | | | On Darwin, section names have a 16char length limit. llvm-svn: 305429
* [libFuzzer] really restrict the new test to Linux (fails on Mac/Windows ↵Kostya Serebryany2017-06-141-1/+3
| | | | | | currently) llvm-svn: 305346
* [libFuzzer] initial support of -fsanitize-coverage=inline-8bit-counters in ↵Kostya Serebryany2017-06-131-0/+1
| | | | | | libFuzzer. This is not fully functional yet, but simple tests work llvm-svn: 305331
* [libFuzzer] make sure the input data is not overwritten in the fuzz target ↵Kostya Serebryany2017-05-091-0/+1
| | | | | | (if it is -- report an error) llvm-svn: 302494
* [libFuzzer] experimental option -cleanse_crash: tries to replace all bytes ↵Kostya Serebryany2017-04-171-0/+1
| | | | | | in a crash reproducer with garbage, while still preserving the crash llvm-svn: 300498
* [libFuzzer] best effort support for -fsanitize-coverage=trace-pc ↵Kostya Serebryany2017-03-301-0/+1
| | | | | | instrumentation. It is less efficient and precise than -fsanitize-coverage=trace-pc-guard, but still works llvm-svn: 299046
* [libFuzzer] be more careful when calling strlen of strcmp parameters, PR32357Kostya Serebryany2017-03-241-0/+1
| | | | llvm-svn: 298746
* [libFuzzer] create experimental support for user-provided coverage signalKostya Serebryany2017-03-231-0/+1
| | | | llvm-svn: 298654
* [libFuzzer] add a test with two different bugsKostya Serebryany2017-03-171-0/+1
| | | | llvm-svn: 298030
* [fuzzer] Don't crash if LLVMFuzzerMutate was called by CustomCrossOverVitaly Buka2017-03-071-0/+1
| | | | | | | | | | Reviewers: kcc Subscribers: llvm-commits, mgorny Differential Revision: https://reviews.llvm.org/D30682 llvm-svn: 297202
* [libFuzzer] increase the size of FixedWord from 27 to 64, see PR31950Kostya Serebryany2017-02-141-0/+1
| | | | llvm-svn: 295117
* [libFuzzer] Export external functions on tests.Marcos Pividori2017-02-101-0/+12
| | | | | | | | | | | | | We need to export external functions so they are found when calling GetProcAddress() on Windows. But we can't use `__declspec(dllexport)` because we want the targets to be completely independent from the fuzz engines and don't depend on other header files. Also, we don't want to include platform specific code managed with conditional macros. So, the solution is to add the exported symbols with linker flags in cmake. Differential revision: https://reviews.llvm.org/D29752 llvm-svn: 294688
* [libFuzzer] Use custom target instead of list of binaries for tests.Marcos Pividori2017-02-081-8/+7
| | | | | | | | | | Update cmake to use a custom target TestBinaries instead of a list of targets. This simplifies cmake, and fix some errors. This way, we don't have to propagate the values into parents directories. We only need to use add_dependencies. Differential Revision: https://reviews.llvm.org/D29593 llvm-svn: 294389
* [libFuzzer] Add features `windows` and `posix` for lit tests.Marcos Pividori2017-02-011-0/+4
| | | | | | | | | | | | Add 2 features: posix and windows. Sometimes we want some specific tests only for posix and we use: REQUIRES: posix Sometimes we want some specific tests only for windows and we use: REQUIRES: windows Differential Revision: https://reviews.llvm.org/D29418 llvm-svn: 293827
* [libFuzzer] make sure we use the feedback from std::string operator ==Kostya Serebryany2017-01-231-0/+1
| | | | llvm-svn: 292835
* [libFuzzer] Add missing dependency for tests.Marcos Pividori2017-01-221-0/+1
| | | | | | Dependency on TestBinaries was erroneously removed on r292735. llvm-svn: 292765
* [libFuzzer] Specify the CRT considered (MT or MD) for tests on Windows.Marcos Pividori2017-01-221-2/+9
| | | | | | Differential Revision: https://reviews.llvm.org/D28439 llvm-svn: 292749
* [libFuzzer] Fix test with shared libraries on Windows.Marcos Pividori2017-01-221-4/+14
| | | | | | | | | | | | | | | | | | We need to set BINARY_DIR to: ${CMAKE_BINARY_DIR}/lib/Fuzzer/test , so the dll is placed in the same directory than the test LLVMFuzzer-DSOTest, and is found when executing that test. As we are using CMAKE_CXX_CREATE_SHARED_LIBRARY to link the dll, we can't modify the output directory for the import library. It will be created in the same directory than the dll (in BINARY_DIR), no matter which value we set to LIBRARY_DIR. So, if we set LIBRARY_DIR to a different directory than BINARY_DIR, when linking LLVMFuzzer-DSOTest, cmake will look for the import library LLVMFuzzer-DSO1.lib in LIBRARY_DIR, and won't find it, since it was created in BINARY_DIR. So, for Windows, we need that LIBRARY_DIR and BINARY_DIR are the same directory. Differential Revision: https://reviews.llvm.org/D27870 llvm-svn: 292748
* [libFuzzer] Leak Sanitizer is not supported for Windows.Marcos Pividori2017-01-221-3/+3
| | | | | | Differential Revision: https://reviews.llvm.org/D28709 llvm-svn: 292745
* [libFuzzer] Remove optimization flags for tests.Marcos Pividori2017-01-221-11/+1
| | | | | | | | | | | We need to build all the tests with -O0, otherwise optimizations may merge some basic blocks and the tests will fail. In this diff, I simplify the cmake implementation and I remove the flags for Windows too (/O[123s]). Differential Revision: https://reviews.llvm.org/D28632 llvm-svn: 292737
* [libFuzzer] Remove dependencies for tests on Windows.Marcos Pividori2017-01-221-1/+6
| | | | | | | | | | | | Remove dependency on FileCheck, sancov and not for tests on Windows. If LLVM_USE_SANITIZER=Address and LLVM_USE_SANITIZE_COVERAGE=YES, this will trigger the building of dependencies with sanitizer instrumentation. This will fail in Windows, since cmake will use link.exe for linking and won't include compiler-rt libraries. Differential Revision: https://reviews.llvm.org/D27993 llvm-svn: 292735
* [libFuzzer] Use clang as linker on Windows, to properly include sanitizer ↵Marcos Pividori2017-01-201-0/+15
| | | | | | | | | | | | | | | | | | | libraries. In order to use sanitizers on Windows, we need to link against many runtime libraries which will depend on the target being created (executable or dll) and the c runtime library used (MT/MD). By default, cmake uses link.exe for linking, which fails because we don't specify the appropiate dependencies. As we don't want to consider all of that possible situations which depends on the implementation of the compiler-rt, the simplest option is to change the rules for linking executables and shared libraries, using the compiler instead of link.exe. Clang driver will consider the sanitizer flags, and automatically provide the required libraries to the linker. Differential Revision: https://reviews.llvm.org/D27869 llvm-svn: 292669
* [libFuzzer] Properly use compiler options supported on Windows.Marcos Pividori2017-01-201-1/+1
| | | | | | | | Replace "-g" by "-gline-tables-only". "-g" is not supported by clang-cl. Differential Revision: https://reviews.llvm.org/D27868 llvm-svn: 292668
* [libFuzzer] add an assert to protect against LLVMFuzzerInitialize changing ↵Kostya Serebryany2017-01-201-0/+1
| | | | | | argv[0] llvm-svn: 292652
* [libFuzzer] improve -minimize_crash: honor -artifact_prefix= and don't ↵Kostya Serebryany2017-01-191-0/+1
| | | | | | special case 2-byte inputs llvm-svn: 292511
* [libFuzzer] add two tests for experimenting with equivalence fuzzingKostya Serebryany2017-01-191-0/+2
| | | | llvm-svn: 292509
* [libfuzzer] fixing collected pc addresses for coverageMike Aizatsky2017-01-171-2/+1
| | | | | | | | | | | | Summary: The causes google/ossfuzz#84 Reviewers: kcc Subscribers: mgorny Differential Revision: https://reviews.llvm.org/D28827 llvm-svn: 292289
* [libfuzzer] removing experimental FuzzerFnAdapterMike Aizatsky2016-12-171-2/+0
| | | | | | | | | | | | Summary: This is superceded by protobuf mutation work. Reviewers: kcc Subscribers: mgorny Differential Revision: https://reviews.llvm.org/D27865 llvm-svn: 290018
* [libFuzzer] Fix bug in detecting timeouts when input string is empty.Marcos Pividori2016-12-131-0/+1
| | | | | | | | | | | | | | I added a new flag RunningCB to know if the Fuzzer's main thread is running the CB function, instead of using (!CurrentUnitSize). (!CurrentUnitSize) doesn't work properly. For example, in FuzzerLoop.cpp, inside ShuffleAndMinimize() function, we execute the callback with an empty string (size=0). Previous implementation failed to detect timeouts in that execution. Also, I add a regression test for that case. Differential Revision: https://reviews.llvm.org/D27433 llvm-svn: 289561
* [libFuzzer] build libFuzzer itself with asanKostya Serebryany2016-12-121-1/+1
| | | | llvm-svn: 289469
* [libFuzzer] test cleanup (3)Kostya Serebryany2016-12-101-1/+0
| | | | llvm-svn: 289314
* [libFuzzer] test cleanupKostya Serebryany2016-12-101-1/+23
| | | | llvm-svn: 289312
* [libFuzzer] switch all libFuzzer tests to use ↵Kostya Serebryany2016-12-101-2/+1
| | | | | | -fsanitize-coverage=trace-pc-guard. Support for the previosly used instrumentation will be removed in the following changes llvm-svn: 289311
* [libFuzzer] extend -rss_limit_mb to crash instantly on a single malloc that ↵Kostya Serebryany2016-11-301-0/+1
| | | | | | exceeds the limit llvm-svn: 288281
* [libFuzzer] add StandaloneFuzzTargetMain.c and a test for itKostya Serebryany2016-10-251-0/+12
| | | | llvm-svn: 285135
* [libFuzzer] add a test for asan's strict_string_checks=1Kostya Serebryany2016-10-221-0/+1
| | | | llvm-svn: 284902
OpenPOWER on IntegriCloud