diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/bad_params.asm.js | 30 | ||||
-rw-r--r-- | test/bad_params.fromasm | 9 | ||||
-rw-r--r-- | test/bad_params.fromasm.clamp | 9 | ||||
-rw-r--r-- | test/bad_params.fromasm.clamp.no-opts | 43 | ||||
-rw-r--r-- | test/bad_params.fromasm.imprecise | 6 | ||||
-rw-r--r-- | test/bad_params.fromasm.imprecise.no-opts | 43 | ||||
-rw-r--r-- | test/bad_params.fromasm.no-opts | 43 |
7 files changed, 183 insertions, 0 deletions
diff --git a/test/bad_params.asm.js b/test/bad_params.asm.js new file mode 100644 index 000000000..cc5e7ccf8 --- /dev/null +++ b/test/bad_params.asm.js @@ -0,0 +1,30 @@ +function asm(global, env, buffer) { + "use asm"; + + function missing(x, y) { + x = x | 0; + y = +y; + } + + function extra(x, y) { + x = x | 0; + y = +y; + } + + function mix(a) { + a = a | 0; + } + + function ex() { + missing(); + missing(1); + extra(1, +2, 3); + extra(1, +2, 3, 4); + mix(); + mix(1); + mix(1, 2); + } + + return { ex: ex }; +} + diff --git a/test/bad_params.fromasm b/test/bad_params.fromasm new file mode 100644 index 000000000..52f804340 --- /dev/null +++ b/test/bad_params.fromasm @@ -0,0 +1,9 @@ +(module + (import "env" "memory" (memory $0 256 256)) + (import "env" "memoryBase" (global $memoryBase i32)) + (data (get_global $memoryBase) "bad_params.asm.js") + (export "ex" (func $ex)) + (func $ex (; 0 ;) + (nop) + ) +) diff --git a/test/bad_params.fromasm.clamp b/test/bad_params.fromasm.clamp new file mode 100644 index 000000000..52f804340 --- /dev/null +++ b/test/bad_params.fromasm.clamp @@ -0,0 +1,9 @@ +(module + (import "env" "memory" (memory $0 256 256)) + (import "env" "memoryBase" (global $memoryBase i32)) + (data (get_global $memoryBase) "bad_params.asm.js") + (export "ex" (func $ex)) + (func $ex (; 0 ;) + (nop) + ) +) diff --git a/test/bad_params.fromasm.clamp.no-opts b/test/bad_params.fromasm.clamp.no-opts new file mode 100644 index 000000000..07440e82d --- /dev/null +++ b/test/bad_params.fromasm.clamp.no-opts @@ -0,0 +1,43 @@ +(module + (import "env" "memory" (memory $0 256 256)) + (import "env" "table" (table 0 0 anyfunc)) + (import "env" "memoryBase" (global $memoryBase i32)) + (import "env" "tableBase" (global $tableBase i32)) + (export "ex" (func $ex)) + (func $missing (; 0 ;) (param $x i32) (param $y f64) + (nop) + ) + (func $extra (; 1 ;) (param $x i32) (param $y f64) + (nop) + ) + (func $mix (; 2 ;) (param $a i32) + (nop) + ) + (func $ex (; 3 ;) + (call $missing + (i32.const 0) + (f64.const 0) + ) + (call $missing + (i32.const 1) + (f64.const 0) + ) + (call $extra + (i32.const 1) + (f64.const 2) + ) + (call $extra + (i32.const 1) + (f64.const 2) + ) + (call $mix + (i32.const 0) + ) + (call $mix + (i32.const 1) + ) + (call $mix + (i32.const 1) + ) + ) +) diff --git a/test/bad_params.fromasm.imprecise b/test/bad_params.fromasm.imprecise new file mode 100644 index 000000000..ae5256c57 --- /dev/null +++ b/test/bad_params.fromasm.imprecise @@ -0,0 +1,6 @@ +(module + (export "ex" (func $ex)) + (func $ex (; 0 ;) + (nop) + ) +) diff --git a/test/bad_params.fromasm.imprecise.no-opts b/test/bad_params.fromasm.imprecise.no-opts new file mode 100644 index 000000000..07440e82d --- /dev/null +++ b/test/bad_params.fromasm.imprecise.no-opts @@ -0,0 +1,43 @@ +(module + (import "env" "memory" (memory $0 256 256)) + (import "env" "table" (table 0 0 anyfunc)) + (import "env" "memoryBase" (global $memoryBase i32)) + (import "env" "tableBase" (global $tableBase i32)) + (export "ex" (func $ex)) + (func $missing (; 0 ;) (param $x i32) (param $y f64) + (nop) + ) + (func $extra (; 1 ;) (param $x i32) (param $y f64) + (nop) + ) + (func $mix (; 2 ;) (param $a i32) + (nop) + ) + (func $ex (; 3 ;) + (call $missing + (i32.const 0) + (f64.const 0) + ) + (call $missing + (i32.const 1) + (f64.const 0) + ) + (call $extra + (i32.const 1) + (f64.const 2) + ) + (call $extra + (i32.const 1) + (f64.const 2) + ) + (call $mix + (i32.const 0) + ) + (call $mix + (i32.const 1) + ) + (call $mix + (i32.const 1) + ) + ) +) diff --git a/test/bad_params.fromasm.no-opts b/test/bad_params.fromasm.no-opts new file mode 100644 index 000000000..07440e82d --- /dev/null +++ b/test/bad_params.fromasm.no-opts @@ -0,0 +1,43 @@ +(module + (import "env" "memory" (memory $0 256 256)) + (import "env" "table" (table 0 0 anyfunc)) + (import "env" "memoryBase" (global $memoryBase i32)) + (import "env" "tableBase" (global $tableBase i32)) + (export "ex" (func $ex)) + (func $missing (; 0 ;) (param $x i32) (param $y f64) + (nop) + ) + (func $extra (; 1 ;) (param $x i32) (param $y f64) + (nop) + ) + (func $mix (; 2 ;) (param $a i32) + (nop) + ) + (func $ex (; 3 ;) + (call $missing + (i32.const 0) + (f64.const 0) + ) + (call $missing + (i32.const 1) + (f64.const 0) + ) + (call $extra + (i32.const 1) + (f64.const 2) + ) + (call $extra + (i32.const 1) + (f64.const 2) + ) + (call $mix + (i32.const 0) + ) + (call $mix + (i32.const 1) + ) + (call $mix + (i32.const 1) + ) + ) +) |