summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAlon Zakai <azakai@google.com>2021-04-14 13:45:28 -0700
committerGitHub <noreply@github.com>2021-04-14 13:45:28 -0700
commitd4f8cd5ccabaaf2c55561548d88c075cfa4f765d (patch)
treefc21ffabfaa184ade6431e97668903dceef03130 /test
parentd321458d57e6977ceaba90099e80b80cf6d472ed (diff)
downloadbinaryen-d4f8cd5ccabaaf2c55561548d88c075cfa4f765d.tar.gz
binaryen-d4f8cd5ccabaaf2c55561548d88c075cfa4f765d.tar.bz2
binaryen-d4f8cd5ccabaaf2c55561548d88c075cfa4f765d.zip
[Wasm GC] Do not inline a function with an RTT parameter (#3808)
Inlined parameters become locals, and rtts cannot be handled as locals, unlike non-nullable values which we can at least fix up. So do not inline functions with rtt params.
Diffstat (limited to 'test')
-rw-r--r--test/passes/inlining_all-features.txt13
-rw-r--r--test/passes/inlining_all-features.wast11
2 files changed, 24 insertions, 0 deletions
diff --git a/test/passes/inlining_all-features.txt b/test/passes/inlining_all-features.txt
index 8ecf9fa8e..3f9aa57ce 100644
--- a/test/passes/inlining_all-features.txt
+++ b/test/passes/inlining_all-features.txt
@@ -125,3 +125,16 @@
)
)
)
+(module
+ (type $struct (struct ))
+ (type $none_=>_none (func))
+ (type $rtt_$struct_=>_none (func (param (rtt $struct))))
+ (func $0 (param $rtt (rtt $struct))
+ (nop)
+ )
+ (func $1
+ (call $0
+ (rtt.canon $struct)
+ )
+ )
+)
diff --git a/test/passes/inlining_all-features.wast b/test/passes/inlining_all-features.wast
index d11353aa4..0aa324e1a 100644
--- a/test/passes/inlining_all-features.wast
+++ b/test/passes/inlining_all-features.wast
@@ -101,3 +101,14 @@
)
)
)
+;; never inline an rtt parameter, as those cannot be handled as locals
+(module
+ (type $struct (struct))
+ (func $0 (param $rtt (rtt $struct))
+ )
+ (func $1
+ (call $0
+ (rtt.canon $struct)
+ )
+ )
+)