diff options
Diffstat (limited to 'test/passes')
-rw-r--r-- | test/passes/inlining_all-features.txt | 15 | ||||
-rw-r--r-- | test/passes/inlining_all-features.wast | 13 | ||||
-rw-r--r-- | test/passes/optimize-instructions_all-features.txt | 7 | ||||
-rw-r--r-- | test/passes/optimize-instructions_all-features.wast | 10 | ||||
-rw-r--r-- | test/passes/simplify-globals_all-features_fuzz-exec.txt | 20 | ||||
-rw-r--r-- | test/passes/simplify-globals_all-features_fuzz-exec.wast | 14 | ||||
-rw-r--r-- | test/passes/translate-to-fuzz_all-features_metrics_noprint.txt | 42 | ||||
-rw-r--r-- | test/passes/translate-to-fuzz_all-features_metrics_noprint.wast (renamed from test/passes/translate-to-fuzz_all-features.wast) | 0 |
8 files changed, 121 insertions, 0 deletions
diff --git a/test/passes/inlining_all-features.txt b/test/passes/inlining_all-features.txt index e909239d2..85b5a03b8 100644 --- a/test/passes/inlining_all-features.txt +++ b/test/passes/inlining_all-features.txt @@ -71,3 +71,18 @@ ) ) ) +(module + (type $none_=>_none (func)) + (export "func_36_invoker" (func $1)) + (func $1 + (block $__inlined_func$0 + (block + (call_ref + (ref.null (func)) + ) + (br $__inlined_func$0) + ) + (br $__inlined_func$0) + ) + ) +) diff --git a/test/passes/inlining_all-features.wast b/test/passes/inlining_all-features.wast index 60093cb63..187673b5c 100644 --- a/test/passes/inlining_all-features.wast +++ b/test/passes/inlining_all-features.wast @@ -58,3 +58,16 @@ (call $0) ) ) +;; inline a return_call_ref +(module + (type $none_=>_none (func)) + (export "func_36_invoker" (func $1)) + (func $0 + (return_call_ref + (ref.null (func)) + ) + ) + (func $1 + (call $0) + ) +) diff --git a/test/passes/optimize-instructions_all-features.txt b/test/passes/optimize-instructions_all-features.txt index e367dc7a0..3b557693d 100644 --- a/test/passes/optimize-instructions_all-features.txt +++ b/test/passes/optimize-instructions_all-features.txt @@ -5698,3 +5698,10 @@ ) ) ) +(module + (type $i32_=>_i32 (func (param i32) (result i32))) + (type $ref_null[i32_->_i32]_=>_i32 (func (param (ref null (func (param i32) (result i32)))) (result i32))) + (func $call_from-param (param $f (ref null (func (param i32) (result i32)))) (result i32) + (unreachable) + ) +) diff --git a/test/passes/optimize-instructions_all-features.wast b/test/passes/optimize-instructions_all-features.wast index 9efd94c22..3b25238c0 100644 --- a/test/passes/optimize-instructions_all-features.wast +++ b/test/passes/optimize-instructions_all-features.wast @@ -6162,3 +6162,13 @@ ) ) ) +;; typed function references +(module + (type $i32-i32 (func (param i32) (result i32))) + ;; this function has a reference parameter. we analyze parameters, and should + ;; not be confused by a type that has no bit size, in particular. this test + ;; just verifies that we do not crash on that. + (func $call_from-param (param $f (ref null $i32-i32)) (result i32) + (unreachable) + ) +) diff --git a/test/passes/simplify-globals_all-features_fuzz-exec.txt b/test/passes/simplify-globals_all-features_fuzz-exec.txt new file mode 100644 index 000000000..03bbff9de --- /dev/null +++ b/test/passes/simplify-globals_all-features_fuzz-exec.txt @@ -0,0 +1,20 @@ +[fuzz-exec] calling export +[fuzz-exec] note result: export => funcref(0) +(module + (type $f32_i31ref_i64_f64_funcref_=>_none (func (param f32 i31ref i64 f64 funcref))) + (type $none_=>_funcref (func (result funcref))) + (global $global$0 (mut funcref) (ref.null func)) + (export "export" (func $1)) + (func $0 (param $0 f32) (param $1 i31ref) (param $2 i64) (param $3 f64) (param $4 funcref) + (nop) + ) + (func $1 (result funcref) + (global.set $global$0 + (ref.func $0) + ) + (ref.func $0) + ) +) +[fuzz-exec] calling export +[fuzz-exec] note result: export => funcref(0) +[fuzz-exec] comparing export diff --git a/test/passes/simplify-globals_all-features_fuzz-exec.wast b/test/passes/simplify-globals_all-features_fuzz-exec.wast new file mode 100644 index 000000000..ff2200ea9 --- /dev/null +++ b/test/passes/simplify-globals_all-features_fuzz-exec.wast @@ -0,0 +1,14 @@ +(module + (global $global$0 (mut funcref) (ref.null func)) + (func $0 (param $0 f32) (param $1 i31ref) (param $2 i64) (param $3 f64) (param $4 funcref) + (nop) + ) + (func "export" (result funcref) + ;; this set's value will be applied to the get right after it. we should carry + ;; over the specific typed function reference type properly while doing so. + (global.set $global$0 + (ref.func $0) + ) + (global.get $global$0) + ) +) diff --git a/test/passes/translate-to-fuzz_all-features_metrics_noprint.txt b/test/passes/translate-to-fuzz_all-features_metrics_noprint.txt new file mode 100644 index 000000000..0a21ed52b --- /dev/null +++ b/test/passes/translate-to-fuzz_all-features_metrics_noprint.txt @@ -0,0 +1,42 @@ +total + [events] : 1 + [exports] : 3 + [funcs] : 2 + [globals] : 6 + [imports] : 6 + [memory-data] : 22 + [table-data] : 0 + [total] : 592 + [vars] : 1 + atomic.cmpxchg : 1 + atomic.fence : 3 + binary : 58 + block : 84 + break : 26 + call : 4 + call_ref : 1 + const : 149 + data.drop : 1 + drop : 3 + global.get : 29 + global.set : 17 + i31.get : 2 + i31.new : 7 + if : 35 + load : 15 + local.get : 10 + local.set : 14 + loop : 13 + memory.init : 1 + nop : 36 + ref.eq : 2 + ref.func : 2 + ref.is_null : 3 + ref.null : 8 + return : 14 + select : 2 + simd_extract : 2 + store : 8 + tuple.extract : 5 + tuple.make : 4 + unary : 33 diff --git a/test/passes/translate-to-fuzz_all-features.wast b/test/passes/translate-to-fuzz_all-features_metrics_noprint.wast index ae1761899..ae1761899 100644 --- a/test/passes/translate-to-fuzz_all-features.wast +++ b/test/passes/translate-to-fuzz_all-features_metrics_noprint.wast |