diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/lit/ctor-eval/array_new_data.wast | 8 | ||||
-rw-r--r-- | test/lit/passes/dae-gc-refine-params.wast | 166 | ||||
-rw-r--r-- | test/lit/passes/dae-gc-refine-return.wast | 76 | ||||
-rw-r--r-- | test/lit/passes/dae-gc.wast | 10 | ||||
-rw-r--r-- | test/lit/passes/gto-removals.wast | 44 | ||||
-rw-r--r-- | test/lit/passes/gufa-refs.wast | 18 | ||||
-rw-r--r-- | test/lit/passes/local-subtyping.wast | 4 | ||||
-rw-r--r-- | test/lit/passes/merge-similar-functions_all-features.wast | 12 | ||||
-rw-r--r-- | test/lit/passes/roundtrip-gc.wast | 6 | ||||
-rw-r--r-- | test/lit/passes/signature-refining.wast | 28 | ||||
-rw-r--r-- | test/lit/passes/vacuum-gc.wast | 20 | ||||
-rw-r--r-- | test/passes/Oz_fuzz-exec_all-features.wast | 4 |
12 files changed, 213 insertions, 183 deletions
diff --git a/test/lit/ctor-eval/array_new_data.wast b/test/lit/ctor-eval/array_new_data.wast index 90551862d..c82fb22fa 100644 --- a/test/lit/ctor-eval/array_new_data.wast +++ b/test/lit/ctor-eval/array_new_data.wast @@ -4,8 +4,8 @@ (module ;; CHECK: (type $0 (func)) - ;; CHECK: (type $[i8] (array i8)) - (type $[i8] (array i8)) + ;; CHECK: (type $"[i8]" (array i8)) + (type $"[i8]" (array i8)) ;; CHECK: (memory $0 16 17 shared) (memory $0 16 17 shared) @@ -18,7 +18,7 @@ ;; CHECK: (func $test (type $0) ;; CHECK-NEXT: (drop - ;; CHECK-NEXT: (array.new_data $[i8] $1 + ;; CHECK-NEXT: (array.new_data $"[i8]" $1 ;; CHECK-NEXT: (i32.const 16) ;; CHECK-NEXT: (i32.const 8) ;; CHECK-NEXT: ) @@ -29,7 +29,7 @@ ;; atm. In fact the module would not validate as we refer to segment 1 here ;; but after flattening only segment 0 exists. (drop - (array.new_data $[i8] $1 + (array.new_data $"[i8]" $1 (i32.const 16) (i32.const 8) ) diff --git a/test/lit/passes/dae-gc-refine-params.wast b/test/lit/passes/dae-gc-refine-params.wast index 51e97456c..78b732a3f 100644 --- a/test/lit/passes/dae-gc-refine-params.wast +++ b/test/lit/passes/dae-gc-refine-params.wast @@ -2,22 +2,22 @@ ;; RUN: wasm-opt %s -all --dae -S -o - | filecheck %s (module - ;; CHECK: (type ${} (sub (struct ))) - (type ${} (sub (struct))) + ;; CHECK: (type $"{}" (sub (struct ))) + (type $"{}" (sub (struct))) - ;; CHECK: (type ${i32} (sub ${} (struct (field i32)))) - (type ${i32} (sub ${} (struct (field i32)))) + ;; CHECK: (type $"{i32}" (sub $"{}" (struct (field i32)))) + (type $"{i32}" (sub $"{}" (struct (field i32)))) - ;; CHECK: (type ${i32_i64} (sub ${i32} (struct (field i32) (field i64)))) + ;; CHECK: (type $"{i32_i64}" (sub $"{i32}" (struct (field i32) (field i64)))) - ;; CHECK: (type ${i32_f32} (sub ${i32} (struct (field i32) (field f32)))) + ;; CHECK: (type $"{i32_f32}" (sub $"{i32}" (struct (field i32) (field f32)))) - ;; CHECK: (type ${f64} (sub ${} (struct (field f64)))) - (type ${f64} (sub ${} (struct (field f64)))) + ;; CHECK: (type $"{f64}" (sub $"{}" (struct (field f64)))) + (type $"{f64}" (sub $"{}" (struct (field f64)))) - (type ${i32_i64} (sub ${i32} (struct (field i32) (field i64)))) + (type $"{i32_i64}" (sub $"{i32}" (struct (field i32) (field i64)))) - (type ${i32_f32} (sub ${i32} (struct (field i32) (field f32)))) + (type $"{i32_f32}" (sub $"{i32}" (struct (field i32) (field f32)))) ;; CHECK: (func $call-various-params-no (type $0) ;; CHECK-NEXT: (call $various-params-no @@ -35,17 +35,17 @@ ;; all nulls are identical and we could do other optimization work due to ;; that. (call $various-params-no - (call $get_{}) - (call $get_{i32}) + (call $"get_{}") + (call $"get_{i32}") ) (call $various-params-no - (call $get_{i32}) - (call $get_{f64}) + (call $"get_{i32}") + (call $"get_{f64}") ) ) ;; This function is called in ways that do not allow us to alter the types of ;; its parameters (see last function). - ;; CHECK: (func $various-params-no (type $7) (param $x (ref null ${})) (param $y (ref null ${})) + ;; CHECK: (func $various-params-no (type $7) (param $x (ref null $"{}")) (param $y (ref null $"{}")) ;; CHECK-NEXT: (drop ;; CHECK-NEXT: (local.get $x) ;; CHECK-NEXT: ) @@ -53,19 +53,28 @@ ;; CHECK-NEXT: (local.get $y) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - (func $various-params-no (param $x (ref null ${})) (param $y (ref null ${})) + (func $various-params-no (param $x (ref null $"{}")) (param $y (ref null $"{}")) ;; "Use" the locals to avoid other optimizations kicking in. (drop (local.get $x)) (drop (local.get $y)) ) - (func $get_{} (result (ref null ${})) + ;; CHECK: (func $"get_{}" (type $8) (result (ref null $"{}")) + ;; CHECK-NEXT: (unreachable) + ;; CHECK-NEXT: ) + (func $"get_{}" (result (ref null $"{}")) (unreachable) ) - (func $get_{i32} (result (ref null ${i32})) + ;; CHECK: (func $"get_{i32}" (type $5) (result (ref null $"{i32}")) + ;; CHECK-NEXT: (unreachable) + ;; CHECK-NEXT: ) + (func $"get_{i32}" (result (ref null $"{i32}")) (unreachable) ) - (func $get_{f64} (result (ref null ${f64})) + ;; CHECK: (func $"get_{f64}" (type $10) (result (ref null $"{f64}")) + ;; CHECK-NEXT: (unreachable) + ;; CHECK-NEXT: ) + (func $"get_{f64}" (result (ref null $"{f64}")) (unreachable) ) @@ -86,19 +95,19 @@ ;; both of those pairs can be optimized to {i32}. ;; There is also an i32 in the middle, which should not confuse us. (call $various-params-yes - (call $get_null_{i32}) + (call $"get_null_{i32}") (i32.const 0) - (call $get_null_{i32}) + (call $"get_null_{i32}") ) (call $various-params-yes - (call $get_null_{i32}) + (call $"get_null_{i32}") (i32.const 1) - (call $get_null_{i32_i64}) + (call $"get_null_{i32_i64}") ) ) ;; This function is called in ways that *do* allow us to alter the types of ;; its parameters (see last function). - ;; CHECK: (func $various-params-yes (type $11) (param $x (ref null ${i32})) (param $i i32) (param $y (ref null ${i32})) + ;; CHECK: (func $various-params-yes (type $11) (param $x (ref null $"{i32}")) (param $i i32) (param $y (ref null $"{i32}")) ;; CHECK-NEXT: (drop ;; CHECK-NEXT: (local.get $x) ;; CHECK-NEXT: ) @@ -109,7 +118,7 @@ ;; CHECK-NEXT: (local.get $y) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - (func $various-params-yes (param $x (ref null ${})) (param $i i32) (param $y (ref null ${})) + (func $various-params-yes (param $x (ref null $"{}")) (param $i i32) (param $y (ref null $"{}")) ;; "Use" the locals to avoid other optimizations kicking in. (drop (local.get $x)) (drop (local.get $i)) @@ -130,19 +139,19 @@ ;; The first argument gets {i32} and {i32}; the second {i32} and {i32_i64; ;; both of those pairs can be optimized to {i32} (call $various-params-set - (call $get_null_{i32}) - (call $get_null_{i32}) + (call $"get_null_{i32}") + (call $"get_null_{i32}") ) (call $various-params-set - (call $get_null_{i32}) - (call $get_null_{i32_i64}) + (call $"get_null_{i32}") + (call $"get_null_{i32_i64}") ) ) ;; This function is called in ways that *do* allow us to alter the types of ;; its parameters (see last function), however, we reuse the parameters by ;; writing to them, which causes problems in one case. - ;; CHECK: (func $various-params-set (type $12) (param $x (ref null ${i32})) (param $y (ref null ${i32})) - ;; CHECK-NEXT: (local $2 (ref null ${})) + ;; CHECK: (func $various-params-set (type $12) (param $x (ref null $"{i32}")) (param $y (ref null $"{i32}")) + ;; CHECK-NEXT: (local $2 (ref null $"{}")) ;; CHECK-NEXT: (local.set $2 ;; CHECK-NEXT: (local.get $x) ;; CHECK-NEXT: ) @@ -154,7 +163,7 @@ ;; CHECK-NEXT: (local.get $y) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (local.set $2 - ;; CHECK-NEXT: (struct.new_default ${}) + ;; CHECK-NEXT: (struct.new_default $"{}") ;; CHECK-NEXT: ) ;; CHECK-NEXT: (drop ;; CHECK-NEXT: (local.get $2) @@ -167,7 +176,7 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - (func $various-params-set (param $x (ref null ${})) (param $y (ref null ${})) + (func $various-params-set (param $x (ref null $"{}")) (param $y (ref null $"{}")) ;; "Use" the locals to avoid other optimizations kicking in. (drop (local.get $x)) (drop (local.get $y)) @@ -175,13 +184,13 @@ ;; force us to do a fixup: the param will get the new type, and a new local ;; will stay at the old type, and we will use that local throughout the ;; function. - (local.set $x (struct.new ${})) + (local.set $x (struct.new $"{}")) (drop (local.get $x) ) ;; Write to $y in a way that does not cause any issue, and we should not do ;; any fixup while we refine the type. - (local.set $y (call $get_null_{i32_i64})) + (local.set $y (call $"get_null_{i32_i64}")) (drop (local.get $y) ) @@ -195,30 +204,30 @@ (func $call-various-params-tee ;; The argument gets {i32}, which allows us to refine. (call $various-params-tee - (call $get_null_{i32}) + (call $"get_null_{i32}") ) ) - ;; CHECK: (func $various-params-tee (type $6) (param $x (ref null ${i32})) + ;; CHECK: (func $various-params-tee (type $6) (param $x (ref null $"{i32}")) ;; CHECK-NEXT: (drop ;; CHECK-NEXT: (local.get $x) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (drop - ;; CHECK-NEXT: (block (result (ref null ${i32})) + ;; CHECK-NEXT: (block (result (ref null $"{i32}")) ;; CHECK-NEXT: (local.tee $x ;; CHECK-NEXT: (call $"get_null_{i32_i64}") ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - (func $various-params-tee (param $x (ref null ${})) + (func $various-params-tee (param $x (ref null $"{}")) ;; "Use" the locals to avoid other optimizations kicking in. (drop (local.get $x)) ;; Write to $x in a way that allows us to make the type more specific. We ;; must also update the type of the tee (if we do not, a validation error ;; would occur), and that will also cause the block's type to update as well. (drop - (block (result (ref null ${})) - (local.tee $x (call $get_null_{i32_i64})) + (block (result (ref null $"{}")) + (local.tee $x (call $"get_null_{i32_i64}")) ) ) ) @@ -243,17 +252,17 @@ ;; The first argument gets non-null values, allowing us to refine it. The ;; second gets only one. (call $various-params-null - (ref.as_non_null (ref.null ${i32})) - (call $get_null_{i32}) + (ref.as_non_null (ref.null $"{i32}")) + (call $"get_null_{i32}") ) (call $various-params-null - (ref.as_non_null (ref.null ${i32})) - (ref.as_non_null (ref.null ${i32})) + (ref.as_non_null (ref.null $"{i32}")) + (ref.as_non_null (ref.null $"{i32}")) ) ) ;; This function is called in ways that allow us to make the first parameter ;; non-nullable. - ;; CHECK: (func $various-params-null (type $13) (param $x (ref none)) (param $y (ref null ${i32})) + ;; CHECK: (func $various-params-null (type $13) (param $x (ref none)) (param $y (ref null $"{i32}")) ;; CHECK-NEXT: (local $temp i32) ;; CHECK-NEXT: (drop ;; CHECK-NEXT: (local.get $x) @@ -265,7 +274,7 @@ ;; CHECK-NEXT: (local.get $temp) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - (func $various-params-null (param $x (ref null ${})) (param $y (ref null ${})) + (func $various-params-null (param $x (ref null $"{}")) (param $y (ref null $"{}")) (local $temp i32) ;; "Use" the locals to avoid other optimizations kicking in. (drop (local.get $x)) @@ -289,18 +298,18 @@ ;; The argument gets {i32_i64} and {i32_f32}. This allows us to refine from ;; {} to {i32}, a type "in the middle". (call $various-params-middle - (call $get_null_{i32_i64}) + (call $"get_null_{i32_i64}") ) (call $various-params-middle - (call $get_null_{i32_f32}) + (call $"get_null_{i32_f32}") ) ) - ;; CHECK: (func $various-params-middle (type $6) (param $x (ref null ${i32})) + ;; CHECK: (func $various-params-middle (type $6) (param $x (ref null $"{i32}")) ;; CHECK-NEXT: (drop ;; CHECK-NEXT: (local.get $x) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - (func $various-params-middle (param $x (ref null ${})) + (func $various-params-middle (param $x (ref null $"{}")) ;; "Use" the local to avoid other optimizations kicking in. (drop (local.get $x)) ) @@ -310,14 +319,14 @@ ;; CHECK-NEXT: (nop) ;; CHECK-NEXT: ) (func $unused-and-refinable (param $0 structref) - ;; This function does not use $0. It is called with ${}, so it is also + ;; This function does not use $0. It is called with $"{}", so it is also ;; a parameter whose type we can refine. Do not do both operations: instead, ;; just remove it because it is ignored, without altering the type (handling ;; both operations would introduce some corner cases, and it just isn't worth ;; handling them if the param is completely unused anyhow). We should see in ;; the test output that the local $0 (the unused param) becomes a local ;; because it is unused, and that local does *not* have its type refined to - ;; ${} (it will however be changed to be nullable, which it must be as a + ;; $"{}" (it will however be changed to be nullable, which it must be as a ;; local). ) @@ -326,11 +335,11 @@ ;; CHECK-NEXT: ) (func $call-unused-and-refinable (call $unused-and-refinable - (struct.new_default ${}) + (struct.new_default $"{}") ) ) - ;; CHECK: (func $non-nullable-fixup (type $14) (param $0 (ref ${})) + ;; CHECK: (func $non-nullable-fixup (type $14) (param $0 (ref $"{}")) ;; CHECK-NEXT: (local $1 structref) ;; CHECK-NEXT: (local.set $1 ;; CHECK-NEXT: (local.get $0) @@ -350,12 +359,12 @@ ;; CHECK: (func $call-non-nullable-fixup (type $0) ;; CHECK-NEXT: (call $non-nullable-fixup - ;; CHECK-NEXT: (struct.new_default ${}) + ;; CHECK-NEXT: (struct.new_default $"{}") ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) (func $call-non-nullable-fixup (call $non-nullable-fixup - (struct.new_default ${}) + (struct.new_default $"{}") ) ) @@ -364,7 +373,7 @@ ;; CHECK-NEXT: (ref.null none) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (call $update-null - ;; CHECK-NEXT: (struct.new_default ${}) + ;; CHECK-NEXT: (struct.new_default $"{}") ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) (func $call-update-null @@ -374,44 +383,65 @@ (ref.null any) ) (call $update-null - (struct.new_default ${}) + (struct.new_default $"{}") ) ) - ;; CHECK: (func $update-null (type $15) (param $x (ref null ${})) + ;; CHECK: (func $update-null (type $15) (param $x (ref null $"{}")) ;; CHECK-NEXT: (drop ;; CHECK-NEXT: (local.get $x) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) (func $update-null (param $x (ref null any)) ;; "Use" the param to avoid other optimizations kicking in. We should only - ;; see the type of the param refined to a null ${} after updating the null + ;; see the type of the param refined to a null $"{}" after updating the null ;; in the caller. (drop (local.get $x)) ) - (func $get_null_{i32} (result (ref null ${i32})) - ;; Helper function that returns a null value of ${i32}. We use this instead of + ;; CHECK: (func $"get_null_{i32}" (type $5) (result (ref null $"{i32}")) + ;; CHECK-NEXT: (select (result (ref null $"{i32}")) + ;; CHECK-NEXT: (ref.null none) + ;; CHECK-NEXT: (struct.new_default $"{i32}") + ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + (func $"get_null_{i32}" (result (ref null $"{i32}")) + ;; Helper function that returns a null value of $"{i32}." We use this instead of ;; a direct ref.null because those can be rewritten by LUBFinder. (select (ref.null none) - (struct.new_default ${i32}) + (struct.new_default $"{i32}") (i32.const 0) ) ) - (func $get_null_{i32_i64} (result (ref null ${i32_i64})) + ;; CHECK: (func $"get_null_{i32_i64}" (type $16) (result (ref null $"{i32_i64}")) + ;; CHECK-NEXT: (select (result (ref null $"{i32_i64}")) + ;; CHECK-NEXT: (ref.null none) + ;; CHECK-NEXT: (struct.new_default $"{i32_i64}") + ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + (func $"get_null_{i32_i64}" (result (ref null $"{i32_i64}")) (select (ref.null none) - (struct.new_default ${i32_i64}) + (struct.new_default $"{i32_i64}") (i32.const 0) ) ) - (func $get_null_{i32_f32} (result (ref null ${i32_f32})) + ;; CHECK: (func $"get_null_{i32_f32}" (type $17) (result (ref null $"{i32_f32}")) + ;; CHECK-NEXT: (select (result (ref null $"{i32_f32}")) + ;; CHECK-NEXT: (ref.null none) + ;; CHECK-NEXT: (struct.new_default $"{i32_f32}") + ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + (func $"get_null_{i32_f32}" (result (ref null $"{i32_f32}")) (select (ref.null none) - (struct.new_default ${i32_f32}) + (struct.new_default $"{i32_f32}") (i32.const 0) ) ) diff --git a/test/lit/passes/dae-gc-refine-return.wast b/test/lit/passes/dae-gc-refine-return.wast index f478c2ff3..24ad4e61b 100644 --- a/test/lit/passes/dae-gc-refine-return.wast +++ b/test/lit/passes/dae-gc-refine-return.wast @@ -2,20 +2,20 @@ ;; RUN: wasm-opt %s -all --dae -S -o - | filecheck %s (module - ;; CHECK: (type ${} (sub (struct ))) - (type ${} (sub (struct))) + ;; CHECK: (type $"{}" (sub (struct ))) + (type $"{}" (sub (struct))) - ;; CHECK: (type $return_{} (func (result (ref ${})))) - (type $return_{} (func (result (ref ${})))) + ;; CHECK: (type $"return_{}" (func (result (ref $"{}")))) + (type $"return_{}" (func (result (ref $"{}")))) - ;; CHECK: (type ${i32} (sub ${} (struct (field i32)))) - (type ${i32} (sub ${} (struct (field i32)))) + ;; CHECK: (type $"{i32}" (sub $"{}" (struct (field i32)))) + (type $"{i32}" (sub $"{}" (struct (field i32)))) - ;; CHECK: (type ${i32_f32} (sub ${i32} (struct (field i32) (field f32)))) - (type ${i32_f32} (sub ${i32} (struct (field i32) (field f32)))) + ;; CHECK: (type $"{i32_f32}" (sub $"{i32}" (struct (field i32) (field f32)))) + (type $"{i32_f32}" (sub $"{i32}" (struct (field i32) (field f32)))) - ;; CHECK: (type ${i32_i64} (sub ${i32} (struct (field i32) (field i64)))) - (type ${i32_i64} (sub ${i32} (struct (field i32) (field i64)))) + ;; CHECK: (type $"{i32_i64}" (sub $"{i32}" (struct (field i32) (field i64)))) + (type $"{i32_i64}" (sub $"{i32}" (struct (field i32) (field i64)))) (table 1 1 funcref) @@ -315,13 +315,13 @@ ;; Show that we can optimize the return type of a function that does a tail ;; call. - ;; CHECK: (func $tail-callee (type $return_{}) (result (ref ${})) + ;; CHECK: (func $tail-callee (type $"return_{}") (result (ref $"{}")) ;; CHECK-NEXT: (unreachable) ;; CHECK-NEXT: ) - (func $tail-callee (result (ref ${})) + (func $tail-callee (result (ref $"{}")) (unreachable) ) - ;; CHECK: (func $tail-caller-yes (type $return_{}) (result (ref ${})) + ;; CHECK: (func $tail-caller-yes (type $"return_{}") (result (ref $"{}")) ;; CHECK-NEXT: (return_call $tail-callee) ;; CHECK-NEXT: ) (func $tail-caller-yes (result anyref) @@ -372,19 +372,19 @@ ) ;; As above, but with an indirect tail call. - ;; CHECK: (func $tail-callee-indirect (type $return_{}) (result (ref ${})) + ;; CHECK: (func $tail-callee-indirect (type $"return_{}") (result (ref $"{}")) ;; CHECK-NEXT: (unreachable) ;; CHECK-NEXT: ) - (func $tail-callee-indirect (result (ref ${})) + (func $tail-callee-indirect (result (ref $"{}")) (unreachable) ) - ;; CHECK: (func $tail-caller-indirect-yes (type $return_{}) (result (ref ${})) - ;; CHECK-NEXT: (return_call_indirect $0 (type $return_{}) + ;; CHECK: (func $tail-caller-indirect-yes (type $"return_{}") (result (ref $"{}")) + ;; CHECK-NEXT: (return_call_indirect $0 (type $"return_{}") ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) (func $tail-caller-indirect-yes (result anyref) - (return_call_indirect (type $return_{}) (i32.const 0)) + (return_call_indirect (type $"return_{}") (i32.const 0)) ) ;; CHECK: (func $tail-caller-indirect-no (type $2) (result anyref) ;; CHECK-NEXT: (local $any anyref) @@ -396,7 +396,7 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (return_call_indirect $0 (type $return_{}) + ;; CHECK-NEXT: (return_call_indirect $0 (type $"return_{}") ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -408,7 +408,7 @@ (return (local.get $any)) ) ) - (return_call_indirect (type $return_{}) (i32.const 0)) + (return_call_indirect (type $"return_{}") (i32.const 0)) ) ;; CHECK: (func $tail-call-caller-indirect (type $4) ;; CHECK-NEXT: (drop @@ -428,26 +428,26 @@ ) ;; As above, but with a tail call by function reference. - ;; CHECK: (func $tail-callee-call_ref (type $return_{}) (result (ref ${})) + ;; CHECK: (func $tail-callee-call_ref (type $"return_{}") (result (ref $"{}")) ;; CHECK-NEXT: (unreachable) ;; CHECK-NEXT: ) - (func $tail-callee-call_ref (result (ref ${})) + (func $tail-callee-call_ref (result (ref $"{}")) (unreachable) ) - ;; CHECK: (func $tail-caller-call_ref-yes (type $return_{}) (result (ref ${})) - ;; CHECK-NEXT: (local $"return_{}" (ref null $return_{})) - ;; CHECK-NEXT: (return_call_ref $return_{} + ;; CHECK: (func $tail-caller-call_ref-yes (type $"return_{}") (result (ref $"{}")) + ;; CHECK-NEXT: (local $"return_{}" (ref null $"return_{}")) + ;; CHECK-NEXT: (return_call_ref $"return_{}" ;; CHECK-NEXT: (local.get $"return_{}") ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) (func $tail-caller-call_ref-yes (result anyref) - (local $return_{} (ref null $return_{})) + (local $"return_{}" (ref null $"return_{}")) - (return_call_ref $return_{} (local.get $return_{})) + (return_call_ref $"return_{}" (local.get $"return_{}")) ) ;; CHECK: (func $tail-caller-call_ref-no (type $2) (result anyref) ;; CHECK-NEXT: (local $any anyref) - ;; CHECK-NEXT: (local $"return_{}" (ref null $return_{})) + ;; CHECK-NEXT: (local $"return_{}" (ref null $"return_{}")) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.const 1) ;; CHECK-NEXT: (then @@ -456,20 +456,20 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (return_call_ref $return_{} + ;; CHECK-NEXT: (return_call_ref $"return_{}" ;; CHECK-NEXT: (local.get $"return_{}") ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) (func $tail-caller-call_ref-no (result anyref) (local $any anyref) - (local $return_{} (ref null $return_{})) + (local $"return_{}" (ref null $"return_{}")) (if (i32.const 1) (then (return (local.get $any)) ) ) - (return_call_ref $return_{} (local.get $return_{})) + (return_call_ref $"return_{}" (local.get $"return_{}")) ) ;; CHECK: (func $tail-caller-call_ref-unreachable (type $2) (result anyref) ;; CHECK-NEXT: (block ;; (replaces something unreachable we can't emit) @@ -482,7 +482,7 @@ (func $tail-caller-call_ref-unreachable (result anyref) ;; An unreachable means there is no function signature to even look at. We ;; should not hit an assertion on such things. - (return_call_ref $return_{} (unreachable)) + (return_call_ref $"return_{}" (unreachable)) ) ;; CHECK: (func $tail-call-caller-call_ref (type $4) ;; CHECK-NEXT: (drop @@ -507,7 +507,7 @@ ) ) - ;; CHECK: (func $update-null (type $10) (param $x i32) (param $y i32) (result (ref null ${i32})) + ;; CHECK: (func $update-null (type $10) (param $x i32) (param $y i32) (result (ref null $"{i32}")) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (local.get $x) ;; CHECK-NEXT: (then @@ -515,7 +515,7 @@ ;; CHECK-NEXT: (local.get $y) ;; CHECK-NEXT: (then ;; CHECK-NEXT: (return - ;; CHECK-NEXT: (struct.new_default ${i32_f32}) + ;; CHECK-NEXT: (struct.new_default $"{i32_f32}") ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (else @@ -527,21 +527,21 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (else ;; CHECK-NEXT: (return - ;; CHECK-NEXT: (struct.new_default ${i32_i64}) + ;; CHECK-NEXT: (struct.new_default $"{i32_i64}") ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) (func $update-null (param $x i32) (param $y i32) (result anyref) ;; Of the three returns here, the null can be updated, and the LUB is - ;; determined by the other two, and is their shared parent ${}. + ;; determined by the other two, and is their shared parent $"{}." (if (local.get $x) (then (if (local.get $y) (then - (return (struct.new_default ${i32_f32})) + (return (struct.new_default $"{i32_f32}")) ) (else (return (ref.null any)) @@ -549,7 +549,7 @@ ) ) (else - (return (struct.new_default ${i32_i64})) + (return (struct.new_default $"{i32_i64}")) ) ) ) diff --git a/test/lit/passes/dae-gc.wast b/test/lit/passes/dae-gc.wast index 02a2462db..a5625b852 100644 --- a/test/lit/passes/dae-gc.wast +++ b/test/lit/passes/dae-gc.wast @@ -2,8 +2,8 @@ ;; RUN: foreach %s %t wasm-opt -all --dae -S -o - | filecheck %s (module - ;; CHECK: (type ${} (struct )) - (type ${} (struct)) + ;; CHECK: (type $"{}" (struct )) + (type $"{}" (struct)) ;; CHECK: (func $foo (type $0) ;; CHECK-NEXT: (call $bar) @@ -50,10 +50,10 @@ ;; A function that gets a non-nullable reference that is never used. We can ;; still create a non-nullable local for that parameter. ;; CHECK: (func $get-nonnull (type $0) - ;; CHECK-NEXT: (local $0 (ref ${})) + ;; CHECK-NEXT: (local $0 (ref $"{}")) ;; CHECK-NEXT: (nop) ;; CHECK-NEXT: ) - (func $get-nonnull (param $0 (ref ${})) + (func $get-nonnull (param $0 (ref $"{}")) (nop) ) ;; CHECK: (func $send-nonnull (type $0) @@ -61,7 +61,7 @@ ;; CHECK-NEXT: ) (func $send-nonnull (call $get-nonnull - (struct.new ${}) + (struct.new $"{}") ) ) ) diff --git a/test/lit/passes/gto-removals.wast b/test/lit/passes/gto-removals.wast index ec4cc38df..bcc3f0463 100644 --- a/test/lit/passes/gto-removals.wast +++ b/test/lit/passes/gto-removals.wast @@ -796,21 +796,21 @@ (module ;; CHECK: (rec - ;; CHECK-NEXT: (type $0 (func (result (ref ${mut:i8})))) + ;; CHECK-NEXT: (type $0 (func (result (ref $"{mut:i8}")))) ;; CHECK: (type $1 (func (result i32))) ;; CHECK: (type $2 (func)) - ;; CHECK: (type ${mut:i8} (sub (struct ))) - (type ${mut:i8} (sub (struct (field (mut i8))))) + ;; CHECK: (type $"{mut:i8}" (sub (struct ))) + (type $"{mut:i8}" (sub (struct (field (mut i8))))) - ;; CHECK: (type $4 (func (param (ref null ${mut:i8})))) + ;; CHECK: (type $4 (func (param (ref null $"{mut:i8}")))) - ;; CHECK: (func $unreachable-set (type $4) (param $"{mut:i8}" (ref null ${mut:i8})) + ;; CHECK: (func $unreachable-set (type $4) (param $"{mut:i8}" (ref null $"{mut:i8}")) ;; CHECK-NEXT: (drop ;; CHECK-NEXT: (ref.as_non_null - ;; CHECK-NEXT: (block (result (ref null ${mut:i8})) + ;; CHECK-NEXT: (block (result (ref null $"{mut:i8}")) ;; CHECK-NEXT: (drop ;; CHECK-NEXT: (call $helper-i32) ;; CHECK-NEXT: ) @@ -819,19 +819,19 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - (func $unreachable-set (param ${mut:i8} (ref null ${mut:i8})) + (func $unreachable-set (param $"{mut:i8}" (ref null $"{mut:i8}")) ;; The struct type has no reads, so we want to remove all of the sets of it. ;; This struct.set will trap on null, but first the call must run. When we ;; optimize here we should be careful to not emit something with different ;; ordering (naively emitting ref.as_non_null on the reference would trap ;; before the call, so we must reorder). - (struct.set ${mut:i8} 0 - (local.get ${mut:i8}) + (struct.set $"{mut:i8}" 0 + (local.get $"{mut:i8}") (call $helper-i32) ) ) - ;; CHECK: (func $unreachable-set-2 (type $4) (param $"{mut:i8}" (ref null ${mut:i8})) + ;; CHECK: (func $unreachable-set-2 (type $4) (param $"{mut:i8}" (ref null $"{mut:i8}")) ;; CHECK-NEXT: (block $block ;; CHECK-NEXT: (drop ;; CHECK-NEXT: (ref.as_non_null @@ -847,18 +847,18 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - (func $unreachable-set-2 (param ${mut:i8} (ref null ${mut:i8})) + (func $unreachable-set-2 (param $"{mut:i8}" (ref null $"{mut:i8}")) ;; As above, but the side effects now are a br. Again, the br must happen ;; before the trap (in fact, the br will skip the trap here). (block - (struct.set ${mut:i8} 0 - (local.get ${mut:i8}) + (struct.set $"{mut:i8}" 0 + (local.get $"{mut:i8}") (br $block) ) ) ) - ;; CHECK: (func $unreachable-set-2b (type $4) (param $"{mut:i8}" (ref null ${mut:i8})) + ;; CHECK: (func $unreachable-set-2b (type $4) (param $"{mut:i8}" (ref null $"{mut:i8}")) ;; CHECK-NEXT: (nop) ;; CHECK-NEXT: (drop ;; CHECK-NEXT: (ref.as_non_null @@ -873,23 +873,23 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - (func $unreachable-set-2b (param ${mut:i8} (ref null ${mut:i8})) + (func $unreachable-set-2b (param $"{mut:i8}" (ref null $"{mut:i8}")) ;; As above, but with an unreachable instead of a br. We add a nop here so ;; that we are inside of a block, and then validation would fail if we do ;; not keep the type of the replacement for the struct.set identical to the ;; struct.set. That is, the type must remain unreachable. (nop) - (struct.set ${mut:i8} 0 - (local.get ${mut:i8}) + (struct.set $"{mut:i8}" 0 + (local.get $"{mut:i8}") (unreachable) ) ) ;; CHECK: (func $unreachable-set-3 (type $2) - ;; CHECK-NEXT: (local $0 (ref ${mut:i8})) + ;; CHECK-NEXT: (local $0 (ref $"{mut:i8}")) ;; CHECK-NEXT: (drop ;; CHECK-NEXT: (ref.as_non_null - ;; CHECK-NEXT: (block (result (ref ${mut:i8})) + ;; CHECK-NEXT: (block (result (ref $"{mut:i8}")) ;; CHECK-NEXT: (local.set $0 ;; CHECK-NEXT: (call $helper-ref) ;; CHECK-NEXT: ) @@ -904,7 +904,7 @@ (func $unreachable-set-3 ;; As above, but now we have side effects in both children. (block - (struct.set ${mut:i8} 0 + (struct.set $"{mut:i8}" 0 (call $helper-ref) (call $helper-i32) ) @@ -918,10 +918,10 @@ (i32.const 1) ) - ;; CHECK: (func $helper-ref (type $0) (result (ref ${mut:i8})) + ;; CHECK: (func $helper-ref (type $0) (result (ref $"{mut:i8}")) ;; CHECK-NEXT: (unreachable) ;; CHECK-NEXT: ) - (func $helper-ref (result (ref ${mut:i8})) + (func $helper-ref (result (ref $"{mut:i8}")) (unreachable) ) ) diff --git a/test/lit/passes/gufa-refs.wast b/test/lit/passes/gufa-refs.wast index 168fcd0df..c2c9564ad 100644 --- a/test/lit/passes/gufa-refs.wast +++ b/test/lit/passes/gufa-refs.wast @@ -2207,12 +2207,12 @@ ) (module - ;; CHECK: (type ${} (sub (struct ))) - (type ${} (sub (struct))) + ;; CHECK: (type $"{}" (sub (struct ))) + (type $"{}" (sub (struct))) - ;; CHECK: (type $1 (func (result (ref ${})))) + ;; CHECK: (type $1 (func (result (ref $"{}")))) - ;; CHECK: (func $func (type $1) (result (ref ${})) + ;; CHECK: (func $func (type $1) (result (ref $"{}")) ;; CHECK-NEXT: (drop ;; CHECK-NEXT: (block $block (result (ref none)) ;; CHECK-NEXT: (br_on_non_null $block @@ -2223,7 +2223,7 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (unreachable) ;; CHECK-NEXT: ) - (func $func (result (ref ${})) + (func $func (result (ref $"{}")) ;; This block can only return a null in theory (in practice, not even that - ;; the br will not be taken, but this pass is not smart enough to see that). ;; We can optimize to an unreachable here, but must be careful - we cannot @@ -2231,9 +2231,9 @@ ;; removed the br, which we don't do atm). All we will do is add an ;; unreachable after the block, on the outside of it (which would help other ;; passes do more work). - (block $block (result (ref ${})) + (block $block (result (ref $"{}")) (br_on_non_null $block - (ref.null ${}) + (ref.null $"{}") ) (unreachable) ) @@ -5624,7 +5624,7 @@ ;; Test that we do not error on array.init of a bottom type. (module - (type $[mut:i32] (array (mut i32))) + (type $"[mut:i32]" (array (mut i32))) ;; CHECK: (type $0 (func)) @@ -5640,7 +5640,7 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) (func $test - (array.init_data $[mut:i32] $0 + (array.init_data $"[mut:i32]" $0 (ref.as_non_null (ref.null none) ) diff --git a/test/lit/passes/local-subtyping.wast b/test/lit/passes/local-subtyping.wast index 89ba6429a..b25bb41b1 100644 --- a/test/lit/passes/local-subtyping.wast +++ b/test/lit/passes/local-subtyping.wast @@ -8,9 +8,9 @@ ;; testcases. (module - (type ${} (sub (struct))) + (type $"{}" (sub (struct))) - (type ${i32} (sub (struct (field i32)))) + (type $"{i32}" (sub (struct (field i32)))) (type $array (sub (array i8))) diff --git a/test/lit/passes/merge-similar-functions_all-features.wast b/test/lit/passes/merge-similar-functions_all-features.wast index ddc9a200f..74abd8c52 100644 --- a/test/lit/passes/merge-similar-functions_all-features.wast +++ b/test/lit/passes/merge-similar-functions_all-features.wast @@ -4,8 +4,8 @@ (module ;; CHECK: (type $0 (func)) - ;; CHECK: (type $[i8] (array i8)) - (type $[i8] (array i8)) + ;; CHECK: (type $"[i8]" (array i8)) + (type $"[i8]" (array i8)) ;; CHECK: (type $2 (func (param arrayref))) @@ -50,7 +50,7 @@ ;; CHECK-NEXT: (nop) ;; CHECK-NEXT: (nop) ;; CHECK-NEXT: (call $take-ref-null-array - ;; CHECK-NEXT: (array.new_fixed $[i8] 0) + ;; CHECK-NEXT: (array.new_fixed $"[i8]" 0) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) (func $no-call-subtyping-same-operand-0 @@ -58,7 +58,7 @@ (nop) (nop) (nop) (nop) (nop) (nop) (nop) (nop) (nop) (nop) (nop) (nop) (call $take-ref-null-array - (array.new_fixed $[i8] 0) + (array.new_fixed $"[i8]" 0) ) ) ;; CHECK: (func $no-call-subtyping-same-operand-1 (type $0) @@ -81,7 +81,7 @@ ;; CHECK-NEXT: (nop) ;; CHECK-NEXT: (nop) ;; CHECK-NEXT: (call $take-ref-eq - ;; CHECK-NEXT: (array.new_fixed $[i8] 0) + ;; CHECK-NEXT: (array.new_fixed $"[i8]" 0) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) (func $no-call-subtyping-same-operand-1 @@ -89,7 +89,7 @@ (nop) (nop) (nop) (nop) (nop) (nop) (nop) (nop) (nop) (nop) (nop) (nop) (call $take-ref-eq - (array.new_fixed $[i8] 0) + (array.new_fixed $"[i8]" 0) ) ) ) diff --git a/test/lit/passes/roundtrip-gc.wast b/test/lit/passes/roundtrip-gc.wast index 382f238d9..57300def5 100644 --- a/test/lit/passes/roundtrip-gc.wast +++ b/test/lit/passes/roundtrip-gc.wast @@ -2,7 +2,7 @@ ;; RUN: wasm-opt %s -all --generate-stack-ir --optimize-stack-ir --roundtrip -S -o - | filecheck %s (module - (type ${i32} (struct (field i32))) + (type $"{i32}" (struct (field i32))) ;; CHECK: (export "export" (func $test)) (export "export" (func $test)) ;; CHECK: (func $test (type $1) @@ -20,7 +20,7 @@ ;; CHECK-NEXT: ) (func $test (call $help - (struct.new_default ${i32}) + (struct.new_default $"{i32}") ;; Stack IR optimizations can remove this block, leaving a call in an odd ;; "stacky" location. On load, we will use a local to work around that. It ;; is fine for the local to be non-nullable since the get is later in that @@ -33,7 +33,7 @@ ) ;; CHECK: (func $help (type $2) (param $3 (ref $\7bi32\7d)) (param $4 i32) ;; CHECK-NEXT: ) - (func $help (param $3 (ref ${i32})) (param $4 i32) + (func $help (param $3 (ref $"{i32}")) (param $4 i32) (nop) ) diff --git a/test/lit/passes/signature-refining.wast b/test/lit/passes/signature-refining.wast index 103cbe7f9..7b4b7921e 100644 --- a/test/lit/passes/signature-refining.wast +++ b/test/lit/passes/signature-refining.wast @@ -728,12 +728,12 @@ ) (module - ;; CHECK: (type ${} (struct )) - (type ${} (struct)) + ;; CHECK: (type $"{}" (struct )) + (type $"{}" (struct)) - ;; CHECK: (type $1 (func (param (ref ${}) i32))) + ;; CHECK: (type $1 (func (param (ref $"{}") i32))) - ;; CHECK: (func $foo (type $1) (param $ref (ref ${})) (param $i32 i32) + ;; CHECK: (func $foo (type $1) (param $ref (ref $"{}")) (param $i32 i32) ;; CHECK-NEXT: (local $2 eqref) ;; CHECK-NEXT: (local.set $2 ;; CHECK-NEXT: (local.get $ref) @@ -752,19 +752,19 @@ ;; CHECK-NEXT: ) (func $foo (param $ref eqref) (param $i32 i32) (call $foo - ;; The only reference to the ${} type is in this block signature. Even + ;; The only reference to the $"{}" type is in this block signature. Even ;; this will go away in the internal ReFinalize (which makes the block ;; type unreachable). - (block (result (ref ${})) + (block (result (ref $"{}")) (unreachable) ) (i32.const 0) ) ;; Write something of type eqref into $ref. When we refine the type of the - ;; parameter from eqref to ${} we must do something here, as we can no + ;; parameter from eqref to $"{}" we must do something here, as we can no ;; longer just write this (ref.null eq) into a parameter of the more ;; refined type. While doing so, we must not be confused by the fact that - ;; the only mention of ${} in the original module gets removed during our + ;; the only mention of $"{}" in the original module gets removed during our ;; processing, as mentioned in the earlier comment. This is a regression ;; test for a crash because of that. (local.set $ref @@ -873,25 +873,25 @@ (module ;; CHECK: (rec - ;; CHECK-NEXT: (type $0 (func (param (ref $[i8])))) + ;; CHECK-NEXT: (type $0 (func (param (ref $"[i8]")))) - ;; CHECK: (type $[i8] (array i8)) - (type $[i8] (array i8)) + ;; CHECK: (type $"[i8]" (array i8)) + (type $"[i8]" (array i8)) ;; CHECK: (type $2 (func)) ;; CHECK: (func $0 (type $2) ;; CHECK-NEXT: (call $1 - ;; CHECK-NEXT: (array.new_fixed $[i8] 0) + ;; CHECK-NEXT: (array.new_fixed $"[i8]" 0) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) (func $0 (call $1 - (array.new_fixed $[i8] 0) + (array.new_fixed $"[i8]" 0) ) ) - ;; CHECK: (func $1 (type $0) (param $2 (ref $[i8])) + ;; CHECK: (func $1 (type $0) (param $2 (ref $"[i8]")) ;; CHECK-NEXT: (drop ;; CHECK-NEXT: (ref.cast (ref none) ;; CHECK-NEXT: (local.get $2) diff --git a/test/lit/passes/vacuum-gc.wast b/test/lit/passes/vacuum-gc.wast index 27cd6f52d..778ee8cd5 100644 --- a/test/lit/passes/vacuum-gc.wast +++ b/test/lit/passes/vacuum-gc.wast @@ -2,14 +2,14 @@ ;; RUN: wasm-opt %s --vacuum -all -S -o - | filecheck %s (module - ;; CHECK: (type ${} (struct )) + ;; CHECK: (type $"{}" (struct )) ;; CHECK: (import "binaryen-intrinsics" "call.without.effects" (func $call.without.effects (type $2) (param i32 i32 funcref) (result anyref))) (import "binaryen-intrinsics" "call.without.effects" (func $call.without.effects (param i32 i32 funcref) (result (ref null any)))) ;; CHECK: (import "binaryen-intrinsics" "call.without.effects" (func $call.without.effects.non.null (type $3) (param i32 i32 funcref) (result (ref any)))) (import "binaryen-intrinsics" "call.without.effects" (func $call.without.effects.non.null (param i32 i32 funcref) (result (ref any)))) - (type ${} (struct)) + (type $"{}" (struct)) ;; CHECK: (func $drop-ref-as (type $4) (param $x anyref) ;; CHECK-NEXT: (drop @@ -43,7 +43,7 @@ ;; CHECK-NEXT: ) (func $vacuum-nonnull (drop - (if (result (ref ${})) + (if (result (ref $"{}")) (i32.const 1) ;; This block's result is not used. As a consequence vacuum will try to ;; generate a replacement zero for the block's fallthrough value. A @@ -52,8 +52,8 @@ ;; on this case, though. Instead, the end result of this function should ;; simply be empty, as everything here can be vacuumed away. (then - (block (result (ref ${})) - (struct.new ${}) + (block (result (ref $"{}")) + (struct.new $"{}") ) ) (else @@ -84,18 +84,18 @@ ) ) - ;; CHECK: (func $ref.cast.null.block (type $6) (param $ref (ref ${})) (result structref) - ;; CHECK-NEXT: (ref.cast (ref ${}) + ;; CHECK: (func $ref.cast.null.block (type $6) (param $ref (ref $"{}")) (result structref) + ;; CHECK-NEXT: (ref.cast (ref $"{}") ;; CHECK-NEXT: (local.get $ref) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - (func $ref.cast.null.block (param $ref (ref ${})) (result (ref null struct)) + (func $ref.cast.null.block (param $ref (ref $"{}")) (result (ref null struct)) ;; We can vacuum away the block, which will make this ref.cast null operate ;; on a non-nullable input. That is, we are refining the input to the cast. ;; The cast must be updated properly following that, to be a non-nullable ;; cast. - (ref.cast (ref null ${}) - (block (result (ref null ${})) + (ref.cast (ref null $"{}") + (block (result (ref null $"{}")) (local.get $ref) ) ) diff --git a/test/passes/Oz_fuzz-exec_all-features.wast b/test/passes/Oz_fuzz-exec_all-features.wast index 3893ddccd..7e45febf7 100644 --- a/test/passes/Oz_fuzz-exec_all-features.wast +++ b/test/passes/Oz_fuzz-exec_all-features.wast @@ -393,13 +393,13 @@ ) ) (module - (type $[mut:i8] (array (mut i8))) + (type $"[mut:i8]" (array (mut i8))) (func $foo (export "foo") (result i32) ;; before opts this will trap on failing to allocate -1 >>> 0 bytes. after ;; opts the unused value is removed so there is no trap, and a value is ;; returned, which should not confuse the fuzzer. (drop - (array.new_default $[mut:i8] + (array.new_default $"[mut:i8]" (i32.const -1) ) ) |