OSDN Git Service

[libFuzzer] remove the now redundant 'LLVMFuzzer-' prefix from libFuzzer tests
[android-x86/external-llvm.git] / lib / Fuzzer / test / fuzzer-leak.test
1 REQUIRES: lsan
2 RUN: %cpp_compiler %S/LeakTest.cpp -o %t-LeakTest
3 RUN: %cpp_compiler %S/ThreadedLeakTest.cpp -o %t-ThreadedLeakTest
4 RUN: %cpp_compiler %S/LeakTimeoutTest.cpp -o %t-LeakTimeoutTest
5
6 RUN: not %t-LeakTest -runs=100000 -detect_leaks=1 2>&1 | FileCheck %s --check-prefix=LEAK_DURING
7 LEAK_DURING: ERROR: LeakSanitizer: detected memory leaks
8 LEAK_DURING: Direct leak of 4 byte(s) in 1 object(s) allocated from:
9 LEAK_DURING: INFO: to ignore leaks on libFuzzer side use -detect_leaks=0
10 LEAK_DURING: Test unit written to ./leak-
11 LEAK_DURING-NOT: DONE
12 LEAK_DURING-NOT: Done
13
14 RUN: not %t-LeakTest -runs=0 -detect_leaks=1 %S 2>&1 | FileCheck %s --check-prefix=LEAK_IN_CORPUS
15 LEAK_IN_CORPUS: ERROR: LeakSanitizer: detected memory leaks
16 LEAK_IN_CORPUS: INFO: a leak has been found in the initial corpus.
17
18 RUN: not %t-LeakTest -runs=100000000 %S/hi.txt 2>&1 | FileCheck %s --check-prefix=MULTI_RUN_LEAK
19 MULTI_RUN_LEAK-NOT: pulse
20 MULTI_RUN_LEAK: LeakSanitizer: detected memory leaks
21
22 RUN: not %t-LeakTest -runs=100000 -detect_leaks=0 2>&1 | FileCheck %s --check-prefix=LEAK_AFTER
23 RUN: not %t-LeakTest -runs=100000                 2>&1 | FileCheck %s --check-prefix=LEAK_DURING
24 RUN: not %t-ThreadedLeakTest -runs=100000 -detect_leaks=0 2>&1 | FileCheck %s --check-prefix=LEAK_AFTER
25 RUN: not %t-ThreadedLeakTest -runs=100000                 2>&1 | FileCheck %s --check-prefix=LEAK_DURING
26 LEAK_AFTER: Done 100000 runs in
27 LEAK_AFTER: ERROR: LeakSanitizer: detected memory leaks
28
29 RUN: not %t-LeakTest -runs=100000 -max_len=1 2>&1 | FileCheck %s --check-prefix=MAX_LEN_1
30 MAX_LEN_1: Test unit written to ./leak-7cf184f4c67ad58283ecb19349720b0cae756829
31
32 RUN: not %t-LeakTimeoutTest -timeout=1 2>&1 | FileCheck %s --check-prefix=LEAK_TIMEOUT
33 LEAK_TIMEOUT: ERROR: libFuzzer: timeout after
34 LEAK_TIMEOUT-NOT: LeakSanitizer
35
36
37 RUN: %t-LeakTest -error_exitcode=0