summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Fuzzer/test/fuzzer-leak.test
diff options
context:
space:
mode:
authorKostya Serebryany <kcc@google.com>2016-04-20 00:24:21 +0000
committerKostya Serebryany <kcc@google.com>2016-04-20 00:24:21 +0000
commit1bfd583d82963cddf839fb0d8c9254cd3a967631 (patch)
tree59304c967c9b80d7de3e133f20de3311deb87dda /llvm/lib/Fuzzer/test/fuzzer-leak.test
parentea0b1e7c17eee8b514c026fbb30dc515bdf1c4bd (diff)
downloadbcm5719-llvm-1bfd583d82963cddf839fb0d8c9254cd3a967631.tar.gz
bcm5719-llvm-1bfd583d82963cddf839fb0d8c9254cd3a967631.zip
[libFuzzer] added -detect_leaks flag (0 by default for now). When enabled, it will help finding leaks while fuzzing
llvm-svn: 266838
Diffstat (limited to 'llvm/lib/Fuzzer/test/fuzzer-leak.test')
-rw-r--r--llvm/lib/Fuzzer/test/fuzzer-leak.test20
1 files changed, 17 insertions, 3 deletions
diff --git a/llvm/lib/Fuzzer/test/fuzzer-leak.test b/llvm/lib/Fuzzer/test/fuzzer-leak.test
index 3690068371f..25c1f45978c 100644
--- a/llvm/lib/Fuzzer/test/fuzzer-leak.test
+++ b/llvm/lib/Fuzzer/test/fuzzer-leak.test
@@ -1,6 +1,20 @@
-RUN: not LLVMFuzzer-LeakTest -runs=10 2>&1 | FileCheck %s --check-prefix=LEAK
-LEAK: ERROR: LeakSanitizer: detected memory leaks
-LEAK-NOT: DEATH:
+RUN: not LLVMFuzzer-LeakTest -runs=100000 -detect_leaks=1 2>&1 | FileCheck %s --check-prefix=LEAK_DURING
+LEAK_DURING: ERROR: LeakSanitizer: detected memory leaks
+LEAK_DURING: Direct leak of 4 byte(s) in 1 object(s) allocated from:
+LEAK_DURING-NOT: DONE
+LEAK_DURING-NOT: Done
+LEAK_DURING-NOT: DEATH:
+
+RUN: not LLVMFuzzer-LeakTest -runs=0 -detect_leaks=1 %S 2>&1 | FileCheck %s --check-prefix=LEAK_IN_CORPUS
+LEAK_IN_CORPUS: ERROR: LeakSanitizer: detected memory leaks
+LEAK_IN_CORPUS: ERROR: libFuzzer: initial corpus triggers memory leaks.
+
+
+RUN: not LLVMFuzzer-LeakTest -runs=100000 -detect_leaks=0 2>&1 | FileCheck %s --check-prefix=LEAK_AFTER
+RUN: not LLVMFuzzer-LeakTest -runs=100000 2>&1 | FileCheck %s --check-prefix=LEAK_AFTER
+LEAK_AFTER: Done 100000 runs in
+LEAK_AFTER: ERROR: LeakSanitizer: detected memory leaks
+LEAK_AFTER-NOT: DEATH:
RUN: not LLVMFuzzer-LeakTimeoutTest -timeout=1 2>&1 | FileCheck %s --check-prefix=LEAK_TIMEOUT
LEAK_TIMEOUT: ERROR: libFuzzer: timeout after
OpenPOWER on IntegriCloud