mirror of
https://github.com/fluencelabs/wasmer
synced 2024-12-15 07:05:41 +00:00
1373 lines
48 KiB
Rust
1373 lines
48 KiB
Rust
// Rust test file autogenerated with cargo build (build/spectests.rs).
|
|
// Please do NOT modify it by hand, as it will be reset on next build.
|
|
// Test based on spectests/loop_.wast
|
|
#![allow(
|
|
warnings,
|
|
dead_code
|
|
)]
|
|
use wabt::wat2wasm;
|
|
use std::{f32, f64};
|
|
|
|
use wasmer_runtime::types::Value;
|
|
use wasmer_runtime::{Instance, module::Module};
|
|
use wasmer_clif_backend::CraneliftCompiler;
|
|
|
|
use crate::spectests::_common::{
|
|
spectest_importobject,
|
|
NaNCheck,
|
|
};
|
|
|
|
|
|
// Line 3
|
|
fn create_module_1() -> Box<Instance> {
|
|
let module_str = "(module
|
|
(type (;0;) (func (param i32 i32) (result i32)))
|
|
(type (;1;) (func))
|
|
(type (;2;) (func (result i32)))
|
|
(type (;3;) (func (param i32) (result i32)))
|
|
(type (;4;) (func (param i64) (result i64)))
|
|
(type (;5;) (func (param f32 f32) (result f32)))
|
|
(func (;0;) (type 1))
|
|
(func (;1;) (type 1)
|
|
loop ;; label = @1
|
|
end
|
|
loop ;; label = @1
|
|
end)
|
|
(func (;2;) (type 2) (result i32)
|
|
loop ;; label = @1
|
|
nop
|
|
end
|
|
loop (result i32) ;; label = @1
|
|
i32.const 7
|
|
end)
|
|
(func (;3;) (type 2) (result i32)
|
|
loop ;; label = @1
|
|
call 0
|
|
call 0
|
|
call 0
|
|
call 0
|
|
end
|
|
loop (result i32) ;; label = @1
|
|
call 0
|
|
call 0
|
|
call 0
|
|
i32.const 8
|
|
end)
|
|
(func (;4;) (type 2) (result i32)
|
|
loop (result i32) ;; label = @1
|
|
loop ;; label = @2
|
|
call 0
|
|
block ;; label = @3
|
|
end
|
|
nop
|
|
end
|
|
loop (result i32) ;; label = @2
|
|
call 0
|
|
i32.const 9
|
|
end
|
|
end)
|
|
(func (;5;) (type 2) (result i32)
|
|
loop (result i32) ;; label = @1
|
|
block (result i32) ;; label = @2
|
|
loop (result i32) ;; label = @3
|
|
block (result i32) ;; label = @4
|
|
loop (result i32) ;; label = @5
|
|
block (result i32) ;; label = @6
|
|
loop (result i32) ;; label = @7
|
|
block (result i32) ;; label = @8
|
|
loop (result i32) ;; label = @9
|
|
block (result i32) ;; label = @10
|
|
loop (result i32) ;; label = @11
|
|
block (result i32) ;; label = @12
|
|
loop (result i32) ;; label = @13
|
|
block (result i32) ;; label = @14
|
|
loop (result i32) ;; label = @15
|
|
block (result i32) ;; label = @16
|
|
loop (result i32) ;; label = @17
|
|
block (result i32) ;; label = @18
|
|
loop (result i32) ;; label = @19
|
|
block (result i32) ;; label = @20
|
|
loop (result i32) ;; label = @21
|
|
block (result i32) ;; label = @22
|
|
loop (result i32) ;; label = @23
|
|
block (result i32) ;; label = @24
|
|
loop (result i32) ;; label = @25
|
|
block (result i32) ;; label = @26
|
|
loop (result i32) ;; label = @27
|
|
block (result i32) ;; label = @28
|
|
loop (result i32) ;; label = @29
|
|
block (result i32) ;; label = @30
|
|
loop (result i32) ;; label = @31
|
|
block (result i32) ;; label = @32
|
|
loop (result i32) ;; label = @33
|
|
block (result i32) ;; label = @34
|
|
loop (result i32) ;; label = @35
|
|
block (result i32) ;; label = @36
|
|
loop (result i32) ;; label = @37
|
|
block (result i32) ;; label = @38
|
|
loop (result i32) ;; label = @39
|
|
block (result i32) ;; label = @40
|
|
call 0
|
|
i32.const 150
|
|
end
|
|
end
|
|
end
|
|
end
|
|
end
|
|
end
|
|
end
|
|
end
|
|
end
|
|
end
|
|
end
|
|
end
|
|
end
|
|
end
|
|
end
|
|
end
|
|
end
|
|
end
|
|
end
|
|
end
|
|
end
|
|
end
|
|
end
|
|
end
|
|
end
|
|
end
|
|
end
|
|
end
|
|
end
|
|
end
|
|
end
|
|
end
|
|
end
|
|
end
|
|
end
|
|
end
|
|
end
|
|
end
|
|
end
|
|
end)
|
|
(func (;6;) (type 2) (result i32)
|
|
loop (result i32) ;; label = @1
|
|
i32.const 1
|
|
end
|
|
i32.const 2
|
|
i32.const 3
|
|
select)
|
|
(func (;7;) (type 2) (result i32)
|
|
i32.const 2
|
|
loop (result i32) ;; label = @1
|
|
i32.const 1
|
|
end
|
|
i32.const 3
|
|
select)
|
|
(func (;8;) (type 2) (result i32)
|
|
i32.const 2
|
|
i32.const 3
|
|
loop (result i32) ;; label = @1
|
|
i32.const 1
|
|
end
|
|
select)
|
|
(func (;9;) (type 1)
|
|
loop (result i32) ;; label = @1
|
|
i32.const 1
|
|
end
|
|
if ;; label = @1
|
|
call 0
|
|
end)
|
|
(func (;10;) (type 2) (result i32)
|
|
i32.const 1
|
|
if (result i32) ;; label = @1
|
|
loop (result i32) ;; label = @2
|
|
i32.const 1
|
|
end
|
|
else
|
|
i32.const 2
|
|
end)
|
|
(func (;11;) (type 2) (result i32)
|
|
i32.const 1
|
|
if (result i32) ;; label = @1
|
|
i32.const 2
|
|
else
|
|
loop (result i32) ;; label = @2
|
|
i32.const 1
|
|
end
|
|
end)
|
|
(func (;12;) (type 2) (result i32)
|
|
block (result i32) ;; label = @1
|
|
loop (result i32) ;; label = @2
|
|
i32.const 1
|
|
end
|
|
i32.const 2
|
|
br_if 0 (;@1;)
|
|
end)
|
|
(func (;13;) (type 2) (result i32)
|
|
block (result i32) ;; label = @1
|
|
i32.const 2
|
|
loop (result i32) ;; label = @2
|
|
i32.const 1
|
|
end
|
|
br_if 0 (;@1;)
|
|
end)
|
|
(func (;14;) (type 2) (result i32)
|
|
block (result i32) ;; label = @1
|
|
loop (result i32) ;; label = @2
|
|
i32.const 1
|
|
end
|
|
i32.const 2
|
|
br_table 0 (;@1;) 0 (;@1;)
|
|
end)
|
|
(func (;15;) (type 2) (result i32)
|
|
block (result i32) ;; label = @1
|
|
i32.const 2
|
|
loop (result i32) ;; label = @2
|
|
i32.const 1
|
|
end
|
|
br_table 0 (;@1;) 0 (;@1;)
|
|
end)
|
|
(func (;16;) (type 0) (param i32 i32) (result i32)
|
|
get_local 0)
|
|
(func (;17;) (type 2) (result i32)
|
|
block (result i32) ;; label = @1
|
|
loop (result i32) ;; label = @2
|
|
i32.const 1
|
|
end
|
|
i32.const 2
|
|
i32.const 0
|
|
call_indirect (type 0)
|
|
end)
|
|
(func (;18;) (type 2) (result i32)
|
|
block (result i32) ;; label = @1
|
|
i32.const 2
|
|
loop (result i32) ;; label = @2
|
|
i32.const 1
|
|
end
|
|
i32.const 0
|
|
call_indirect (type 0)
|
|
end)
|
|
(func (;19;) (type 2) (result i32)
|
|
block (result i32) ;; label = @1
|
|
i32.const 1
|
|
i32.const 2
|
|
loop (result i32) ;; label = @2
|
|
i32.const 0
|
|
end
|
|
call_indirect (type 0)
|
|
end)
|
|
(func (;20;) (type 1)
|
|
loop (result i32) ;; label = @1
|
|
i32.const 1
|
|
end
|
|
i32.const 1
|
|
i32.store)
|
|
(func (;21;) (type 1)
|
|
i32.const 10
|
|
loop (result i32) ;; label = @1
|
|
i32.const 1
|
|
end
|
|
i32.store)
|
|
(func (;22;) (type 2) (result i32)
|
|
loop (result i32) ;; label = @1
|
|
i32.const 1
|
|
end
|
|
memory.grow)
|
|
(func (;23;) (type 3) (param i32) (result i32)
|
|
get_local 0)
|
|
(func (;24;) (type 2) (result i32)
|
|
loop (result i32) ;; label = @1
|
|
i32.const 1
|
|
end
|
|
call 23)
|
|
(func (;25;) (type 2) (result i32)
|
|
loop (result i32) ;; label = @1
|
|
i32.const 1
|
|
end
|
|
return)
|
|
(func (;26;) (type 1)
|
|
loop (result i32) ;; label = @1
|
|
i32.const 1
|
|
end
|
|
drop)
|
|
(func (;27;) (type 2) (result i32)
|
|
block (result i32) ;; label = @1
|
|
loop (result i32) ;; label = @2
|
|
i32.const 1
|
|
end
|
|
br 0 (;@1;)
|
|
end)
|
|
(func (;28;) (type 2) (result i32)
|
|
(local i32)
|
|
loop (result i32) ;; label = @1
|
|
i32.const 1
|
|
end
|
|
set_local 0
|
|
get_local 0)
|
|
(func (;29;) (type 2) (result i32)
|
|
(local i32)
|
|
loop (result i32) ;; label = @1
|
|
i32.const 1
|
|
end
|
|
tee_local 0)
|
|
(func (;30;) (type 2) (result i32)
|
|
loop (result i32) ;; label = @1
|
|
i32.const 1
|
|
end
|
|
set_global 0
|
|
get_global 0)
|
|
(func (;31;) (type 2) (result i32)
|
|
loop (result i32) ;; label = @1
|
|
i32.const 1
|
|
end
|
|
i32.load)
|
|
(func (;32;) (type 2) (result i32)
|
|
loop (result i32) ;; label = @1
|
|
call 0
|
|
i32.const 13
|
|
end
|
|
i32.ctz)
|
|
(func (;33;) (type 2) (result i32)
|
|
loop (result i32) ;; label = @1
|
|
call 0
|
|
i32.const 3
|
|
end
|
|
loop (result i32) ;; label = @1
|
|
call 0
|
|
i32.const 4
|
|
end
|
|
i32.mul)
|
|
(func (;34;) (type 2) (result i32)
|
|
loop (result i32) ;; label = @1
|
|
call 0
|
|
i32.const 13
|
|
end
|
|
i32.eqz)
|
|
(func (;35;) (type 2) (result i32)
|
|
loop (result f32) ;; label = @1
|
|
call 0
|
|
f32.const 0x1.8p+1 (;=3;)
|
|
end
|
|
loop (result f32) ;; label = @1
|
|
call 0
|
|
f32.const 0x1.8p+1 (;=3;)
|
|
end
|
|
f32.gt)
|
|
(func (;36;) (type 2) (result i32)
|
|
block ;; label = @1
|
|
loop ;; label = @2
|
|
br 1 (;@1;)
|
|
br 0 (;@2;)
|
|
unreachable
|
|
end
|
|
end
|
|
block ;; label = @1
|
|
loop ;; label = @2
|
|
i32.const 1
|
|
br_if 1 (;@1;)
|
|
unreachable
|
|
end
|
|
end
|
|
block ;; label = @1
|
|
loop ;; label = @2
|
|
i32.const 0
|
|
br_table 1 (;@1;)
|
|
unreachable
|
|
end
|
|
end
|
|
block ;; label = @1
|
|
loop ;; label = @2
|
|
i32.const 1
|
|
br_table 1 (;@1;) 1 (;@1;) 1 (;@1;)
|
|
unreachable
|
|
end
|
|
end
|
|
i32.const 19)
|
|
(func (;37;) (type 2) (result i32)
|
|
block (result i32) ;; label = @1
|
|
loop (result i32) ;; label = @2
|
|
i32.const 18
|
|
br 1 (;@1;)
|
|
br 0 (;@2;)
|
|
i32.const 19
|
|
end
|
|
end)
|
|
(func (;38;) (type 2) (result i32)
|
|
block (result i32) ;; label = @1
|
|
loop (result i32) ;; label = @2
|
|
i32.const 18
|
|
br 1 (;@1;)
|
|
i32.const 19
|
|
br 1 (;@1;)
|
|
i32.const 20
|
|
i32.const 0
|
|
br_if 1 (;@1;)
|
|
drop
|
|
i32.const 20
|
|
i32.const 1
|
|
br_if 1 (;@1;)
|
|
drop
|
|
i32.const 21
|
|
br 1 (;@1;)
|
|
i32.const 22
|
|
i32.const 0
|
|
br_table 1 (;@1;)
|
|
i32.const 23
|
|
i32.const 1
|
|
br_table 1 (;@1;) 1 (;@1;) 1 (;@1;)
|
|
i32.const 21
|
|
end
|
|
end)
|
|
(func (;39;) (type 2) (result i32)
|
|
(local i32)
|
|
i32.const 0
|
|
set_local 0
|
|
get_local 0
|
|
block (result i32) ;; label = @1
|
|
loop (result i32) ;; label = @2
|
|
block (result i32) ;; label = @3
|
|
i32.const 1
|
|
br 2 (;@1;)
|
|
end
|
|
end
|
|
end
|
|
i32.add
|
|
set_local 0
|
|
get_local 0
|
|
block (result i32) ;; label = @1
|
|
loop (result i32) ;; label = @2
|
|
loop (result i32) ;; label = @3
|
|
i32.const 2
|
|
br 2 (;@1;)
|
|
end
|
|
end
|
|
end
|
|
i32.add
|
|
set_local 0
|
|
get_local 0
|
|
block (result i32) ;; label = @1
|
|
loop (result i32) ;; label = @2
|
|
block (result i32) ;; label = @3
|
|
loop (result i32) ;; label = @4
|
|
i32.const 4
|
|
br 1 (;@3;)
|
|
end
|
|
end
|
|
end
|
|
end
|
|
i32.add
|
|
set_local 0
|
|
get_local 0
|
|
block (result i32) ;; label = @1
|
|
loop (result i32) ;; label = @2
|
|
i32.const 8
|
|
br 1 (;@1;)
|
|
i32.ctz
|
|
end
|
|
end
|
|
i32.add
|
|
set_local 0
|
|
get_local 0
|
|
block (result i32) ;; label = @1
|
|
loop (result i32) ;; label = @2
|
|
loop (result i32) ;; label = @3
|
|
i32.const 16
|
|
br 2 (;@1;)
|
|
end
|
|
i32.ctz
|
|
end
|
|
end
|
|
i32.add
|
|
set_local 0
|
|
get_local 0)
|
|
(func (;40;) (type 2) (result i32)
|
|
(local i32)
|
|
i32.const 0
|
|
set_local 0
|
|
get_local 0
|
|
loop (result i32) ;; label = @1
|
|
loop (result i32) ;; label = @2
|
|
br 1 (;@1;)
|
|
end
|
|
end
|
|
i32.add
|
|
set_local 0
|
|
get_local 0
|
|
loop (result i32) ;; label = @1
|
|
br 0 (;@1;)
|
|
i32.ctz
|
|
end
|
|
i32.add
|
|
set_local 0
|
|
get_local 0
|
|
loop (result i32) ;; label = @1
|
|
loop (result i32) ;; label = @2
|
|
br 1 (;@1;)
|
|
end
|
|
i32.ctz
|
|
end
|
|
i32.add
|
|
set_local 0
|
|
get_local 0)
|
|
(func (;41;) (type 2) (result i32)
|
|
(local i32)
|
|
block ;; label = @1
|
|
loop ;; label = @2
|
|
i32.const 1
|
|
set_local 0
|
|
get_local 0
|
|
i32.const 3
|
|
i32.mul
|
|
set_local 0
|
|
get_local 0
|
|
i32.const 5
|
|
i32.sub
|
|
set_local 0
|
|
get_local 0
|
|
i32.const 7
|
|
i32.mul
|
|
set_local 0
|
|
br 1 (;@1;)
|
|
get_local 0
|
|
i32.const 100
|
|
i32.mul
|
|
set_local 0
|
|
end
|
|
end
|
|
get_local 0
|
|
i32.const -14
|
|
i32.eq)
|
|
(func (;42;) (type 4) (param i64) (result i64)
|
|
(local i64)
|
|
i64.const 1
|
|
set_local 1
|
|
block ;; label = @1
|
|
loop ;; label = @2
|
|
get_local 0
|
|
i64.eqz
|
|
br_if 1 (;@1;)
|
|
get_local 0
|
|
get_local 1
|
|
i64.mul
|
|
set_local 1
|
|
get_local 0
|
|
i64.const 1
|
|
i64.sub
|
|
set_local 0
|
|
br 0 (;@2;)
|
|
end
|
|
end
|
|
get_local 1)
|
|
(func (;43;) (type 4) (param i64) (result i64)
|
|
(local i64 i64)
|
|
i64.const 1
|
|
set_local 1
|
|
i64.const 2
|
|
set_local 2
|
|
block ;; label = @1
|
|
loop ;; label = @2
|
|
get_local 2
|
|
get_local 0
|
|
i64.gt_u
|
|
br_if 1 (;@1;)
|
|
get_local 1
|
|
get_local 2
|
|
i64.mul
|
|
set_local 1
|
|
get_local 2
|
|
i64.const 1
|
|
i64.add
|
|
set_local 2
|
|
br 0 (;@2;)
|
|
end
|
|
end
|
|
get_local 1)
|
|
(func (;44;) (type 5) (param f32 f32) (result f32)
|
|
(local f32 f32)
|
|
block ;; label = @1
|
|
loop ;; label = @2
|
|
get_local 0
|
|
f32.const 0x0p+0 (;=0;)
|
|
f32.eq
|
|
br_if 1 (;@1;)
|
|
get_local 1
|
|
set_local 2
|
|
block ;; label = @3
|
|
loop ;; label = @4
|
|
get_local 2
|
|
f32.const 0x0p+0 (;=0;)
|
|
f32.eq
|
|
br_if 1 (;@3;)
|
|
get_local 2
|
|
f32.const 0x0p+0 (;=0;)
|
|
f32.lt
|
|
br_if 3 (;@1;)
|
|
get_local 3
|
|
get_local 2
|
|
f32.add
|
|
set_local 3
|
|
get_local 2
|
|
f32.const 0x1p+1 (;=2;)
|
|
f32.sub
|
|
set_local 2
|
|
br 0 (;@4;)
|
|
end
|
|
end
|
|
get_local 3
|
|
get_local 0
|
|
f32.div
|
|
set_local 3
|
|
get_local 0
|
|
f32.const 0x1p+0 (;=1;)
|
|
f32.sub
|
|
set_local 0
|
|
br 0 (;@2;)
|
|
end
|
|
end
|
|
get_local 3)
|
|
(table (;0;) 1 1 anyfunc)
|
|
(memory (;0;) 1)
|
|
(global (;0;) (mut i32) (i32.const 0))
|
|
(export \"empty\" (func 1))
|
|
(export \"singular\" (func 2))
|
|
(export \"multi\" (func 3))
|
|
(export \"nested\" (func 4))
|
|
(export \"deep\" (func 5))
|
|
(export \"as-select-first\" (func 6))
|
|
(export \"as-select-mid\" (func 7))
|
|
(export \"as-select-last\" (func 8))
|
|
(export \"as-if-condition\" (func 9))
|
|
(export \"as-if-then\" (func 10))
|
|
(export \"as-if-else\" (func 11))
|
|
(export \"as-br_if-first\" (func 12))
|
|
(export \"as-br_if-last\" (func 13))
|
|
(export \"as-br_table-first\" (func 14))
|
|
(export \"as-br_table-last\" (func 15))
|
|
(export \"as-call_indirect-first\" (func 17))
|
|
(export \"as-call_indirect-mid\" (func 18))
|
|
(export \"as-call_indirect-last\" (func 19))
|
|
(export \"as-store-first\" (func 20))
|
|
(export \"as-store-last\" (func 21))
|
|
(export \"as-memory.grow-value\" (func 22))
|
|
(export \"as-call-value\" (func 24))
|
|
(export \"as-return-value\" (func 25))
|
|
(export \"as-drop-operand\" (func 26))
|
|
(export \"as-br-value\" (func 27))
|
|
(export \"as-set_local-value\" (func 28))
|
|
(export \"as-tee_local-value\" (func 29))
|
|
(export \"as-set_global-value\" (func 30))
|
|
(export \"as-load-operand\" (func 31))
|
|
(export \"as-unary-operand\" (func 32))
|
|
(export \"as-binary-operand\" (func 33))
|
|
(export \"as-test-operand\" (func 34))
|
|
(export \"as-compare-operand\" (func 35))
|
|
(export \"break-bare\" (func 36))
|
|
(export \"break-value\" (func 37))
|
|
(export \"break-repeated\" (func 38))
|
|
(export \"break-inner\" (func 39))
|
|
(export \"cont-inner\" (func 40))
|
|
(export \"effects\" (func 41))
|
|
(export \"while\" (func 42))
|
|
(export \"for\" (func 43))
|
|
(export \"nesting\" (func 44))
|
|
(elem (;0;) (i32.const 0) 16))
|
|
";
|
|
let wasm_binary = wat2wasm(module_str.as_bytes()).expect("WAST not valid or malformed");
|
|
let module = wasmer_runtime::compile(&wasm_binary[..], &CraneliftCompiler::new()).expect("WASM can't be compiled");
|
|
module.instantiate(&spectest_importobject()).expect("WASM can't be instantiated")
|
|
}
|
|
|
|
fn start_module_1(instance: &mut Instance) {
|
|
// TODO Review is explicit start needed? Start now called in runtime::Instance::new()
|
|
//instance.start();
|
|
}
|
|
|
|
// Line 305
|
|
fn c1_l305_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
|
println!("Executing function {}", "c1_l305_action_invoke");
|
|
let result = instance.call("empty", &[]);
|
|
assert_eq!(result, Ok(None));
|
|
result.map(|_| ())
|
|
}
|
|
|
|
// Line 306
|
|
fn c2_l306_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
|
println!("Executing function {}", "c2_l306_action_invoke");
|
|
let result = instance.call("singular", &[]);
|
|
assert_eq!(result, Ok(Some(Value::I32(7 as i32))));
|
|
result.map(|_| ())
|
|
}
|
|
|
|
// Line 307
|
|
fn c3_l307_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
|
println!("Executing function {}", "c3_l307_action_invoke");
|
|
let result = instance.call("multi", &[]);
|
|
assert_eq!(result, Ok(Some(Value::I32(8 as i32))));
|
|
result.map(|_| ())
|
|
}
|
|
|
|
// Line 308
|
|
fn c4_l308_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
|
println!("Executing function {}", "c4_l308_action_invoke");
|
|
let result = instance.call("nested", &[]);
|
|
assert_eq!(result, Ok(Some(Value::I32(9 as i32))));
|
|
result.map(|_| ())
|
|
}
|
|
|
|
// Line 309
|
|
fn c5_l309_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
|
println!("Executing function {}", "c5_l309_action_invoke");
|
|
let result = instance.call("deep", &[]);
|
|
assert_eq!(result, Ok(Some(Value::I32(150 as i32))));
|
|
result.map(|_| ())
|
|
}
|
|
|
|
// Line 311
|
|
fn c6_l311_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
|
println!("Executing function {}", "c6_l311_action_invoke");
|
|
let result = instance.call("as-select-first", &[]);
|
|
assert_eq!(result, Ok(Some(Value::I32(1 as i32))));
|
|
result.map(|_| ())
|
|
}
|
|
|
|
// Line 312
|
|
fn c7_l312_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
|
println!("Executing function {}", "c7_l312_action_invoke");
|
|
let result = instance.call("as-select-mid", &[]);
|
|
assert_eq!(result, Ok(Some(Value::I32(2 as i32))));
|
|
result.map(|_| ())
|
|
}
|
|
|
|
// Line 313
|
|
fn c8_l313_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
|
println!("Executing function {}", "c8_l313_action_invoke");
|
|
let result = instance.call("as-select-last", &[]);
|
|
assert_eq!(result, Ok(Some(Value::I32(2 as i32))));
|
|
result.map(|_| ())
|
|
}
|
|
|
|
// Line 315
|
|
fn c9_l315_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
|
println!("Executing function {}", "c9_l315_action_invoke");
|
|
let result = instance.call("as-if-condition", &[]);
|
|
assert_eq!(result, Ok(None));
|
|
result.map(|_| ())
|
|
}
|
|
|
|
// Line 316
|
|
fn c10_l316_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
|
println!("Executing function {}", "c10_l316_action_invoke");
|
|
let result = instance.call("as-if-then", &[]);
|
|
assert_eq!(result, Ok(Some(Value::I32(1 as i32))));
|
|
result.map(|_| ())
|
|
}
|
|
|
|
// Line 317
|
|
fn c11_l317_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
|
println!("Executing function {}", "c11_l317_action_invoke");
|
|
let result = instance.call("as-if-else", &[]);
|
|
assert_eq!(result, Ok(Some(Value::I32(2 as i32))));
|
|
result.map(|_| ())
|
|
}
|
|
|
|
// Line 319
|
|
fn c12_l319_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
|
println!("Executing function {}", "c12_l319_action_invoke");
|
|
let result = instance.call("as-br_if-first", &[]);
|
|
assert_eq!(result, Ok(Some(Value::I32(1 as i32))));
|
|
result.map(|_| ())
|
|
}
|
|
|
|
// Line 320
|
|
fn c13_l320_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
|
println!("Executing function {}", "c13_l320_action_invoke");
|
|
let result = instance.call("as-br_if-last", &[]);
|
|
assert_eq!(result, Ok(Some(Value::I32(2 as i32))));
|
|
result.map(|_| ())
|
|
}
|
|
|
|
// Line 322
|
|
fn c14_l322_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
|
println!("Executing function {}", "c14_l322_action_invoke");
|
|
let result = instance.call("as-br_table-first", &[]);
|
|
assert_eq!(result, Ok(Some(Value::I32(1 as i32))));
|
|
result.map(|_| ())
|
|
}
|
|
|
|
// Line 323
|
|
fn c15_l323_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
|
println!("Executing function {}", "c15_l323_action_invoke");
|
|
let result = instance.call("as-br_table-last", &[]);
|
|
assert_eq!(result, Ok(Some(Value::I32(2 as i32))));
|
|
result.map(|_| ())
|
|
}
|
|
|
|
// Line 325
|
|
fn c16_l325_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
|
println!("Executing function {}", "c16_l325_action_invoke");
|
|
let result = instance.call("as-call_indirect-first", &[]);
|
|
assert_eq!(result, Ok(Some(Value::I32(1 as i32))));
|
|
result.map(|_| ())
|
|
}
|
|
|
|
// Line 326
|
|
fn c17_l326_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
|
println!("Executing function {}", "c17_l326_action_invoke");
|
|
let result = instance.call("as-call_indirect-mid", &[]);
|
|
assert_eq!(result, Ok(Some(Value::I32(2 as i32))));
|
|
result.map(|_| ())
|
|
}
|
|
|
|
// Line 327
|
|
fn c18_l327_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
|
println!("Executing function {}", "c18_l327_action_invoke");
|
|
let result = instance.call("as-call_indirect-last", &[]);
|
|
assert_eq!(result, Ok(Some(Value::I32(1 as i32))));
|
|
result.map(|_| ())
|
|
}
|
|
|
|
// Line 329
|
|
fn c19_l329_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
|
println!("Executing function {}", "c19_l329_action_invoke");
|
|
let result = instance.call("as-store-first", &[]);
|
|
assert_eq!(result, Ok(None));
|
|
result.map(|_| ())
|
|
}
|
|
|
|
// Line 330
|
|
fn c20_l330_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
|
println!("Executing function {}", "c20_l330_action_invoke");
|
|
let result = instance.call("as-store-last", &[]);
|
|
assert_eq!(result, Ok(None));
|
|
result.map(|_| ())
|
|
}
|
|
|
|
// Line 332
|
|
fn c21_l332_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
|
println!("Executing function {}", "c21_l332_action_invoke");
|
|
let result = instance.call("as-memory.grow-value", &[]);
|
|
assert_eq!(result, Ok(Some(Value::I32(1 as i32))));
|
|
result.map(|_| ())
|
|
}
|
|
|
|
// Line 333
|
|
fn c22_l333_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
|
println!("Executing function {}", "c22_l333_action_invoke");
|
|
let result = instance.call("as-call-value", &[]);
|
|
assert_eq!(result, Ok(Some(Value::I32(1 as i32))));
|
|
result.map(|_| ())
|
|
}
|
|
|
|
// Line 334
|
|
fn c23_l334_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
|
println!("Executing function {}", "c23_l334_action_invoke");
|
|
let result = instance.call("as-return-value", &[]);
|
|
assert_eq!(result, Ok(Some(Value::I32(1 as i32))));
|
|
result.map(|_| ())
|
|
}
|
|
|
|
// Line 335
|
|
fn c24_l335_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
|
println!("Executing function {}", "c24_l335_action_invoke");
|
|
let result = instance.call("as-drop-operand", &[]);
|
|
assert_eq!(result, Ok(None));
|
|
result.map(|_| ())
|
|
}
|
|
|
|
// Line 336
|
|
fn c25_l336_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
|
println!("Executing function {}", "c25_l336_action_invoke");
|
|
let result = instance.call("as-br-value", &[]);
|
|
assert_eq!(result, Ok(Some(Value::I32(1 as i32))));
|
|
result.map(|_| ())
|
|
}
|
|
|
|
// Line 337
|
|
fn c26_l337_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
|
println!("Executing function {}", "c26_l337_action_invoke");
|
|
let result = instance.call("as-set_local-value", &[]);
|
|
assert_eq!(result, Ok(Some(Value::I32(1 as i32))));
|
|
result.map(|_| ())
|
|
}
|
|
|
|
// Line 338
|
|
fn c27_l338_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
|
println!("Executing function {}", "c27_l338_action_invoke");
|
|
let result = instance.call("as-tee_local-value", &[]);
|
|
assert_eq!(result, Ok(Some(Value::I32(1 as i32))));
|
|
result.map(|_| ())
|
|
}
|
|
|
|
// Line 339
|
|
fn c28_l339_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
|
println!("Executing function {}", "c28_l339_action_invoke");
|
|
let result = instance.call("as-set_global-value", &[]);
|
|
assert_eq!(result, Ok(Some(Value::I32(1 as i32))));
|
|
result.map(|_| ())
|
|
}
|
|
|
|
// Line 340
|
|
fn c29_l340_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
|
println!("Executing function {}", "c29_l340_action_invoke");
|
|
let result = instance.call("as-load-operand", &[]);
|
|
assert_eq!(result, Ok(Some(Value::I32(1 as i32))));
|
|
result.map(|_| ())
|
|
}
|
|
|
|
// Line 342
|
|
fn c30_l342_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
|
println!("Executing function {}", "c30_l342_action_invoke");
|
|
let result = instance.call("as-unary-operand", &[]);
|
|
assert_eq!(result, Ok(Some(Value::I32(0 as i32))));
|
|
result.map(|_| ())
|
|
}
|
|
|
|
// Line 343
|
|
fn c31_l343_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
|
println!("Executing function {}", "c31_l343_action_invoke");
|
|
let result = instance.call("as-binary-operand", &[]);
|
|
assert_eq!(result, Ok(Some(Value::I32(12 as i32))));
|
|
result.map(|_| ())
|
|
}
|
|
|
|
// Line 344
|
|
fn c32_l344_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
|
println!("Executing function {}", "c32_l344_action_invoke");
|
|
let result = instance.call("as-test-operand", &[]);
|
|
assert_eq!(result, Ok(Some(Value::I32(0 as i32))));
|
|
result.map(|_| ())
|
|
}
|
|
|
|
// Line 345
|
|
fn c33_l345_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
|
println!("Executing function {}", "c33_l345_action_invoke");
|
|
let result = instance.call("as-compare-operand", &[]);
|
|
assert_eq!(result, Ok(Some(Value::I32(0 as i32))));
|
|
result.map(|_| ())
|
|
}
|
|
|
|
// Line 347
|
|
fn c34_l347_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
|
println!("Executing function {}", "c34_l347_action_invoke");
|
|
let result = instance.call("break-bare", &[]);
|
|
assert_eq!(result, Ok(Some(Value::I32(19 as i32))));
|
|
result.map(|_| ())
|
|
}
|
|
|
|
// Line 348
|
|
fn c35_l348_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
|
println!("Executing function {}", "c35_l348_action_invoke");
|
|
let result = instance.call("break-value", &[]);
|
|
assert_eq!(result, Ok(Some(Value::I32(18 as i32))));
|
|
result.map(|_| ())
|
|
}
|
|
|
|
// Line 349
|
|
fn c36_l349_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
|
println!("Executing function {}", "c36_l349_action_invoke");
|
|
let result = instance.call("break-repeated", &[]);
|
|
assert_eq!(result, Ok(Some(Value::I32(18 as i32))));
|
|
result.map(|_| ())
|
|
}
|
|
|
|
// Line 350
|
|
fn c37_l350_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
|
println!("Executing function {}", "c37_l350_action_invoke");
|
|
let result = instance.call("break-inner", &[]);
|
|
assert_eq!(result, Ok(Some(Value::I32(31 as i32))));
|
|
result.map(|_| ())
|
|
}
|
|
|
|
// Line 352
|
|
fn c38_l352_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
|
println!("Executing function {}", "c38_l352_action_invoke");
|
|
let result = instance.call("effects", &[]);
|
|
assert_eq!(result, Ok(Some(Value::I32(1 as i32))));
|
|
result.map(|_| ())
|
|
}
|
|
|
|
// Line 354
|
|
fn c39_l354_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
|
println!("Executing function {}", "c39_l354_action_invoke");
|
|
let result = instance.call("while", &[Value::I64(0 as i64)]);
|
|
assert_eq!(result, Ok(Some(Value::I64(1 as i64))));
|
|
result.map(|_| ())
|
|
}
|
|
|
|
// Line 355
|
|
fn c40_l355_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
|
println!("Executing function {}", "c40_l355_action_invoke");
|
|
let result = instance.call("while", &[Value::I64(1 as i64)]);
|
|
assert_eq!(result, Ok(Some(Value::I64(1 as i64))));
|
|
result.map(|_| ())
|
|
}
|
|
|
|
// Line 356
|
|
fn c41_l356_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
|
println!("Executing function {}", "c41_l356_action_invoke");
|
|
let result = instance.call("while", &[Value::I64(2 as i64)]);
|
|
assert_eq!(result, Ok(Some(Value::I64(2 as i64))));
|
|
result.map(|_| ())
|
|
}
|
|
|
|
// Line 357
|
|
fn c42_l357_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
|
println!("Executing function {}", "c42_l357_action_invoke");
|
|
let result = instance.call("while", &[Value::I64(3 as i64)]);
|
|
assert_eq!(result, Ok(Some(Value::I64(6 as i64))));
|
|
result.map(|_| ())
|
|
}
|
|
|
|
// Line 358
|
|
fn c43_l358_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
|
println!("Executing function {}", "c43_l358_action_invoke");
|
|
let result = instance.call("while", &[Value::I64(5 as i64)]);
|
|
assert_eq!(result, Ok(Some(Value::I64(120 as i64))));
|
|
result.map(|_| ())
|
|
}
|
|
|
|
// Line 359
|
|
fn c44_l359_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
|
println!("Executing function {}", "c44_l359_action_invoke");
|
|
let result = instance.call("while", &[Value::I64(20 as i64)]);
|
|
assert_eq!(result, Ok(Some(Value::I64(2432902008176640000 as i64))));
|
|
result.map(|_| ())
|
|
}
|
|
|
|
// Line 361
|
|
fn c45_l361_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
|
println!("Executing function {}", "c45_l361_action_invoke");
|
|
let result = instance.call("for", &[Value::I64(0 as i64)]);
|
|
assert_eq!(result, Ok(Some(Value::I64(1 as i64))));
|
|
result.map(|_| ())
|
|
}
|
|
|
|
// Line 362
|
|
fn c46_l362_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
|
println!("Executing function {}", "c46_l362_action_invoke");
|
|
let result = instance.call("for", &[Value::I64(1 as i64)]);
|
|
assert_eq!(result, Ok(Some(Value::I64(1 as i64))));
|
|
result.map(|_| ())
|
|
}
|
|
|
|
// Line 363
|
|
fn c47_l363_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
|
println!("Executing function {}", "c47_l363_action_invoke");
|
|
let result = instance.call("for", &[Value::I64(2 as i64)]);
|
|
assert_eq!(result, Ok(Some(Value::I64(2 as i64))));
|
|
result.map(|_| ())
|
|
}
|
|
|
|
// Line 364
|
|
fn c48_l364_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
|
println!("Executing function {}", "c48_l364_action_invoke");
|
|
let result = instance.call("for", &[Value::I64(3 as i64)]);
|
|
assert_eq!(result, Ok(Some(Value::I64(6 as i64))));
|
|
result.map(|_| ())
|
|
}
|
|
|
|
// Line 365
|
|
fn c49_l365_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
|
println!("Executing function {}", "c49_l365_action_invoke");
|
|
let result = instance.call("for", &[Value::I64(5 as i64)]);
|
|
assert_eq!(result, Ok(Some(Value::I64(120 as i64))));
|
|
result.map(|_| ())
|
|
}
|
|
|
|
// Line 366
|
|
fn c50_l366_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
|
println!("Executing function {}", "c50_l366_action_invoke");
|
|
let result = instance.call("for", &[Value::I64(20 as i64)]);
|
|
assert_eq!(result, Ok(Some(Value::I64(2432902008176640000 as i64))));
|
|
result.map(|_| ())
|
|
}
|
|
|
|
// Line 368
|
|
fn c51_l368_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
|
println!("Executing function {}", "c51_l368_action_invoke");
|
|
let result = instance.call("nesting", &[Value::F32((0.0f32).to_bits()), Value::F32((7.0f32).to_bits())]);
|
|
assert_eq!(result, Ok(Some(Value::F32((0.0f32).to_bits()))));
|
|
result.map(|_| ())
|
|
}
|
|
|
|
// Line 369
|
|
fn c52_l369_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
|
println!("Executing function {}", "c52_l369_action_invoke");
|
|
let result = instance.call("nesting", &[Value::F32((7.0f32).to_bits()), Value::F32((0.0f32).to_bits())]);
|
|
assert_eq!(result, Ok(Some(Value::F32((0.0f32).to_bits()))));
|
|
result.map(|_| ())
|
|
}
|
|
|
|
// Line 370
|
|
fn c53_l370_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
|
println!("Executing function {}", "c53_l370_action_invoke");
|
|
let result = instance.call("nesting", &[Value::F32((1.0f32).to_bits()), Value::F32((1.0f32).to_bits())]);
|
|
assert_eq!(result, Ok(Some(Value::F32((1.0f32).to_bits()))));
|
|
result.map(|_| ())
|
|
}
|
|
|
|
// Line 371
|
|
fn c54_l371_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
|
println!("Executing function {}", "c54_l371_action_invoke");
|
|
let result = instance.call("nesting", &[Value::F32((1.0f32).to_bits()), Value::F32((2.0f32).to_bits())]);
|
|
assert_eq!(result, Ok(Some(Value::F32((2.0f32).to_bits()))));
|
|
result.map(|_| ())
|
|
}
|
|
|
|
// Line 372
|
|
fn c55_l372_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
|
println!("Executing function {}", "c55_l372_action_invoke");
|
|
let result = instance.call("nesting", &[Value::F32((1.0f32).to_bits()), Value::F32((3.0f32).to_bits())]);
|
|
assert_eq!(result, Ok(Some(Value::F32((4.0f32).to_bits()))));
|
|
result.map(|_| ())
|
|
}
|
|
|
|
// Line 373
|
|
fn c56_l373_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
|
println!("Executing function {}", "c56_l373_action_invoke");
|
|
let result = instance.call("nesting", &[Value::F32((1.0f32).to_bits()), Value::F32((4.0f32).to_bits())]);
|
|
assert_eq!(result, Ok(Some(Value::F32((6.0f32).to_bits()))));
|
|
result.map(|_| ())
|
|
}
|
|
|
|
// Line 374
|
|
fn c57_l374_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
|
println!("Executing function {}", "c57_l374_action_invoke");
|
|
let result = instance.call("nesting", &[Value::F32((1.0f32).to_bits()), Value::F32((100.0f32).to_bits())]);
|
|
assert_eq!(result, Ok(Some(Value::F32((2550.0f32).to_bits()))));
|
|
result.map(|_| ())
|
|
}
|
|
|
|
// Line 375
|
|
fn c58_l375_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
|
println!("Executing function {}", "c58_l375_action_invoke");
|
|
let result = instance.call("nesting", &[Value::F32((1.0f32).to_bits()), Value::F32((101.0f32).to_bits())]);
|
|
assert_eq!(result, Ok(Some(Value::F32((2601.0f32).to_bits()))));
|
|
result.map(|_| ())
|
|
}
|
|
|
|
// Line 376
|
|
fn c59_l376_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
|
println!("Executing function {}", "c59_l376_action_invoke");
|
|
let result = instance.call("nesting", &[Value::F32((2.0f32).to_bits()), Value::F32((1.0f32).to_bits())]);
|
|
assert_eq!(result, Ok(Some(Value::F32((1.0f32).to_bits()))));
|
|
result.map(|_| ())
|
|
}
|
|
|
|
// Line 377
|
|
fn c60_l377_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
|
println!("Executing function {}", "c60_l377_action_invoke");
|
|
let result = instance.call("nesting", &[Value::F32((3.0f32).to_bits()), Value::F32((1.0f32).to_bits())]);
|
|
assert_eq!(result, Ok(Some(Value::F32((1.0f32).to_bits()))));
|
|
result.map(|_| ())
|
|
}
|
|
|
|
// Line 378
|
|
fn c61_l378_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
|
println!("Executing function {}", "c61_l378_action_invoke");
|
|
let result = instance.call("nesting", &[Value::F32((10.0f32).to_bits()), Value::F32((1.0f32).to_bits())]);
|
|
assert_eq!(result, Ok(Some(Value::F32((1.0f32).to_bits()))));
|
|
result.map(|_| ())
|
|
}
|
|
|
|
// Line 379
|
|
fn c62_l379_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
|
println!("Executing function {}", "c62_l379_action_invoke");
|
|
let result = instance.call("nesting", &[Value::F32((2.0f32).to_bits()), Value::F32((2.0f32).to_bits())]);
|
|
assert_eq!(result, Ok(Some(Value::F32((3.0f32).to_bits()))));
|
|
result.map(|_| ())
|
|
}
|
|
|
|
// Line 380
|
|
fn c63_l380_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
|
println!("Executing function {}", "c63_l380_action_invoke");
|
|
let result = instance.call("nesting", &[Value::F32((2.0f32).to_bits()), Value::F32((3.0f32).to_bits())]);
|
|
assert_eq!(result, Ok(Some(Value::F32((4.0f32).to_bits()))));
|
|
result.map(|_| ())
|
|
}
|
|
|
|
// Line 381
|
|
fn c64_l381_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
|
println!("Executing function {}", "c64_l381_action_invoke");
|
|
let result = instance.call("nesting", &[Value::F32((7.0f32).to_bits()), Value::F32((4.0f32).to_bits())]);
|
|
assert_eq!(result, Ok(Some(Value::F32((10.309524f32).to_bits()))));
|
|
result.map(|_| ())
|
|
}
|
|
|
|
// Line 382
|
|
fn c65_l382_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
|
println!("Executing function {}", "c65_l382_action_invoke");
|
|
let result = instance.call("nesting", &[Value::F32((7.0f32).to_bits()), Value::F32((100.0f32).to_bits())]);
|
|
assert_eq!(result, Ok(Some(Value::F32((4381.548f32).to_bits()))));
|
|
result.map(|_| ())
|
|
}
|
|
|
|
// Line 383
|
|
fn c66_l383_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
|
println!("Executing function {}", "c66_l383_action_invoke");
|
|
let result = instance.call("nesting", &[Value::F32((7.0f32).to_bits()), Value::F32((101.0f32).to_bits())]);
|
|
assert_eq!(result, Ok(Some(Value::F32((2601.0f32).to_bits()))));
|
|
result.map(|_| ())
|
|
}
|
|
|
|
// Line 386
|
|
#[test]
|
|
fn c67_l386_assert_invalid() {
|
|
let wasm_binary = [0, 97, 115, 109, 1, 0, 0, 0, 1, 5, 1, 96, 0, 1, 127, 3, 2, 1, 0, 10, 7, 1, 5, 0, 3, 64, 11, 11];
|
|
let module = wasmer_runtime::compile(&wasm_binary, &CraneliftCompiler::new());
|
|
assert!(module.is_err(), "WASM should not compile as is invalid");
|
|
}
|
|
|
|
// Line 390
|
|
#[test]
|
|
fn c68_l390_assert_invalid() {
|
|
let wasm_binary = [0, 97, 115, 109, 1, 0, 0, 0, 1, 5, 1, 96, 0, 1, 126, 3, 2, 1, 0, 10, 7, 1, 5, 0, 3, 64, 11, 11];
|
|
let module = wasmer_runtime::compile(&wasm_binary, &CraneliftCompiler::new());
|
|
assert!(module.is_err(), "WASM should not compile as is invalid");
|
|
}
|
|
|
|
// Line 394
|
|
#[test]
|
|
fn c69_l394_assert_invalid() {
|
|
let wasm_binary = [0, 97, 115, 109, 1, 0, 0, 0, 1, 5, 1, 96, 0, 1, 125, 3, 2, 1, 0, 10, 7, 1, 5, 0, 3, 64, 11, 11];
|
|
let module = wasmer_runtime::compile(&wasm_binary, &CraneliftCompiler::new());
|
|
assert!(module.is_err(), "WASM should not compile as is invalid");
|
|
}
|
|
|
|
// Line 398
|
|
#[test]
|
|
fn c70_l398_assert_invalid() {
|
|
let wasm_binary = [0, 97, 115, 109, 1, 0, 0, 0, 1, 5, 1, 96, 0, 1, 124, 3, 2, 1, 0, 10, 7, 1, 5, 0, 3, 64, 11, 11];
|
|
let module = wasmer_runtime::compile(&wasm_binary, &CraneliftCompiler::new());
|
|
assert!(module.is_err(), "WASM should not compile as is invalid");
|
|
}
|
|
|
|
// Line 403
|
|
#[test]
|
|
fn c71_l403_assert_invalid() {
|
|
let wasm_binary = [0, 97, 115, 109, 1, 0, 0, 0, 1, 4, 1, 96, 0, 0, 3, 2, 1, 0, 10, 9, 1, 7, 0, 3, 64, 65, 1, 11, 11];
|
|
let module = wasmer_runtime::compile(&wasm_binary, &CraneliftCompiler::new());
|
|
assert!(module.is_err(), "WASM should not compile as is invalid");
|
|
}
|
|
|
|
// Line 409
|
|
#[test]
|
|
fn c72_l409_assert_invalid() {
|
|
let wasm_binary = [0, 97, 115, 109, 1, 0, 0, 0, 1, 5, 1, 96, 0, 1, 127, 3, 2, 1, 0, 10, 7, 1, 5, 0, 3, 127, 11, 11];
|
|
let module = wasmer_runtime::compile(&wasm_binary, &CraneliftCompiler::new());
|
|
assert!(module.is_err(), "WASM should not compile as is invalid");
|
|
}
|
|
|
|
// Line 415
|
|
#[test]
|
|
fn c73_l415_assert_invalid() {
|
|
let wasm_binary = [0, 97, 115, 109, 1, 0, 0, 0, 1, 5, 1, 96, 0, 1, 127, 3, 2, 1, 0, 10, 8, 1, 6, 0, 3, 127, 1, 11, 11];
|
|
let module = wasmer_runtime::compile(&wasm_binary, &CraneliftCompiler::new());
|
|
assert!(module.is_err(), "WASM should not compile as is invalid");
|
|
}
|
|
|
|
// Line 421
|
|
#[test]
|
|
fn c74_l421_assert_invalid() {
|
|
let wasm_binary = [0, 97, 115, 109, 1, 0, 0, 0, 1, 5, 1, 96, 0, 1, 127, 3, 2, 1, 0, 10, 12, 1, 10, 0, 3, 127, 67, 0, 0, 0, 0, 11, 11];
|
|
let module = wasmer_runtime::compile(&wasm_binary, &CraneliftCompiler::new());
|
|
assert!(module.is_err(), "WASM should not compile as is invalid");
|
|
}
|
|
|
|
// Line 427
|
|
#[test]
|
|
fn c75_l427_assert_invalid() {
|
|
let wasm_binary = [0, 97, 115, 109, 1, 0, 0, 0, 1, 5, 1, 96, 0, 1, 127, 3, 2, 1, 0, 10, 11, 1, 9, 0, 3, 126, 0, 0, 0, 27, 11, 11];
|
|
let module = wasmer_runtime::compile(&wasm_binary, &CraneliftCompiler::new());
|
|
assert!(module.is_err(), "WASM should not compile as is invalid");
|
|
}
|
|
|
|
// Line 435
|
|
#[test]
|
|
fn c76_l435_assert_malformed() {
|
|
let wasm_binary = [40, 102, 117, 110, 99, 32, 108, 111, 111, 112, 32, 101, 110, 100, 32, 36, 108, 41];
|
|
let compilation = wasmer_runtime::compile(&wasm_binary, &CraneliftCompiler::new());
|
|
assert!(compilation.is_err(), "WASM should not compile as is malformed");
|
|
}
|
|
|
|
// Line 439
|
|
#[test]
|
|
fn c77_l439_assert_malformed() {
|
|
let wasm_binary = [40, 102, 117, 110, 99, 32, 108, 111, 111, 112, 32, 36, 97, 32, 101, 110, 100, 32, 36, 108, 41];
|
|
let compilation = wasmer_runtime::compile(&wasm_binary, &CraneliftCompiler::new());
|
|
assert!(compilation.is_err(), "WASM should not compile as is malformed");
|
|
}
|
|
|
|
#[test]
|
|
fn test_module_1() {
|
|
let mut instance = create_module_1();
|
|
// We group the calls together
|
|
start_module_1(&mut instance);
|
|
c1_l305_action_invoke(&mut instance);
|
|
c2_l306_action_invoke(&mut instance);
|
|
c3_l307_action_invoke(&mut instance);
|
|
c4_l308_action_invoke(&mut instance);
|
|
c5_l309_action_invoke(&mut instance);
|
|
c6_l311_action_invoke(&mut instance);
|
|
c7_l312_action_invoke(&mut instance);
|
|
c8_l313_action_invoke(&mut instance);
|
|
c9_l315_action_invoke(&mut instance);
|
|
c10_l316_action_invoke(&mut instance);
|
|
c11_l317_action_invoke(&mut instance);
|
|
c12_l319_action_invoke(&mut instance);
|
|
c13_l320_action_invoke(&mut instance);
|
|
c14_l322_action_invoke(&mut instance);
|
|
c15_l323_action_invoke(&mut instance);
|
|
c16_l325_action_invoke(&mut instance);
|
|
c17_l326_action_invoke(&mut instance);
|
|
c18_l327_action_invoke(&mut instance);
|
|
c19_l329_action_invoke(&mut instance);
|
|
c20_l330_action_invoke(&mut instance);
|
|
c21_l332_action_invoke(&mut instance);
|
|
c22_l333_action_invoke(&mut instance);
|
|
c23_l334_action_invoke(&mut instance);
|
|
c24_l335_action_invoke(&mut instance);
|
|
c25_l336_action_invoke(&mut instance);
|
|
c26_l337_action_invoke(&mut instance);
|
|
c27_l338_action_invoke(&mut instance);
|
|
c28_l339_action_invoke(&mut instance);
|
|
c29_l340_action_invoke(&mut instance);
|
|
c30_l342_action_invoke(&mut instance);
|
|
c31_l343_action_invoke(&mut instance);
|
|
c32_l344_action_invoke(&mut instance);
|
|
c33_l345_action_invoke(&mut instance);
|
|
c34_l347_action_invoke(&mut instance);
|
|
c35_l348_action_invoke(&mut instance);
|
|
c36_l349_action_invoke(&mut instance);
|
|
c37_l350_action_invoke(&mut instance);
|
|
c38_l352_action_invoke(&mut instance);
|
|
c39_l354_action_invoke(&mut instance);
|
|
c40_l355_action_invoke(&mut instance);
|
|
c41_l356_action_invoke(&mut instance);
|
|
c42_l357_action_invoke(&mut instance);
|
|
c43_l358_action_invoke(&mut instance);
|
|
c44_l359_action_invoke(&mut instance);
|
|
c45_l361_action_invoke(&mut instance);
|
|
c46_l362_action_invoke(&mut instance);
|
|
c47_l363_action_invoke(&mut instance);
|
|
c48_l364_action_invoke(&mut instance);
|
|
c49_l365_action_invoke(&mut instance);
|
|
c50_l366_action_invoke(&mut instance);
|
|
c51_l368_action_invoke(&mut instance);
|
|
c52_l369_action_invoke(&mut instance);
|
|
c53_l370_action_invoke(&mut instance);
|
|
c54_l371_action_invoke(&mut instance);
|
|
c55_l372_action_invoke(&mut instance);
|
|
c56_l373_action_invoke(&mut instance);
|
|
c57_l374_action_invoke(&mut instance);
|
|
c58_l375_action_invoke(&mut instance);
|
|
c59_l376_action_invoke(&mut instance);
|
|
c60_l377_action_invoke(&mut instance);
|
|
c61_l378_action_invoke(&mut instance);
|
|
c62_l379_action_invoke(&mut instance);
|
|
c63_l380_action_invoke(&mut instance);
|
|
c64_l381_action_invoke(&mut instance);
|
|
c65_l382_action_invoke(&mut instance);
|
|
c66_l383_action_invoke(&mut instance);
|
|
}
|