summaryrefslogtreecommitdiff
path: root/test/passes/legalize-js-interface_all-features.wast
diff options
context:
space:
mode:
Diffstat (limited to 'test/passes/legalize-js-interface_all-features.wast')
-rw-r--r--test/passes/legalize-js-interface_all-features.wast31
1 files changed, 31 insertions, 0 deletions
diff --git a/test/passes/legalize-js-interface_all-features.wast b/test/passes/legalize-js-interface_all-features.wast
new file mode 100644
index 000000000..4697a8f18
--- /dev/null
+++ b/test/passes/legalize-js-interface_all-features.wast
@@ -0,0 +1,31 @@
+(module
+ (import "env" "imported" (func $imported (result i64)))
+ (import "env" "other" (func $other (param i32) (param i64) (param i64)))
+ (import "env" "ref-func-arg" (func $ref-func-arg (result i64)))
+ (export "func" (func $func))
+ (export "ref-func-test" (func $ref-func-test))
+ (export "imported" (func $imported))
+ (export "imported_again" (func $imported))
+ (export "other" (func $other))
+ (func $func (result i64)
+ (drop (call $imported))
+ (call $other
+ (i32.const 0)
+ (i64.const 0)
+ (i64.const 0)
+ )
+ (unreachable)
+ )
+
+ ;; If an import is used in ref.func, even if it is legalized to another
+ ;; import, the original import should not be removed.
+ (func $ref-func-test
+ (drop
+ (call $ref-func-arg)
+ )
+ (drop
+ (ref.func $ref-func-arg)
+ )
+ )
+)
+(module)