xref: /aosp_15_r20/external/llvm/lib/Fuzzer/test/merge.test (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard WorkerCHECK: BINGO
2*9880d681SAndroid Build Coastguard Worker
3*9880d681SAndroid Build Coastguard WorkerRUN: rm -rf  %tmp/T1 %tmp/T2
4*9880d681SAndroid Build Coastguard WorkerRUN: mkdir -p %tmp/T1 %tmp/T2
5*9880d681SAndroid Build Coastguard WorkerRUN: echo F..... > %tmp/T1/1
6*9880d681SAndroid Build Coastguard WorkerRUN: echo .U.... > %tmp/T1/2
7*9880d681SAndroid Build Coastguard WorkerRUN: echo ..Z... > %tmp/T1/3
8*9880d681SAndroid Build Coastguard Worker
9*9880d681SAndroid Build Coastguard Worker# T1 has 3 elements, T2 is empty.
10*9880d681SAndroid Build Coastguard WorkerRUN: LLVMFuzzer-FullCoverageSetTest -merge=1 %tmp/T1 %tmp/T2 2>&1 | FileCheck %s --check-prefix=CHECK1
11*9880d681SAndroid Build Coastguard WorkerCHECK1: === Minimizing the initial corpus of 3 units
12*9880d681SAndroid Build Coastguard WorkerCHECK1: === Merge: written 0 units
13*9880d681SAndroid Build Coastguard Worker
14*9880d681SAndroid Build Coastguard WorkerRUN: echo ...Z.. > %tmp/T2/1
15*9880d681SAndroid Build Coastguard WorkerRUN: echo ....E. > %tmp/T2/2
16*9880d681SAndroid Build Coastguard WorkerRUN: echo .....R > %tmp/T2/3
17*9880d681SAndroid Build Coastguard WorkerRUN: echo F..... > %tmp/T2/a
18*9880d681SAndroid Build Coastguard WorkerRUN: echo .U.... > %tmp/T2/b
19*9880d681SAndroid Build Coastguard WorkerRUN: echo ..Z... > %tmp/T2/c
20*9880d681SAndroid Build Coastguard Worker
21*9880d681SAndroid Build Coastguard Worker# T1 has 3 elements, T2 has 6 elements, only 3 are new.
22*9880d681SAndroid Build Coastguard WorkerRUN: LLVMFuzzer-FullCoverageSetTest -merge=1 %tmp/T1 %tmp/T2 2>&1 | FileCheck %s --check-prefix=CHECK2
23*9880d681SAndroid Build Coastguard WorkerCHECK2: === Minimizing the initial corpus of 3 units
24*9880d681SAndroid Build Coastguard WorkerCHECK2: === Merging extra 6 units
25*9880d681SAndroid Build Coastguard WorkerCHECK2: === Merge: written 3 units
26*9880d681SAndroid Build Coastguard Worker
27*9880d681SAndroid Build Coastguard Worker# Now, T1 has 6 units and T2 has no new interesting units.
28*9880d681SAndroid Build Coastguard WorkerRUN: LLVMFuzzer-FullCoverageSetTest -merge=1 %tmp/T1 %tmp/T2 2>&1 | FileCheck %s --check-prefix=CHECK3
29*9880d681SAndroid Build Coastguard WorkerCHECK3: === Minimizing the initial corpus of 6 units
30*9880d681SAndroid Build Coastguard WorkerCHECK3: === Merge: written 0 units
31