wasmer/examples/single_pass_tests/global.wat

27 lines
715 B
Plaintext
Raw Normal View History

2019-03-08 18:58:10 +00:00
(module
(global $g1 (mut i32) (i32.const 0))
(global $g2 (mut i32) (i32.const 99))
(func $main (export "main")
(if (i32.eq (get_global $g1) (i32.const 0))
(then)
(else unreachable)
)
(if (i32.eq (get_global $g2) (i32.const 99))
(then)
(else unreachable)
)
(set_global $g1 (i32.add (get_global $g1) (i32.const 1)))
(set_global $g2 (i32.sub (get_global $g2) (i32.const 1)))
(if (i32.eq (get_global $g1) (i32.const 1))
(then)
(else unreachable)
)
(if (i32.eq (get_global $g2) (i32.const 98))
(then)
(else unreachable)
)
)
)