]> granicus.if.org Git - llvm/commitdiff
[libFuzzer] switch all libFuzzer tests to use -fsanitize-coverage=trace-pc-guard...
authorKostya Serebryany <kcc@google.com>
Sat, 10 Dec 2016 02:26:23 +0000 (02:26 +0000)
committerKostya Serebryany <kcc@google.com>
Sat, 10 Dec 2016 02:26:23 +0000 (02:26 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289311 91177308-0d34-0410-b5e6-96231b3b80d8

cmake/modules/HandleLLVMOptions.cmake
lib/Fuzzer/test/CMakeLists.txt
lib/Fuzzer/test/caller-callee.test [new file with mode: 0644]
lib/Fuzzer/test/fuzzer.test
lib/Fuzzer/test/no-coverage/CMakeLists.txt
lib/Fuzzer/test/trace-pc/CMakeLists.txt
lib/Fuzzer/test/uninstrumented/CMakeLists.txt

index a2a71f666eaf0097a4ddc370524be19cb368fa07..964fa59c0baef020acf4a99d6895b0e80f68e669 100644 (file)
@@ -567,7 +567,7 @@ if(LLVM_USE_SANITIZER)
     message(FATAL_ERROR "LLVM_USE_SANITIZER is not supported on this platform.")
   endif()
   if (LLVM_USE_SANITIZE_COVERAGE)
-    append("-fsanitize-coverage=edge,indirect-calls,8bit-counters,trace-cmp" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
+    append("-fsanitize-coverage=trace-pc-guard,indirect-calls,trace-cmp" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
   endif()
 endif()
 
index a664e944585586deaaecc76e47afeb057a81cd05..fddb1517f1e47d424effdd06756ccc95e194d7a0 100644 (file)
@@ -25,8 +25,7 @@ foreach (VARNAME ${variables_to_filter})
 endforeach()
 
 # Enable the coverage instrumentation (it is disabled for the Fuzzer lib).
-#set(CMAKE_CXX_FLAGS "${LIBFUZZER_FLAGS_BASE} -fno-sanitize-coverage=8bit-counters  -fsanitize-coverage=edge,indirect-calls,trace-cmp,trace-div,trace-gep,trace-pc-guard -g")
-set(CMAKE_CXX_FLAGS "${LIBFUZZER_FLAGS_BASE} -fsanitize-coverage=edge,indirect-calls,trace-cmp,trace-div,trace-gep -g")
+set(CMAKE_CXX_FLAGS "${LIBFUZZER_FLAGS_BASE} -fsanitize-coverage=trace-pc-guard,indirect-calls,trace-cmp,trace-div,trace-gep -g")
 
 # add_libfuzzer_test(<name>
 #   SOURCES source0.cpp [source1.cpp ...]
diff --git a/lib/Fuzzer/test/caller-callee.test b/lib/Fuzzer/test/caller-callee.test
new file mode 100644 (file)
index 0000000..cbe631c
--- /dev/null
@@ -0,0 +1,2 @@
+CHECK: BINGO
+RUN: not LLVMFuzzer-CallerCalleeTest          -use_value_profile=1 -cross_over=0 -max_len=6 -seed=1 -max_total_time=15 2>&1 | FileCheck %s
index ccca3d33fc50ce5962ad40a331f658b435d954c6..0fc9ff9aebe2e2af00ccb26c33edf8690b429625 100644 (file)
@@ -32,11 +32,6 @@ COUNTERS: NEW {{.*}} {{bits:|ft:}} {{[1-9]*}}
 COUNTERS: NEW {{.*}} {{bits:|ft:}} {{[1-9]*}}
 COUNTERS: BINGO
 
-RUN: not LLVMFuzzer-CallerCalleeTest          -use_value_profile=1 -cross_over=0 -max_len=6 -seed=1 -max_total_time=15 2>&1 | FileCheck %s
-RUN: not LLVMFuzzer-CallerCalleeTest-TracePC  -use_value_profile=1 -cross_over=0 -max_len=6 -seed=1 -max_total_time=15 2>&1 | FileCheck %s
-# This one is flaky, may actually find the goal even w/o use_indir_calls.
-# LLVMFuzzer-CallerCalleeTest  -use_indir_calls=0 -cross_over=0 -max_len=6 -seed=1 -runs=1000000 2>&1 | FileCheck %s  --check-prefix=Done1000000
-
 RUN: not LLVMFuzzer-UninstrumentedTest-Uninstrumented 2>&1 | FileCheck %s --check-prefix=UNINSTRUMENTED
 UNINSTRUMENTED: ERROR: __sanitizer_set_death_callback is not defined. Exiting.
 
index e0e68499ef09dbc80c222597883c5ec79f670a63..d2f6f438ad79d85ecda0d8053231a509c4b97cb0 100644 (file)
@@ -2,7 +2,7 @@
 # but have coverage rt in the binary.
 
 set(CMAKE_CXX_FLAGS
-  "${LIBFUZZER_FLAGS_BASE} -fno-sanitize-coverage=edge,trace-cmp,indirect-calls,8bit-counters")
+  "${LIBFUZZER_FLAGS_BASE} -fno-sanitize-coverage=edge,trace-cmp,indirect-calls,8bit-counters,trace-pc-guard")
 
 set(NoCoverageTests
   UninstrumentedTest
index d5caa188ed4fbb9f2ad0b1816d5bf693eae6e38a..91becaef15b2e6d896dae6d375dde82d6873782e 100644 (file)
@@ -1,7 +1,7 @@
 # These tests are not instrumented with coverage.
 
 set(CMAKE_CXX_FLAGS
-  "${LIBFUZZER_FLAGS_BASE} -fno-sanitize-coverage=8bit-counters -fsanitize-coverage=trace-pc-guard")
+  "${LIBFUZZER_FLAGS_BASE} ")
 
 set(TracePCTests
   SimpleTest
index 06e48985e7efbab3ba2ec45993494ffd22023957..29b66e6e586a6c8a30551bb563a91cdf5b2920fa 100644 (file)
@@ -2,7 +2,7 @@
 # have coverage rt in the binary.
 
 set(CMAKE_CXX_FLAGS
-  "${LIBFUZZER_FLAGS_BASE} -fno-sanitize=all -fno-sanitize-coverage=edge,trace-cmp,indirect-calls,8bit-counters")
+  "${LIBFUZZER_FLAGS_BASE} -fno-sanitize=all -fno-sanitize-coverage=edge,trace-cmp,indirect-calls,8bit-counters,trace-pc-guard")
 
 set(UninstrumentedTests
   UninstrumentedTest