Skip to content

Commit 5504e41

Browse files
github-actions[bot]WebAssembly/testsuite auto-update
andauthored
Auto-update for 2025-03-05 (#120)
Update repos: wasm-3.0: WebAssembly/spec@b72187b This change was automatically generated by `update-testsuite.py` Co-authored-by: WebAssembly/testsuite auto-update <[email protected]>
1 parent cbc54d7 commit 5504e41

File tree

2 files changed

+47
-2
lines changed

2 files changed

+47
-2
lines changed

proposals/wasm-3.0/return_call.wast

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
;; Test `return_call` operator
22

33
(module
4+
(import "spectest" "print_i32_f32" (func $print_i32_f32 (param i32 f32)))
5+
46
;; Auxiliary definitions
57
(func $const-i32 (result i32) (i32.const 0x132))
68
(func $const-i64 (result i64) (i64.const 0x164))
@@ -75,6 +77,20 @@
7577
(else (return_call $even (i64.sub (local.get 0) (i64.const 1))))
7678
)
7779
)
80+
81+
;; Functions with multiple parameters / multiple results
82+
(func (export "tailprint_i32_f32") (param i32 f32)
83+
(return_call $print_i32_f32 (local.get 0) (local.get 1))
84+
)
85+
86+
(func $swizzle (param f64 i64) (result i32 f32)
87+
(i32.wrap_i64 (local.get 1))
88+
(f32.demote_f64 (local.get 0))
89+
)
90+
91+
(func (export "type-f64-i64-to-i32-f32") (param f64 i64) (result i32 f32)
92+
(return_call $swizzle (local.get 0) (local.get 1))
93+
)
7894
)
7995

8096
(assert_return (invoke "type-i32") (i32.const 0x132))
@@ -116,7 +132,8 @@
116132
(assert_return (invoke "odd" (i64.const 77)) (i32.const 44))
117133
(assert_return (invoke "odd" (i64.const 1_000_000)) (i32.const 99))
118134
(assert_return (invoke "odd" (i64.const 999_999)) (i32.const 44))
119-
135+
(assert_return (invoke "tailprint_i32_f32" (i32.const 5) (f32.const 91.0)))
136+
(assert_return (invoke "type-f64-i64-to-i32-f32" (f64.const 4.2) (i64.const 99)) (i32.const 99) (f32.const 4.2))
120137

121138
;; Invalid typing
122139

proposals/wasm-3.0/return_call_indirect.wast

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
;; Test `return_call_indirect` operator
22

33
(module
4+
(import "spectest" "print_i32_f32" (func $print_i32_f32 (param i32 f32)))
5+
46
;; Auxiliary definitions
57
(type $proc (func))
68
(type $out-i32 (func (result i32)))
@@ -40,6 +42,19 @@
4042
(func $over-f32-duplicate (type $over-f32-duplicate) (local.get 0))
4143
(func $over-f64-duplicate (type $over-f64-duplicate) (local.get 0))
4244

45+
(func $tailprint_i32_f32 (export "tailprint_i32_f32") (param i32 f32)
46+
(return_call $print_i32_f32 (local.get 0) (local.get 1))
47+
)
48+
49+
(func $swizzle (param f64 i64) (result i32 f32)
50+
(i32.wrap_i64 (local.get 1))
51+
(f32.demote_f64 (local.get 0))
52+
)
53+
54+
(func $type-f64-i64-to-i32-f32 (export "type-f64-i64-to-i32-f32") (param f64 i64) (result i32 f32)
55+
(return_call $swizzle (local.get 0) (local.get 1))
56+
)
57+
4358
(table funcref
4459
(elem
4560
$const-i32 $const-i64 $const-f32 $const-f64
@@ -208,6 +223,17 @@
208223
)
209224
)
210225
)
226+
227+
;; Multiple parameters / multiple results
228+
(table $tab4 funcref (elem $tailprint_i32_f32 $type-f64-i64-to-i32-f32))
229+
230+
(func (export "call_tailprint") (param i32 f32)
231+
(return_call_indirect $tab4 (param i32 f32) (local.get 0) (local.get 1) (i32.const 0))
232+
)
233+
234+
(func (export "call_mpmr") (param f64 i64) (result i32 f32)
235+
(return_call_indirect $tab4 (param f64 i64) (result i32 f32) (local.get 0) (local.get 1) (i32.const 1))
236+
)
211237
)
212238

213239
(assert_return (invoke "type-i32") (i32.const 0x132))
@@ -233,7 +259,7 @@
233259
(assert_return (invoke "dispatch" (i32.const 17) (i64.const 2)) (i64.const 2))
234260
(assert_trap (invoke "dispatch" (i32.const 0) (i64.const 2)) "indirect call type mismatch")
235261
(assert_trap (invoke "dispatch" (i32.const 15) (i64.const 2)) "indirect call type mismatch")
236-
(assert_trap (invoke "dispatch" (i32.const 20) (i64.const 2)) "undefined element")
262+
(assert_trap (invoke "dispatch" (i32.const 22) (i64.const 2)) "undefined element")
237263
(assert_trap (invoke "dispatch" (i32.const -1) (i64.const 2)) "undefined element")
238264
(assert_trap (invoke "dispatch" (i32.const 1213432423) (i64.const 2)) "undefined element")
239265

@@ -266,6 +292,8 @@
266292
(assert_return (invoke "odd" (i32.const 200_002)) (i32.const 99))
267293
(assert_return (invoke "odd" (i32.const 300_003)) (i32.const 44))
268294

295+
(assert_return (invoke "call_tailprint" (i32.const 5) (f32.const 91.0)))
296+
(assert_return (invoke "call_mpmr" (f64.const 4.2) (i64.const 99)) (i32.const 99) (f32.const 4.2))
269297

270298
;; Invalid syntax
271299

0 commit comments

Comments
 (0)