diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/passes/stub-unsupported-js.txt | 26 | ||||
-rw-r--r-- | test/passes/stub-unsupported-js.wast | 21 |
2 files changed, 47 insertions, 0 deletions
diff --git a/test/passes/stub-unsupported-js.txt b/test/passes/stub-unsupported-js.txt index 531c767c0..784431116 100644 --- a/test/passes/stub-unsupported-js.txt +++ b/test/passes/stub-unsupported-js.txt @@ -22,3 +22,29 @@ ) ) ) +(module + (type $none_=>_none (func)) + (type $none_=>_i32 (func (result i32))) + (type $none_=>_f32 (func (result f32))) + (table $0 2 2 funcref) + (elem (i32.const 1) $return-f32) + (func $return-f32 (result f32) + (f32.const 3.141590118408203) + ) + (func $bad-indirect-call + (drop + (i32.const 1) + ) + ) + (func $bad-indirect-call-2 (result i32) + (block + (drop + (i64.const 1234) + ) + (drop + (i32.const 1) + ) + ) + (i32.const 0) + ) +) diff --git a/test/passes/stub-unsupported-js.wast b/test/passes/stub-unsupported-js.wast index 6cfc7bef2..b68aef64f 100644 --- a/test/passes/stub-unsupported-js.wast +++ b/test/passes/stub-unsupported-js.wast @@ -12,3 +12,24 @@ (f32.convert_i32_u (unreachable)) ) ) +(module + (type $none_=>_none (func)) + (type $i64_=>_i32 (func (param $foo i64) (result i32))) + (table $0 2 2 funcref) + (elem (i32.const 1) $return-f32) + (func $return-f32 (result f32) + (f32.const 3.14159) + ) + (func $bad-indirect-call + (call_indirect (type $none_=>_none) ;; note how it's the wrong type + (i32.const 1) + ) + ) + (func $bad-indirect-call-2 (result i32) + (call_indirect (type $i64_=>_i32) ;; note how it's the wrong type + (i64.const 1234) + (i32.const 1) + ) + ) +) + |