Reorganize tests (#523)
* Refactor Lightbeam's tests. This refactors Lightbeam's tests.rs file into several pieces, separating quickcheck tests into their own file, and moving tests which can be run as wast tests into `tests/misc_testsuite`, and creating a tests directory for the rest. * Remove the old filetests tests. These are all covered by misc_testsuite and spec_testsuite tests. * rustfmt * Remove the "bench" feature.
This commit is contained in:
committed by
Alex Crichton
parent
0f4f9d7832
commit
e691bf36f3
@@ -1,13 +0,0 @@
|
||||
(module
|
||||
(memory 1)
|
||||
(func $main (local i32)
|
||||
(set_local 0 (i32.sub (i32.const 4) (i32.const 4)))
|
||||
(if
|
||||
(get_local 0)
|
||||
(then unreachable)
|
||||
(else (drop (i32.mul (i32.const 6) (get_local 0))))
|
||||
)
|
||||
)
|
||||
(start $main)
|
||||
(data (i32.const 0) "abcdefgh")
|
||||
)
|
||||
@@ -1,10 +0,0 @@
|
||||
(module
|
||||
(func $main (local i32)
|
||||
(set_local 0 (i32.const 0))
|
||||
(drop (call $inc))
|
||||
)
|
||||
(func $inc (result i32)
|
||||
(i32.const 1)
|
||||
)
|
||||
(start $main)
|
||||
)
|
||||
@@ -1,50 +0,0 @@
|
||||
(module
|
||||
(type $indirect_sig (func (param i64) (result i64)))
|
||||
|
||||
(func $assert (param i32)
|
||||
(block $ok
|
||||
(br_if $ok
|
||||
(get_local 0)
|
||||
)
|
||||
(unreachable)
|
||||
)
|
||||
)
|
||||
|
||||
(func $plus_1 (param i64) (result i64)
|
||||
get_local 0
|
||||
i64.const 1
|
||||
i64.add
|
||||
)
|
||||
(func $minus_1 (param i64) (result i64)
|
||||
get_local 0
|
||||
i64.const 1
|
||||
i64.sub
|
||||
)
|
||||
|
||||
(func $main
|
||||
(call $call_indirect
|
||||
(i32.const 0)
|
||||
(i64.const 2)
|
||||
)
|
||||
(call $call_indirect
|
||||
(i32.const 1)
|
||||
(i64.const 0)
|
||||
)
|
||||
)
|
||||
|
||||
(func $call_indirect (param $func i32) (param $expected i64)
|
||||
(call $assert
|
||||
(i64.eq
|
||||
(call_indirect (type $indirect_sig)
|
||||
(i64.const 1)
|
||||
(get_local $func)
|
||||
)
|
||||
(get_local $expected)
|
||||
)
|
||||
)
|
||||
)
|
||||
(start $main)
|
||||
|
||||
(table 2 2 anyfunc)
|
||||
(elem (i32.const 0) $plus_1 $minus_1)
|
||||
)
|
||||
@@ -1,22 +0,0 @@
|
||||
(module
|
||||
(memory 1)
|
||||
(func $main (local i32 i32 i32 i32)
|
||||
(set_local 0 (i32.const 0))
|
||||
(set_local 1 (i32.const 1))
|
||||
(set_local 2 (i32.const 1))
|
||||
(set_local 3 (i32.const 0))
|
||||
(block
|
||||
(loop
|
||||
(br_if 1 (i32.gt_s (get_local 0) (i32.const 5)))
|
||||
(set_local 3 (get_local 2))
|
||||
(set_local 2 (i32.add (get_local 2) (get_local 1)))
|
||||
(set_local 1 (get_local 3))
|
||||
(set_local 0 (i32.add (get_local 0) (i32.const 1)))
|
||||
(br 0)
|
||||
)
|
||||
)
|
||||
(i32.store (i32.const 0) (get_local 2))
|
||||
)
|
||||
(start $main)
|
||||
(data (i32.const 0) "0000")
|
||||
)
|
||||
@@ -1,8 +0,0 @@
|
||||
(module
|
||||
(global $x (mut i32) (i32.const 4))
|
||||
(memory 1)
|
||||
(func $main (local i32)
|
||||
(i32.store (i32.const 0) (get_global $x))
|
||||
)
|
||||
(start $main)
|
||||
)
|
||||
@@ -1,28 +0,0 @@
|
||||
(module
|
||||
(memory 1)
|
||||
(func $assert (param i32)
|
||||
(block $ok
|
||||
(br_if $ok
|
||||
(get_local 0)
|
||||
)
|
||||
(unreachable)
|
||||
)
|
||||
)
|
||||
(func $main (local i32)
|
||||
(call $assert
|
||||
(i32.eq
|
||||
(memory.grow (i32.const 1))
|
||||
(i32.const 1)
|
||||
)
|
||||
)
|
||||
(call $assert
|
||||
(i32.eq
|
||||
(memory.size)
|
||||
(i32.const 2)
|
||||
)
|
||||
)
|
||||
)
|
||||
(start $main)
|
||||
(data (i32.const 0) "\04\03\02\01")
|
||||
)
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
(module
|
||||
(memory 1)
|
||||
(func $main (local i32)
|
||||
(i32.store (i32.const 0) (i32.const 0x0))
|
||||
(if (i32.load (i32.const 0))
|
||||
(then (i32.store (i32.const 0) (i32.const 0xa)))
|
||||
(else (i32.store (i32.const 0) (i32.const 0xb))))
|
||||
)
|
||||
(start $main)
|
||||
(data (i32.const 0) "0000")
|
||||
)
|
||||
Reference in New Issue
Block a user