diff options
author | Alon Zakai <azakai@google.com> | 2024-11-19 15:26:09 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-11-19 15:26:09 -0800 |
commit | e13bf0fb72fca160f457570b930c4ba3c35ead3a (patch) | |
tree | d840d824a6da6213cb9e27051cda3afd138863ed /test/passes | |
parent | 206ad2906c9e0af92ec4c4da223c96755243aa2e (diff) | |
download | binaryen-e13bf0fb72fca160f457570b930c4ba3c35ead3a.tar.gz binaryen-e13bf0fb72fca160f457570b930c4ba3c35ead3a.tar.bz2 binaryen-e13bf0fb72fca160f457570b930c4ba3c35ead3a.zip |
Improve fuzzing of both closed and open world styles of modules (#7090)
Before, we would simply not export a function that had an e.g. anyref
param. As a result, the modules were effectively "closed", which was
good for testing full closed-world mode, but not for testing degrees of
open world. To improve that, this PR allows the fuzzer to export such
functions, and an "enclose world" pass is added that "closes" the wasm
(makes it more compatible with closed-world) that is run 50% of the
time, giving us coverage of both styles.
Diffstat (limited to 'test/passes')
-rw-r--r-- | test/passes/fuzz_metrics_passes_noprint.bin.txt | 58 | ||||
-rw-r--r-- | test/passes/translate-to-fuzz_all-features_metrics_noprint.txt | 72 |
2 files changed, 68 insertions, 62 deletions
diff --git a/test/passes/fuzz_metrics_passes_noprint.bin.txt b/test/passes/fuzz_metrics_passes_noprint.bin.txt index b4d67bab0..5e0dbfe07 100644 --- a/test/passes/fuzz_metrics_passes_noprint.bin.txt +++ b/test/passes/fuzz_metrics_passes_noprint.bin.txt @@ -1,35 +1,35 @@ Metrics total - [exports] : 23 - [funcs] : 34 - [globals] : 30 + [exports] : 50 + [funcs] : 64 + [globals] : 24 [imports] : 5 [memories] : 1 - [memory-data] : 17 - [table-data] : 6 + [memory-data] : 15 + [table-data] : 16 [tables] : 1 [tags] : 0 - [total] : 9415 - [vars] : 105 - Binary : 726 - Block : 1537 - Break : 331 - Call : 306 - CallIndirect : 10 - Const : 1479 - Drop : 83 - GlobalGet : 778 - GlobalSet : 584 - If : 531 - Load : 164 - LocalGet : 774 - LocalSet : 570 - Loop : 244 - Nop : 105 - RefFunc : 6 - Return : 94 - Select : 70 - Store : 86 - Switch : 2 - Unary : 654 - Unreachable : 281 + [total] : 6973 + [vars] : 223 + Binary : 534 + Block : 1168 + Break : 228 + Call : 282 + CallIndirect : 38 + Const : 1083 + Drop : 115 + GlobalGet : 580 + GlobalSet : 444 + If : 354 + Load : 113 + LocalGet : 501 + LocalSet : 367 + Loop : 148 + Nop : 99 + RefFunc : 16 + Return : 91 + Select : 53 + Store : 70 + Switch : 1 + Unary : 466 + Unreachable : 222 diff --git a/test/passes/translate-to-fuzz_all-features_metrics_noprint.txt b/test/passes/translate-to-fuzz_all-features_metrics_noprint.txt index a77708b2e..8df9d033c 100644 --- a/test/passes/translate-to-fuzz_all-features_metrics_noprint.txt +++ b/test/passes/translate-to-fuzz_all-features_metrics_noprint.txt @@ -1,48 +1,54 @@ Metrics total - [exports] : 6 - [funcs] : 12 + [exports] : 9 + [funcs] : 10 [globals] : 4 [imports] : 8 [memories] : 1 [memory-data] : 112 - [table-data] : 3 + [table-data] : 2 [tables] : 1 - [tags] : 0 - [total] : 608 - [vars] : 48 - ArrayNew : 5 + [tags] : 1 + [total] : 682 + [vars] : 37 + ArrayLen : 1 + ArrayNew : 7 ArrayNewFixed : 5 - Binary : 75 - Block : 80 - BrOn : 5 - Break : 4 - Call : 21 - CallRef : 1 - Const : 113 + ArraySet : 1 + AtomicNotify : 1 + Binary : 79 + Block : 72 + BrOn : 4 + Break : 7 + Call : 19 + Const : 149 Drop : 15 - GlobalGet : 39 - GlobalSet : 36 - If : 21 - Load : 17 - LocalGet : 45 - LocalSet : 20 + GlobalGet : 35 + GlobalSet : 32 + If : 20 + Load : 20 + LocalGet : 55 + LocalSet : 26 Loop : 7 - Nop : 7 - RefAs : 2 + MemoryFill : 1 + Nop : 9 + Pop : 1 + RefAs : 1 + RefCast : 1 RefEq : 1 - RefFunc : 9 - RefI31 : 1 - RefIsNull : 1 + RefFunc : 17 + RefI31 : 2 + RefIsNull : 2 RefNull : 8 Return : 5 - Select : 2 + SIMDExtract : 3 Store : 1 - StringConst : 4 - StringEq : 1 - StringMeasure : 2 - StructNew : 13 - TupleExtract : 1 + StringConst : 3 + StringMeasure : 1 + StringWTF16Get : 1 + StructNew : 23 + Try : 1 + TupleExtract : 3 TupleMake : 4 - Unary : 19 - Unreachable : 18 + Unary : 23 + Unreachable : 16 |