blob: 9aca950ec453e8820ff833eadf2756707aeaf0ef [file] [log] [blame]
Kostya Serebryanya407dde2015-05-07 00:11:33 +00001CHECK: BINGO
Kostya Serebryanybf656442015-12-19 03:35:30 +00002Done1000000: Done 1000000 runs in
Kostya Serebryanya407dde2015-05-07 00:11:33 +00003
Alexey Samsonov4800c2d2015-07-21 22:51:55 +00004RUN: LLVMFuzzer-SimpleTest 2>&1 | FileCheck %s
Kostya Serebryanyc5575aa2016-03-17 19:59:39 +00005RUN: not LLVMFuzzer-NullDerefTest %S/hi.txt 2>&1 | FileCheck %s --check-prefix=SingleInput
Kostya Serebryanyb91c62b2015-10-16 22:41:47 +00006SingleInput-NOT: Test unit written to ./crash-
Aaron Ballmanef116982015-01-29 16:58:29 +00007
Kostya Serebryanyb85db172015-10-02 20:47:55 +00008RUN: LLVMFuzzer-SimpleCmpTest -max_total_time=1 2>&1 | FileCheck %s --check-prefix=MaxTotalTime
9MaxTotalTime: Done {{.*}} runs in {{.}} second(s)
10
Alexey Samsonov4800c2d2015-07-21 22:51:55 +000011RUN: not LLVMFuzzer-NullDerefTest 2>&1 | FileCheck %s --check-prefix=NullDerefTest
Kostya Serebryanybd5d1cd2015-10-09 03:57:59 +000012NullDerefTest: Test unit written to ./crash-
13RUN: not LLVMFuzzer-NullDerefTest -artifact_prefix=ZZZ 2>&1 | FileCheck %s --check-prefix=NullDerefTestPrefix
14NullDerefTestPrefix: Test unit written to ZZZcrash-
Kostya Serebryany2d0ef142015-11-25 21:40:46 +000015RUN: not LLVMFuzzer-NullDerefTest -artifact_prefix=ZZZ -exact_artifact_path=FOOBAR 2>&1 | FileCheck %s --check-prefix=NullDerefTestExactPath
16NullDerefTestExactPath: Test unit written to FOOBAR
Kostya Serebryany2c1b33b2015-01-29 23:01:07 +000017
Kostya Serebryany228d5b12016-03-01 22:19:21 +000018RUN: ASAN_OPTIONS=handle_segv=0 not LLVMFuzzer-NullDerefTest 2>&1 | FileCheck %s --check-prefix=LIBFUZZER_OWN_SEGV_HANDLER
19LIBFUZZER_OWN_SEGV_HANDLER: == ERROR: libFuzzer: deadly signal
20LIBFUZZER_OWN_SEGV_HANDLER: SUMMARY: libFuzzer: deadly signal
21LIBFUZZER_OWN_SEGV_HANDLER: Test unit written to ./crash-
22
Kostya Serebryany65d0a142015-10-02 22:00:32 +000023#not LLVMFuzzer-FullCoverageSetTest -timeout=15 -seed=1 -mutate_depth=2 -use_full_coverage_set=1 2>&1 | FileCheck %s
Kostya Serebryany2e3622b2015-02-20 03:02:37 +000024
Alexey Samsonov4800c2d2015-07-21 22:51:55 +000025RUN: not LLVMFuzzer-CounterTest -use_counters=1 -max_len=6 -seed=1 -timeout=15 2>&1 | FileCheck %s
Kostya Serebryany16d03bd2015-03-30 22:09:51 +000026
Kostya Serebryany27ab2d72015-12-19 02:49:09 +000027RUN: not LLVMFuzzer-CallerCalleeTest -cross_over=0 -max_len=6 -seed=1 -timeout=15 2>&1 | FileCheck %s
Kostya Serebryany152ac7a2016-01-07 01:49:35 +000028# This one is flaky, may actually find the goal even w/o use_indir_calls.
29# LLVMFuzzer-CallerCalleeTest -use_indir_calls=0 -cross_over=0 -max_len=6 -seed=1 -runs=1000000 2>&1 | FileCheck %s --check-prefix=Done1000000
Kostya Serebryany2e9fca92015-10-22 23:55:39 +000030
Kostya Serebryanya407dde2015-05-07 00:11:33 +000031
Kostya Serebryany5eab74e2015-11-09 23:17:45 +000032RUN: not LLVMFuzzer-UninstrumentedTest-Uninstrumented 2>&1 | FileCheck %s --check-prefix=UNINSTRUMENTED
33UNINSTRUMENTED: ERROR: __sanitizer_set_death_callback is not defined. Exiting.
Mike Aizatsky8b11f872016-01-06 00:21:22 +000034
35RUN: LLVMFuzzer-SimpleTest -print_new_cov_pcs=1 2>&1 | FileCheck %s --check-prefix=PCS
36PCS:{{^0x[a-f0-9]+}}
37PCS:NEW
38PCS:BINGO
39
Kostya Serebryanyd50a3ee2016-01-13 23:02:30 +000040RUN: not LLVMFuzzer-BufferOverflowOnInput 2>&1 | FileCheck %s --check-prefix=OOB
41OOB: AddressSanitizer: heap-buffer-overflow
42OOB: is located 0 bytes to the right of 3-byte region
Kostya Serebryanyaca76962016-01-16 01:23:12 +000043
44RUN: not LLVMFuzzer-InitializeTest 2>&1 | FileCheck %s
Kostya Serebryany311f27c2016-01-19 20:33:57 +000045
46RUN: LLVMFuzzer-SimpleCmpTest -seed=-1 -runs=0 2>&1 | FileCheck %s --check-prefix=CHECK_SEED_MINUS_ONE
47CHECK_SEED_MINUS_ONE: Seed: 4294967295
Kostya Serebryany078e9842016-02-02 02:07:26 +000048
49RUN: not LLVMFuzzer-SimpleTest NONEXISTENT_DIR 2>&1 | FileCheck %s --check-prefix=NONEXISTENT_DIR
50NONEXISTENT_DIR: No such directory: NONEXISTENT_DIR; exiting
Kostya Serebryanybfbe7fc2016-02-02 03:03:47 +000051
52
53RUN: rm -rf %tmp/SINGLE_INPUTS
54RUN: mkdir -p %tmp/SINGLE_INPUTS
55RUN: echo aaa > %tmp/SINGLE_INPUTS/aaa
56RUN: echo bbb > %tmp/SINGLE_INPUTS/bbb
57RUN: LLVMFuzzer-SimpleTest %tmp/SINGLE_INPUTS/aaa %tmp/SINGLE_INPUTS/bbb 2>&1 | FileCheck %s --check-prefix=SINGLE_INPUTS
58RUN: rm -rf %tmp/SINGLE_INPUTS
Kostya Serebryany9d14e4b2016-02-12 02:32:03 +000059SINGLE_INPUTS: LLVMFuzzer-SimpleTest: Running 2 inputs 1 time(s) each.
Kostya Serebryanybfbe7fc2016-02-02 03:03:47 +000060SINGLE_INPUTS: aaa:
61SINGLE_INPUTS: bbb:
62
Kostya Serebryanyc43b5842016-03-18 01:36:00 +000063RUN: rm -rf %t/SUB1
64RUN: mkdir -p %t/SUB1/SUB2/SUB3
65RUN: echo a > %t/SUB1/a
66RUN: echo b > %t/SUB1/SUB2/b
67RUN: echo c > %t/SUB1/SUB2/SUB3/c
68RUN: LLVMFuzzer-SimpleTest %t/SUB1 -runs=0 2>&1 | FileCheck %s --check-prefix=SUBDIRS
69SUBDIRS: READ units: 3
70RUN: rm -rf %t/SUB1
71
Kostya Serebryany7ec0c562016-02-13 03:25:16 +000072RUN: mkdir -p %t
Kostya Serebryany9d14e4b2016-02-12 02:32:03 +000073RUN: echo abcd > %t/NthRunCrashTest.in
74RUN: LLVMFuzzer-NthRunCrashTest %t/NthRunCrashTest.in
75RUN: LLVMFuzzer-NthRunCrashTest %t/NthRunCrashTest.in -runs=10
76RUN: not LLVMFuzzer-NthRunCrashTest %t/NthRunCrashTest.in -runs=10000 2>&1 | FileCheck %s
77RUN: rm %t/NthRunCrashTest.in
Kostya Serebryany22cc5e22016-02-13 02:29:38 +000078
79RUN: not LLVMFuzzer-CustomMutatorTest 2>&1 | FileCheck %s --check-prefix=LLVMFuzzerCustomMutator
80LLVMFuzzerCustomMutator: In LLVMFuzzerCustomMutator
81LLVMFuzzerCustomMutator: BINGO
Kostya Serebryany66ff0752016-02-26 22:42:23 +000082
83RUN: LLVMFuzzer-SimpleTest -seed=1 -runs=77 -print_final_stats=1 2>&1 | FileCheck %s --check-prefix=FINAL_STATS
84FINAL_STATS: stat::number_of_executed_units: 77
85FINAL_STATS: stat::average_exec_per_sec: 0
86FINAL_STATS: stat::new_units_added:
87FINAL_STATS: stat::slowest_unit_time_sec: 0
88FINAL_STATS: stat::peak_rss_mb:
89
Kostya Serebryany49e40902016-03-18 20:58:29 +000090RUN: LLVMFuzzer-SpamyTest -runs=1 2>&1 | FileCheck %s --check-prefix=FD_MASK_0
91RUN: LLVMFuzzer-SpamyTest -runs=1 -close_fd_mask=0 2>&1 | FileCheck %s --check-prefix=FD_MASK_0
92RUN: LLVMFuzzer-SpamyTest -runs=1 -close_fd_mask=1 2>&1 | FileCheck %s --check-prefix=FD_MASK_1
93RUN: LLVMFuzzer-SpamyTest -runs=1 -close_fd_mask=2 2>&1 | FileCheck %s --check-prefix=FD_MASK_2
94RUN: LLVMFuzzer-SpamyTest -runs=1 -close_fd_mask=3 2>&1 | FileCheck %s --check-prefix=FD_MASK_3
95FD_MASK_0: PRINTF_STDOUT
96FD_MASK_0: PRINTF_STDERR
97FD_MASK_0: STREAM_COUT
98FD_MASK_0: STREAM_CERR
99FD_MASK_0: INITED
100
101FD_MASK_1-NOT: PRINTF_STDOUT
102FD_MASK_1: PRINTF_STDERR
103FD_MASK_1-NOT: STREAM_COUT
104FD_MASK_1: STREAM_CERR
105FD_MASK_1: INITED
106
107FD_MASK_2: PRINTF_STDOUT
108FD_MASK_2-NOT: PRINTF_STDERR
109FD_MASK_2: STREAM_COUT
110FD_MASK_2-NOTE: STREAM_CERR
111FD_MASK_2: INITED
112
113FD_MASK_3-NOT: PRINTF_STDOUT
114FD_MASK_3-NOT: PRINTF_STDERR
115FD_MASK_3-NOT: STREAM_COUT
116FD_MASK_3-NOT: STREAM_CERR
117FD_MASK_3: INITED
118