summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/passes/stub-unsupported-js.txt24
-rw-r--r--test/passes/stub-unsupported-js.wast14
2 files changed, 38 insertions, 0 deletions
diff --git a/test/passes/stub-unsupported-js.txt b/test/passes/stub-unsupported-js.txt
new file mode 100644
index 000000000..531c767c0
--- /dev/null
+++ b/test/passes/stub-unsupported-js.txt
@@ -0,0 +1,24 @@
+(module
+ (type $none_=>_f32 (func (result f32)))
+ (type $i32_=>_f32 (func (param i32) (result f32)))
+ (type $i64_=>_f32 (func (param i64) (result f32)))
+ (func $yes (param $x i64) (result f32)
+ (drop
+ (local.get $x)
+ )
+ (f32.const 0)
+ )
+ (func $no (param $x i32) (result f32)
+ (f32.convert_i32_u
+ (local.get $x)
+ )
+ )
+ (func $yes-unreach (result f32)
+ (unreachable)
+ )
+ (func $no-unreach (result f32)
+ (f32.convert_i32_u
+ (unreachable)
+ )
+ )
+)
diff --git a/test/passes/stub-unsupported-js.wast b/test/passes/stub-unsupported-js.wast
new file mode 100644
index 000000000..6cfc7bef2
--- /dev/null
+++ b/test/passes/stub-unsupported-js.wast
@@ -0,0 +1,14 @@
+(module
+ (func $yes (param $x i64) (result f32)
+ (f32.convert_i64_u (local.get $x))
+ )
+ (func $no (param $x i32) (result f32)
+ (f32.convert_i32_u (local.get $x))
+ )
+ (func $yes-unreach (result f32)
+ (f32.convert_i64_u (unreachable))
+ )
+ (func $no-unreach (result f32)
+ (f32.convert_i32_u (unreachable))
+ )
+)