diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/passes/remove-unused-brs_all-features.txt | 17 | ||||
-rw-r--r-- | test/passes/remove-unused-brs_all-features.wast | 16 |
2 files changed, 33 insertions, 0 deletions
diff --git a/test/passes/remove-unused-brs_all-features.txt b/test/passes/remove-unused-brs_all-features.txt index 3365ebb75..f8308c65f 100644 --- a/test/passes/remove-unused-brs_all-features.txt +++ b/test/passes/remove-unused-brs_all-features.txt @@ -1,8 +1,12 @@ (module (type $struct (struct (field (ref null $vector)))) (type $vector (array (mut i32))) + (type $i32_=>_none (func (param i32))) + (type $none_=>_i32 (func (result i32))) (type $none_=>_f64 (func (result f64))) + (type $i32_=>_funcref (func (param i32) (result funcref))) (type $none_=>_ref?|$struct| (func (result (ref null $struct)))) + (elem declare func $i32_=>_none $none_=>_i32) (func $foo (result (ref null $struct)) (if (result (ref null $struct)) (i32.const 1) @@ -33,4 +37,17 @@ ) ) ) + (func $none_=>_i32 (result i32) + (unreachable) + ) + (func $i32_=>_none (param $0 i32) + (nop) + ) + (func $selectify (param $x i32) (result funcref) + (select (result funcref) + (ref.func $none_=>_i32) + (ref.func $i32_=>_none) + (local.get $x) + ) + ) ) diff --git a/test/passes/remove-unused-brs_all-features.wast b/test/passes/remove-unused-brs_all-features.wast index 3703bb9f2..1da00291d 100644 --- a/test/passes/remove-unused-brs_all-features.wast +++ b/test/passes/remove-unused-brs_all-features.wast @@ -16,6 +16,7 @@ (ref.null $struct) ) ) + (func $test-prefinalize (result f64) (loop $loop (result f64) (block $block (result f64) @@ -37,4 +38,19 @@ ) ) ) + + (func $none_=>_i32 (result i32) + (unreachable) + ) + (func $i32_=>_none (param i32) + ) + (func $selectify (param $x i32) (result funcref) + ;; this if has arms with different function types, for which funcref is the + ;; LUB + (if (result funcref) + (local.get $x) + (ref.func $none_=>_i32) + (ref.func $i32_=>_none) + ) + ) ) |