forked from WebAssembly/binaryen
-
Notifications
You must be signed in to change notification settings - Fork 0
/
get-set-local.wast
27 lines (24 loc) · 1.05 KB
/
get-set-local.wast
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
;; Tests for lowering local.get and local.set.
(module
(func $dummy)
(func (export "check_extend_ui32") (param $0 i32) (param $r i64) (result i32)
(local $x i32)
(local $result i64)
(local $extend i64)
(local.set $x (local.get $0))
(local.set $result (local.get $r))
(local.set $extend (i64.extend_i32_u (local.get $x)))
(i64.eq (local.get $extend) (local.get $result)))
)
(assert_return (invoke "check_extend_ui32" (i32.const 0)
(i32.const 0) (i32.const 0))
(i32.const 1))
(assert_return (invoke "check_extend_ui32" (i32.const 1)
(i32.const 1) (i32.const 0))
(i32.const 1))
(assert_return (invoke "check_extend_ui32" (i32.const 0x7fffffff)
(i32.const 0x7fffffff) (i32.const 0))
(i32.const 1))
(assert_return (invoke "check_extend_ui32" (i32.const 0xffffffff)
(i32.const 0xffffffff) (i32.const 0))
(i32.const 1))