add whole test files from Core Test Suit

This commit is contained in:
Ilya Rezvov
2018-03-20 21:01:25 -07:00
parent d9849f77bf
commit 4ed8752744
72 changed files with 36481 additions and 59 deletions
+20
View File
@@ -0,0 +1,20 @@
(module
(func $even (export "even") (param $n i32) (result i32)
(if (result i32) (i32.eq (get_local $n) (i32.const 0))
(then (i32.const 1))
(else (call $odd (i32.sub (get_local $n) (i32.const 1))))
)
)
(func $odd (export "odd") (param $n i32) (result i32)
(if (result i32) (i32.eq (get_local $n) (i32.const 0))
(then (i32.const 0))
(else (call $even (i32.sub (get_local $n) (i32.const 1))))
)
)
)
(assert_return (invoke "even" (i32.const 13)) (i32.const 0))
(assert_return (invoke "even" (i32.const 20)) (i32.const 1))
(assert_return (invoke "odd" (i32.const 13)) (i32.const 1))
(assert_return (invoke "odd" (i32.const 20)) (i32.const 0))