2016-06-07 06:44:39 +02:00
|
|
|
REQUIRES: lsan
|
2017-08-04 19:19:45 +02:00
|
|
|
RUN: %cpp_compiler %S/LeakTest.cpp -o %t-LLVMFuzzer-LeakTest
|
|
|
|
RUN: %cpp_compiler %S/ThreadedLeakTest.cpp -o %t-LLVMFuzzer-ThreadedLeakTest
|
|
|
|
RUN: %cpp_compiler %S/LeakTimeoutTest.cpp -o %t-LLVMFuzzer-LeakTimeoutTest
|
|
|
|
|
|
|
|
RUN: not %t-LLVMFuzzer-LeakTest -runs=100000 -detect_leaks=1 2>&1 | FileCheck %s --check-prefix=LEAK_DURING
|
2016-04-20 02:24:21 +02:00
|
|
|
LEAK_DURING: ERROR: LeakSanitizer: detected memory leaks
|
|
|
|
LEAK_DURING: Direct leak of 4 byte(s) in 1 object(s) allocated from:
|
2016-07-15 19:19:43 +02:00
|
|
|
LEAK_DURING: INFO: to ignore leaks on libFuzzer side use -detect_leaks=0
|
|
|
|
LEAK_DURING: Test unit written to ./leak-
|
2016-04-20 02:24:21 +02:00
|
|
|
LEAK_DURING-NOT: DONE
|
|
|
|
LEAK_DURING-NOT: Done
|
|
|
|
|
2017-08-04 19:19:45 +02:00
|
|
|
RUN: not %t-LLVMFuzzer-LeakTest -runs=0 -detect_leaks=1 %S 2>&1 | FileCheck %s --check-prefix=LEAK_IN_CORPUS
|
2016-04-20 02:24:21 +02:00
|
|
|
LEAK_IN_CORPUS: ERROR: LeakSanitizer: detected memory leaks
|
2016-05-26 22:25:49 +02:00
|
|
|
LEAK_IN_CORPUS: INFO: a leak has been found in the initial corpus.
|
2016-04-20 02:24:21 +02:00
|
|
|
|
2017-08-04 19:19:45 +02:00
|
|
|
RUN: not %t-LLVMFuzzer-LeakTest -runs=100000000 %S/hi.txt 2>&1 | FileCheck %s --check-prefix=MULTI_RUN_LEAK
|
2016-10-18 20:38:08 +02:00
|
|
|
MULTI_RUN_LEAK-NOT: pulse
|
|
|
|
MULTI_RUN_LEAK: LeakSanitizer: detected memory leaks
|
2016-04-20 02:24:21 +02:00
|
|
|
|
2017-08-04 19:19:45 +02:00
|
|
|
RUN: not %t-LLVMFuzzer-LeakTest -runs=100000 -detect_leaks=0 2>&1 | FileCheck %s --check-prefix=LEAK_AFTER
|
|
|
|
RUN: not %t-LLVMFuzzer-LeakTest -runs=100000 2>&1 | FileCheck %s --check-prefix=LEAK_DURING
|
|
|
|
RUN: not %t-LLVMFuzzer-ThreadedLeakTest -runs=100000 -detect_leaks=0 2>&1 | FileCheck %s --check-prefix=LEAK_AFTER
|
|
|
|
RUN: not %t-LLVMFuzzer-ThreadedLeakTest -runs=100000 2>&1 | FileCheck %s --check-prefix=LEAK_DURING
|
2016-04-20 02:24:21 +02:00
|
|
|
LEAK_AFTER: Done 100000 runs in
|
|
|
|
LEAK_AFTER: ERROR: LeakSanitizer: detected memory leaks
|
2016-03-24 02:32:08 +01:00
|
|
|
|
2017-08-04 19:19:45 +02:00
|
|
|
RUN: not %t-LLVMFuzzer-LeakTest -runs=100000 -max_len=1 2>&1 | FileCheck %s --check-prefix=MAX_LEN_1
|
2016-05-27 02:21:33 +02:00
|
|
|
MAX_LEN_1: Test unit written to ./leak-7cf184f4c67ad58283ecb19349720b0cae756829
|
|
|
|
|
2017-08-04 19:19:45 +02:00
|
|
|
RUN: not %t-LLVMFuzzer-LeakTimeoutTest -timeout=1 2>&1 | FileCheck %s --check-prefix=LEAK_TIMEOUT
|
2016-03-24 02:32:08 +01:00
|
|
|
LEAK_TIMEOUT: ERROR: libFuzzer: timeout after
|
|
|
|
LEAK_TIMEOUT-NOT: LeakSanitizer
|
|
|
|
|
2016-07-15 19:19:43 +02:00
|
|
|
|
2017-08-04 19:19:45 +02:00
|
|
|
RUN: %t-LLVMFuzzer-LeakTest -error_exitcode=0
|