forked from OSchip/llvm-project
[lib/Fuzzer] build tests that work well with dfsan also w/o dfsan
llvm-svn: 236909
This commit is contained in:
parent
a704600295
commit
f3f3ed323a
|
@ -4,6 +4,11 @@
|
|||
# for the Fuzzer lib)
|
||||
set(CMAKE_CXX_FLAGS_RELEASE "${LIBFUZZER_FLAGS_BASE} -O0 -fsanitize-coverage=edge,indirect-calls")
|
||||
|
||||
set(DFSanTests
|
||||
DFSanMemcmpTest
|
||||
DFSanSimpleCmpTest
|
||||
)
|
||||
|
||||
set(Tests
|
||||
CounterTest
|
||||
CxxTokensTest
|
||||
|
@ -13,12 +18,9 @@ set(Tests
|
|||
NullDerefTest
|
||||
SimpleTest
|
||||
TimeoutTest
|
||||
${DFSanTests}
|
||||
)
|
||||
|
||||
set(DFSanTests
|
||||
DFSanMemcmpTest
|
||||
DFSanSimpleCmpTest
|
||||
)
|
||||
|
||||
set(TestBinaries)
|
||||
|
||||
|
@ -60,7 +62,7 @@ set(TestBinaries ${TestBinaries} LLVMFuzzer-Unittest)
|
|||
add_subdirectory(dfsan)
|
||||
|
||||
foreach(Test ${DFSanTests})
|
||||
set(TestBinaries ${TestBinaries} LLVMFuzzer-${Test})
|
||||
set(TestBinaries ${TestBinaries} LLVMFuzzer-${Test}-DFSan)
|
||||
endforeach()
|
||||
|
||||
|
||||
|
|
|
@ -4,10 +4,10 @@ set(CMAKE_CXX_FLAGS_RELEASE
|
|||
"${LIBFUZZER_FLAGS_BASE} -O0 -fno-sanitize=all -fsanitize=dataflow")
|
||||
|
||||
foreach(Test ${DFSanTests})
|
||||
add_executable(LLVMFuzzer-${Test}
|
||||
${Test}.cpp
|
||||
add_executable(LLVMFuzzer-${Test}-DFSan
|
||||
../${Test}.cpp
|
||||
)
|
||||
target_link_libraries(LLVMFuzzer-${Test}
|
||||
target_link_libraries(LLVMFuzzer-${Test}-DFSan
|
||||
LLVMFuzzer
|
||||
)
|
||||
endforeach()
|
||||
|
|
|
@ -19,9 +19,9 @@ RUN: not ./LLVMFuzzer-FourIndependentBranchesTest -timeout=15 -seed=1 -use_cover
|
|||
|
||||
RUN: not ./LLVMFuzzer-CounterTest -use_counters=1 -max_len=6 -seed=1 -timeout=15 2>&1 | FileCheck %s
|
||||
|
||||
RUN: not ./LLVMFuzzer-DFSanSimpleCmpTest -seed=1 -runs=1000000 -timeout=5 2>&1 | FileCheck %s
|
||||
RUN: not ./LLVMFuzzer-DFSanSimpleCmpTest-DFSan -seed=1 -runs=1000000 -timeout=5 2>&1 | FileCheck %s
|
||||
|
||||
RUN: not ./LLVMFuzzer-DFSanMemcmpTest -seed=1 -runs=100 -timeout=5 2>&1 | FileCheck %s
|
||||
RUN: not ./LLVMFuzzer-DFSanMemcmpTest-DFSan -seed=1 -runs=100 -timeout=5 2>&1 | FileCheck %s
|
||||
|
||||
RUN: not ./LLVMFuzzer-CxxTokensTest -seed=1 -timeout=15 -tokens=%S/../cxx_fuzzer_tokens.txt 2>&1 | FileCheck %s
|
||||
|
||||
|
|
Loading…
Reference in New Issue