2 Done1000000: Done 1000000 runs in
3 RUN: %cpp_compiler %S/BogusInitializeTest.cpp -o %t-BogusInitializeTest
4 RUN: %cpp_compiler %S/BufferOverflowOnInput.cpp -o %t-BufferOverflowOnInput
5 RUN: %cpp_compiler %S/CounterTest.cpp -o %t-CounterTest
6 RUN: %cpp_compiler %S/DSO1.cpp -fPIC -shared -o %t-DSO1.so
7 RUN: %cpp_compiler %S/DSO2.cpp -fPIC -shared -o %t-DSO2.so
8 RUN: %cpp_compiler %S/DSOTestMain.cpp %S/DSOTestExtra.cpp -L. %t-DSO1.so %t-DSO2.so -o %t-DSOTest
9 RUN: %cpp_compiler %S/FullCoverageSetTest.cpp -o %t-FullCoverageSetTest
10 RUN: %cpp_compiler %S/InitializeTest.cpp -o %t-InitializeTest
11 RUN: %cpp_compiler %S/NotinstrumentedTest.cpp -fno-sanitize-coverage=edge,trace-cmp,indirect-calls,8bit-counters,trace-pc-guard -o %t-NotinstrumentedTest-NoCoverage
12 RUN: %cpp_compiler %S/NullDerefOnEmptyTest.cpp -o %t-NullDerefOnEmptyTest
13 RUN: %cpp_compiler %S/NullDerefTest.cpp -o %t-NullDerefTest
14 RUN: %cpp_compiler %S/ShrinkControlFlowTest.cpp -o %t-ShrinkControlFlowTest
15 RUN: %cpp_compiler %S/SimpleCmpTest.cpp -o %t-SimpleCmpTest
16 RUN: %cpp_compiler %S/SimpleTest.cpp -o %t-SimpleTest
17 RUN: %cpp_compiler %S/StrncmpOOBTest.cpp -o %t-StrncmpOOBTest
19 RUN: not %t-SimpleTest 2>&1 | FileCheck %s
21 # only_ascii mode. Will perform some minimal self-validation.
22 RUN: not %t-SimpleTest -only_ascii=1 2>&1
24 RUN: %t-SimpleCmpTest -max_total_time=1 -use_cmp=0 2>&1 | FileCheck %s --check-prefix=MaxTotalTime
25 MaxTotalTime: Done {{.*}} runs in {{.}} second(s)
27 RUN: not %t-NullDerefTest 2>&1 | FileCheck %s --check-prefix=NullDerefTest
28 RUN: not %t-NullDerefTest -close_fd_mask=3 2>&1 | FileCheck %s --check-prefix=NullDerefTest
29 NullDerefTest: ERROR: AddressSanitizer: {{SEGV|access-violation}} on unknown address
30 NullDerefTest: Test unit written to ./crash-
31 RUN: not %t-NullDerefTest -artifact_prefix=ZZZ 2>&1 | FileCheck %s --check-prefix=NullDerefTestPrefix
32 NullDerefTestPrefix: Test unit written to ZZZcrash-
33 RUN: not %t-NullDerefTest -artifact_prefix=ZZZ -exact_artifact_path=FOOBAR 2>&1 | FileCheck %s --check-prefix=NullDerefTestExactPath
34 NullDerefTestExactPath: Test unit written to FOOBAR
36 RUN: not %t-NullDerefOnEmptyTest -print_final_stats=1 2>&1 | FileCheck %s --check-prefix=NULL_DEREF_ON_EMPTY
37 NULL_DEREF_ON_EMPTY: stat::number_of_executed_units:
39 #not %t-FullCoverageSetTest -timeout=15 -seed=1 -mutate_depth=2 -use_full_coverage_set=1 2>&1 | FileCheck %s
41 RUN: not %t-CounterTest -max_len=6 -seed=1 -timeout=15 2>&1 | FileCheck %s --check-prefix=COUNTERS
43 COUNTERS: INITED {{.*}} {{bits:|ft:}}
44 COUNTERS: NEW {{.*}} {{bits:|ft:}} {{[1-9]*}}
45 COUNTERS: NEW {{.*}} {{bits:|ft:}} {{[1-9]*}}
48 # Don't run UninstrumentedTest for now since we build libFuzzer itself with asan.
49 DISABLED: not %t-UninstrumentedTest-Uninstrumented 2>&1 | FileCheck %s --check-prefix=UNINSTRUMENTED
50 UNINSTRUMENTED: ERROR: __sanitizer_set_death_callback is not defined. Exiting.
52 RUN: not %t-NotinstrumentedTest-NoCoverage 2>&1 | FileCheck %s --check-prefix=NO_COVERAGE
53 NO_COVERAGE: ERROR: no interesting inputs were found. Is the code instrumented for coverage? Exiting
55 RUN: not %t-BufferOverflowOnInput 2>&1 | FileCheck %s --check-prefix=OOB
56 OOB: AddressSanitizer: heap-buffer-overflow
57 OOB: is located 0 bytes to the right of 3-byte region
59 RUN: not %t-InitializeTest -use_value_profile=1 2>&1 | FileCheck %s
61 RUN: not %t-DSOTest 2>&1 | FileCheck %s --check-prefix=DSO
62 DSO: INFO: Loaded 3 modules
65 RUN: %t-SimpleTest -exit_on_src_pos=SimpleTest.cpp:18 2>&1 | FileCheck %s --check-prefix=EXIT_ON_SRC_POS
66 RUN: %t-ShrinkControlFlowTest -exit_on_src_pos=ShrinkControlFlowTest.cpp:23 2>&1 | FileCheck %s --check-prefix=EXIT_ON_SRC_POS
67 EXIT_ON_SRC_POS: INFO: found line matching '{{.*}}', exiting.
69 RUN: env ASAN_OPTIONS=strict_string_checks=1 not %t-StrncmpOOBTest -seed=1 -runs=1000000 2>&1 | FileCheck %s --check-prefix=STRNCMP
70 STRNCMP: AddressSanitizer: heap-buffer-overflow
71 STRNCMP-NOT: __sanitizer_weak_hook_strncmp
72 STRNCMP: in LLVMFuzzerTestOneInput
74 RUN: not %t-BogusInitializeTest 2>&1 | FileCheck %s --check-prefix=BOGUS_INITIALIZE
75 BOGUS_INITIALIZE: argv[0] has been modified in LLVMFuzzerInitialize