summaryrefslogtreecommitdiff
path: root/test/lit/passes
diff options
context:
space:
mode:
authorAshley Nelson <nashley@google.com>2023-11-20 21:55:47 -0800
committerGitHub <noreply@github.com>2023-11-21 05:55:47 +0000
commita1e8bdc1d162f1f72e545960e552cf13b6c82be5 (patch)
treee3d9cc62da6b542fe546185a08702d5e88746238 /test/lit/passes
parent67f2fdc8769ca80ec1753730c11648e331dcd8ca (diff)
downloadbinaryen-a1e8bdc1d162f1f72e545960e552cf13b6c82be5.tar.gz
binaryen-a1e8bdc1d162f1f72e545960e552cf13b6c82be5.tar.bz2
binaryen-a1e8bdc1d162f1f72e545960e552cf13b6c82be5.zip
[IRBuilder] Add visitCallIndirect and makeCallIndirect (#6127)
Adds support for call_indirect to wasm-ir-builder. Tests this works by outlining a sequence including call_indirect.
Diffstat (limited to 'test/lit/passes')
-rw-r--r--test/lit/passes/outlining.wast37
1 files changed, 37 insertions, 0 deletions
diff --git a/test/lit/passes/outlining.wast b/test/lit/passes/outlining.wast
index 5ffc7f671..ad712b31a 100644
--- a/test/lit/passes/outlining.wast
+++ b/test/lit/passes/outlining.wast
@@ -505,3 +505,40 @@
)
)
)
+
+;; Test outlining works with call_indirect
+(module
+ (table funcref)
+ (func
+ (call_indirect
+ (param i32 i32)
+ (i32.const 0)
+ (i32.const 1)
+ (i32.const 2)
+ )
+ (call_indirect
+ (param i32 i32)
+ (i32.const 0)
+ (i32.const 1)
+ (i32.const 2)
+ )
+ )
+)
+;; CHECK: (type $0 (func))
+
+;; CHECK: (type $1 (func (param i32 i32)))
+
+;; CHECK: (table $0 0 funcref)
+
+;; CHECK: (func $outline$ (type $0)
+;; CHECK-NEXT: (call_indirect $0 (type $1)
+;; CHECK-NEXT: (i32.const 0)
+;; CHECK-NEXT: (i32.const 1)
+;; CHECK-NEXT: (i32.const 2)
+;; CHECK-NEXT: )
+;; CHECK-NEXT: )
+
+;; CHECK: (func $0 (type $0)
+;; CHECK-NEXT: (call $outline$)
+;; CHECK-NEXT: (call $outline$)
+;; CHECK-NEXT: )