summaryrefslogtreecommitdiff
path: root/test/lit/passes/optimize-instructions-call_ref.wast
diff options
context:
space:
mode:
Diffstat (limited to 'test/lit/passes/optimize-instructions-call_ref.wast')
-rw-r--r--test/lit/passes/optimize-instructions-call_ref.wast33
1 files changed, 28 insertions, 5 deletions
diff --git a/test/lit/passes/optimize-instructions-call_ref.wast b/test/lit/passes/optimize-instructions-call_ref.wast
index 320237d1e..553f8d07b 100644
--- a/test/lit/passes/optimize-instructions-call_ref.wast
+++ b/test/lit/passes/optimize-instructions-call_ref.wast
@@ -5,21 +5,27 @@
;; remove-unused-names is to allow fallthrough computations to work on blocks
(module
- ;; CHECK: (type $none_=>_i32 (func (result i32)))
- (type $none_=>_i32 (func (result i32)))
-
;; CHECK: (type $i32_i32_=>_none (func (param i32 i32)))
(type $i32_i32_=>_none (func (param i32 i32)))
+ ;; CHECK: (type $none_=>_i32 (func (result i32)))
+ (type $none_=>_i32 (func (result i32)))
+
;; CHECK: (type $none_=>_none (func))
(type $none_=>_none (func))
+ ;; CHECK: (type $i32_=>_none (func (param i32)))
+
;; CHECK: (type $data_=>_none (func (param dataref)))
(type $data_=>_none (func (param (ref data))))
- ;; CHECK: (type $i32_=>_none (func (param i32)))
+ ;; CHECK: (table $table-1 10 (ref null $i32_i32_=>_none))
+ (table $table-1 10 (ref null $i32_i32_=>_none))
+ ;; CHECK: (elem $elem-1 (table $table-1) (i32.const 0) (ref null $i32_i32_=>_none) (ref.func $foo))
+ (elem $elem-1 (table $table-1) (i32.const 0) (ref null $i32_i32_=>_none)
+ (ref.func $foo))
- ;; CHECK: (elem declare func $fallthrough-no-params $fallthrough-non-nullable $foo $return-nothing)
+ ;; CHECK: (elem declare func $fallthrough-no-params $fallthrough-non-nullable $return-nothing)
;; CHECK: (func $foo (param $0 i32) (param $1 i32)
;; CHECK-NEXT: (unreachable)
@@ -206,4 +212,21 @@
(unreachable)
)
)
+
+ ;; CHECK: (func $call-table-get (param $x i32)
+ ;; CHECK-NEXT: (call_indirect $table-1 (type $i32_i32_=>_none)
+ ;; CHECK-NEXT: (i32.const 1)
+ ;; CHECK-NEXT: (i32.const 2)
+ ;; CHECK-NEXT: (local.get $x)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ (func $call-table-get (param $x i32)
+ (call_ref
+ (i32.const 1)
+ (i32.const 2)
+ (table.get $table-1
+ (local.get $x)
+ )
+ )
+ )
)