Kostya Serebryany | a407dde | 2015-05-07 00:11:33 +0000 | [diff] [blame] | 1 | CHECK: BINGO |
Kostya Serebryany | bf65644 | 2015-12-19 03:35:30 +0000 | [diff] [blame] | 2 | Done1000000: Done 1000000 runs in |
Kostya Serebryany | a407dde | 2015-05-07 00:11:33 +0000 | [diff] [blame] | 3 | |
Alexey Samsonov | 4800c2d | 2015-07-21 22:51:55 +0000 | [diff] [blame] | 4 | RUN: LLVMFuzzer-SimpleTest 2>&1 | FileCheck %s |
Kostya Serebryany | c5575aa | 2016-03-17 19:59:39 +0000 | [diff] [blame] | 5 | RUN: not LLVMFuzzer-NullDerefTest %S/hi.txt 2>&1 | FileCheck %s --check-prefix=SingleInput |
Kostya Serebryany | b91c62b | 2015-10-16 22:41:47 +0000 | [diff] [blame] | 6 | SingleInput-NOT: Test unit written to ./crash- |
Aaron Ballman | ef11698 | 2015-01-29 16:58:29 +0000 | [diff] [blame] | 7 | |
Kostya Serebryany | b85db17 | 2015-10-02 20:47:55 +0000 | [diff] [blame] | 8 | RUN: LLVMFuzzer-SimpleCmpTest -max_total_time=1 2>&1 | FileCheck %s --check-prefix=MaxTotalTime |
| 9 | MaxTotalTime: Done {{.*}} runs in {{.}} second(s) |
| 10 | |
Alexey Samsonov | 4800c2d | 2015-07-21 22:51:55 +0000 | [diff] [blame] | 11 | RUN: not LLVMFuzzer-NullDerefTest 2>&1 | FileCheck %s --check-prefix=NullDerefTest |
Kostya Serebryany | bd5d1cd | 2015-10-09 03:57:59 +0000 | [diff] [blame] | 12 | NullDerefTest: Test unit written to ./crash- |
| 13 | RUN: not LLVMFuzzer-NullDerefTest -artifact_prefix=ZZZ 2>&1 | FileCheck %s --check-prefix=NullDerefTestPrefix |
| 14 | NullDerefTestPrefix: Test unit written to ZZZcrash- |
Kostya Serebryany | 2d0ef14 | 2015-11-25 21:40:46 +0000 | [diff] [blame] | 15 | RUN: not LLVMFuzzer-NullDerefTest -artifact_prefix=ZZZ -exact_artifact_path=FOOBAR 2>&1 | FileCheck %s --check-prefix=NullDerefTestExactPath |
| 16 | NullDerefTestExactPath: Test unit written to FOOBAR |
Kostya Serebryany | 2c1b33b | 2015-01-29 23:01:07 +0000 | [diff] [blame] | 17 | |
Kostya Serebryany | 228d5b1 | 2016-03-01 22:19:21 +0000 | [diff] [blame] | 18 | RUN: ASAN_OPTIONS=handle_segv=0 not LLVMFuzzer-NullDerefTest 2>&1 | FileCheck %s --check-prefix=LIBFUZZER_OWN_SEGV_HANDLER |
| 19 | LIBFUZZER_OWN_SEGV_HANDLER: == ERROR: libFuzzer: deadly signal |
| 20 | LIBFUZZER_OWN_SEGV_HANDLER: SUMMARY: libFuzzer: deadly signal |
| 21 | LIBFUZZER_OWN_SEGV_HANDLER: Test unit written to ./crash- |
| 22 | |
Kostya Serebryany | 65d0a14 | 2015-10-02 22:00:32 +0000 | [diff] [blame] | 23 | #not LLVMFuzzer-FullCoverageSetTest -timeout=15 -seed=1 -mutate_depth=2 -use_full_coverage_set=1 2>&1 | FileCheck %s |
Kostya Serebryany | 2e3622b | 2015-02-20 03:02:37 +0000 | [diff] [blame] | 24 | |
Alexey Samsonov | 4800c2d | 2015-07-21 22:51:55 +0000 | [diff] [blame] | 25 | RUN: not LLVMFuzzer-CounterTest -use_counters=1 -max_len=6 -seed=1 -timeout=15 2>&1 | FileCheck %s |
Kostya Serebryany | 16d03bd | 2015-03-30 22:09:51 +0000 | [diff] [blame] | 26 | |
Kostya Serebryany | 27ab2d7 | 2015-12-19 02:49:09 +0000 | [diff] [blame] | 27 | RUN: not LLVMFuzzer-CallerCalleeTest -cross_over=0 -max_len=6 -seed=1 -timeout=15 2>&1 | FileCheck %s |
Kostya Serebryany | 152ac7a | 2016-01-07 01:49:35 +0000 | [diff] [blame] | 28 | # 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 Serebryany | 2e9fca9 | 2015-10-22 23:55:39 +0000 | [diff] [blame] | 30 | |
Kostya Serebryany | a407dde | 2015-05-07 00:11:33 +0000 | [diff] [blame] | 31 | |
Kostya Serebryany | 5eab74e | 2015-11-09 23:17:45 +0000 | [diff] [blame] | 32 | RUN: not LLVMFuzzer-UninstrumentedTest-Uninstrumented 2>&1 | FileCheck %s --check-prefix=UNINSTRUMENTED |
| 33 | UNINSTRUMENTED: ERROR: __sanitizer_set_death_callback is not defined. Exiting. |
Mike Aizatsky | 8b11f87 | 2016-01-06 00:21:22 +0000 | [diff] [blame] | 34 | |
| 35 | RUN: LLVMFuzzer-SimpleTest -print_new_cov_pcs=1 2>&1 | FileCheck %s --check-prefix=PCS |
| 36 | PCS:{{^0x[a-f0-9]+}} |
| 37 | PCS:NEW |
| 38 | PCS:BINGO |
| 39 | |
Kostya Serebryany | d50a3ee | 2016-01-13 23:02:30 +0000 | [diff] [blame] | 40 | RUN: not LLVMFuzzer-BufferOverflowOnInput 2>&1 | FileCheck %s --check-prefix=OOB |
| 41 | OOB: AddressSanitizer: heap-buffer-overflow |
| 42 | OOB: is located 0 bytes to the right of 3-byte region |
Kostya Serebryany | aca7696 | 2016-01-16 01:23:12 +0000 | [diff] [blame] | 43 | |
| 44 | RUN: not LLVMFuzzer-InitializeTest 2>&1 | FileCheck %s |
Kostya Serebryany | 311f27c | 2016-01-19 20:33:57 +0000 | [diff] [blame] | 45 | |
| 46 | RUN: LLVMFuzzer-SimpleCmpTest -seed=-1 -runs=0 2>&1 | FileCheck %s --check-prefix=CHECK_SEED_MINUS_ONE |
| 47 | CHECK_SEED_MINUS_ONE: Seed: 4294967295 |
Kostya Serebryany | 078e984 | 2016-02-02 02:07:26 +0000 | [diff] [blame] | 48 | |
| 49 | RUN: not LLVMFuzzer-SimpleTest NONEXISTENT_DIR 2>&1 | FileCheck %s --check-prefix=NONEXISTENT_DIR |
| 50 | NONEXISTENT_DIR: No such directory: NONEXISTENT_DIR; exiting |
Kostya Serebryany | bfbe7fc | 2016-02-02 03:03:47 +0000 | [diff] [blame] | 51 | |
| 52 | |
| 53 | RUN: rm -rf %tmp/SINGLE_INPUTS |
| 54 | RUN: mkdir -p %tmp/SINGLE_INPUTS |
| 55 | RUN: echo aaa > %tmp/SINGLE_INPUTS/aaa |
| 56 | RUN: echo bbb > %tmp/SINGLE_INPUTS/bbb |
| 57 | RUN: LLVMFuzzer-SimpleTest %tmp/SINGLE_INPUTS/aaa %tmp/SINGLE_INPUTS/bbb 2>&1 | FileCheck %s --check-prefix=SINGLE_INPUTS |
| 58 | RUN: rm -rf %tmp/SINGLE_INPUTS |
Kostya Serebryany | 9d14e4b | 2016-02-12 02:32:03 +0000 | [diff] [blame] | 59 | SINGLE_INPUTS: LLVMFuzzer-SimpleTest: Running 2 inputs 1 time(s) each. |
Kostya Serebryany | bfbe7fc | 2016-02-02 03:03:47 +0000 | [diff] [blame] | 60 | SINGLE_INPUTS: aaa: |
| 61 | SINGLE_INPUTS: bbb: |
| 62 | |
Kostya Serebryany | c43b584 | 2016-03-18 01:36:00 +0000 | [diff] [blame] | 63 | RUN: rm -rf %t/SUB1 |
| 64 | RUN: mkdir -p %t/SUB1/SUB2/SUB3 |
| 65 | RUN: echo a > %t/SUB1/a |
| 66 | RUN: echo b > %t/SUB1/SUB2/b |
| 67 | RUN: echo c > %t/SUB1/SUB2/SUB3/c |
| 68 | RUN: LLVMFuzzer-SimpleTest %t/SUB1 -runs=0 2>&1 | FileCheck %s --check-prefix=SUBDIRS |
| 69 | SUBDIRS: READ units: 3 |
| 70 | RUN: rm -rf %t/SUB1 |
| 71 | |
Kostya Serebryany | ce925c5 | 2016-02-04 00:12:28 +0000 | [diff] [blame] | 72 | RUN: not LLVMFuzzer-LeakTest -runs=10 2>&1 | FileCheck %s --check-prefix=LEAK |
Kostya Serebryany | b92602a | 2016-02-04 00:02:17 +0000 | [diff] [blame] | 73 | LEAK: ERROR: LeakSanitizer: detected memory leaks |
| 74 | LEAK-NOT: DEATH: |
Kostya Serebryany | 9d14e4b | 2016-02-12 02:32:03 +0000 | [diff] [blame] | 75 | |
Kostya Serebryany | 7ec0c56 | 2016-02-13 03:25:16 +0000 | [diff] [blame] | 76 | RUN: mkdir -p %t |
Kostya Serebryany | 9d14e4b | 2016-02-12 02:32:03 +0000 | [diff] [blame] | 77 | RUN: echo abcd > %t/NthRunCrashTest.in |
| 78 | RUN: LLVMFuzzer-NthRunCrashTest %t/NthRunCrashTest.in |
| 79 | RUN: LLVMFuzzer-NthRunCrashTest %t/NthRunCrashTest.in -runs=10 |
| 80 | RUN: not LLVMFuzzer-NthRunCrashTest %t/NthRunCrashTest.in -runs=10000 2>&1 | FileCheck %s |
| 81 | RUN: rm %t/NthRunCrashTest.in |
Kostya Serebryany | 22cc5e2 | 2016-02-13 02:29:38 +0000 | [diff] [blame] | 82 | |
| 83 | RUN: not LLVMFuzzer-CustomMutatorTest 2>&1 | FileCheck %s --check-prefix=LLVMFuzzerCustomMutator |
| 84 | LLVMFuzzerCustomMutator: In LLVMFuzzerCustomMutator |
| 85 | LLVMFuzzerCustomMutator: BINGO |
Kostya Serebryany | 66ff075 | 2016-02-26 22:42:23 +0000 | [diff] [blame] | 86 | |
| 87 | RUN: LLVMFuzzer-SimpleTest -seed=1 -runs=77 -print_final_stats=1 2>&1 | FileCheck %s --check-prefix=FINAL_STATS |
| 88 | FINAL_STATS: stat::number_of_executed_units: 77 |
| 89 | FINAL_STATS: stat::average_exec_per_sec: 0 |
| 90 | FINAL_STATS: stat::new_units_added: |
| 91 | FINAL_STATS: stat::slowest_unit_time_sec: 0 |
| 92 | FINAL_STATS: stat::peak_rss_mb: |
| 93 | |