wasmer/lib/runtime/tests/spectests/nop.rs

1435 lines
46 KiB
Rust
Raw Normal View History

2019-01-09 06:06:24 +00:00
// 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/nop.wast
#![allow(
warnings,
dead_code
)]
use wabt::wat2wasm;
use std::{f32, f64};
use wasmer_runtime::types::Value;
use wasmer_runtime::{Instance, module::Module};
2019-01-09 06:06:24 +00:00
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 (param i32 i32 i32) (result i32)))
(type (;3;) (func (result i32)))
(type (;4;) (func (param i32)))
(type (;5;) (func (param i32) (result i32)))
(type (;6;) (func (param i32 i32)))
(func (;0;) (type 1))
(func (;1;) (type 2) (param i32 i32 i32) (result i32)
get_local 0
get_local 1
get_local 2
i32.sub
i32.add)
(func (;2;) (type 3) (result i32)
nop
i32.const 1)
(func (;3;) (type 3) (result i32)
call 0
nop
i32.const 2)
(func (;4;) (type 3) (result i32)
call 0
i32.const 3
nop)
(func (;5;) (type 3) (result i32)
nop
nop
call 0
nop
i32.const 4
nop
nop)
(func (;6;) (type 4) (param i32)
nop
get_local 0
drop)
(func (;7;) (type 4) (param i32)
get_local 0
nop
drop)
(func (;8;) (type 4) (param i32)
nop
nop
get_local 0
nop
nop
drop)
(func (;9;) (type 5) (param i32) (result i32)
nop
get_local 0
get_local 0
get_local 0
select)
(func (;10;) (type 5) (param i32) (result i32)
get_local 0
nop
get_local 0
get_local 0
select)
(func (;11;) (type 5) (param i32) (result i32)
get_local 0
get_local 0
nop
get_local 0
select)
(func (;12;) (type 5) (param i32) (result i32)
get_local 0
get_local 0
get_local 0
nop
select)
(func (;13;) (type 5) (param i32) (result i32)
nop
get_local 0
nop
nop
get_local 0
nop
nop
get_local 0
nop
nop
select)
(func (;14;) (type 3) (result i32)
block (result i32) ;; label = @1
nop
i32.const 2
end)
(func (;15;) (type 3) (result i32)
block (result i32) ;; label = @1
call 0
nop
i32.const 2
end)
(func (;16;) (type 3) (result i32)
block (result i32) ;; label = @1
nop
call 0
i32.const 3
nop
end)
(func (;17;) (type 3) (result i32)
block (result i32) ;; label = @1
nop
nop
call 0
nop
i32.const 4
nop
nop
end)
(func (;18;) (type 3) (result i32)
loop (result i32) ;; label = @1
nop
i32.const 2
end)
(func (;19;) (type 3) (result i32)
loop (result i32) ;; label = @1
call 0
nop
i32.const 2
end)
(func (;20;) (type 3) (result i32)
loop (result i32) ;; label = @1
call 0
i32.const 3
nop
end)
(func (;21;) (type 3) (result i32)
loop (result i32) ;; label = @1
nop
nop
call 0
nop
i32.const 4
nop
nop
end)
(func (;22;) (type 4) (param i32)
get_local 0
nop
if ;; label = @1
call 0
end)
(func (;23;) (type 4) (param i32)
get_local 0
if ;; label = @1
nop
else
call 0
end)
(func (;24;) (type 4) (param i32)
get_local 0
if ;; label = @1
call 0
else
nop
end)
(func (;25;) (type 5) (param i32) (result i32)
block (result i32) ;; label = @1
nop
get_local 0
br 0 (;@1;)
end)
(func (;26;) (type 5) (param i32) (result i32)
block (result i32) ;; label = @1
get_local 0
nop
br 0 (;@1;)
end)
(func (;27;) (type 5) (param i32) (result i32)
block (result i32) ;; label = @1
nop
nop
get_local 0
nop
nop
br 0 (;@1;)
end)
(func (;28;) (type 5) (param i32) (result i32)
block (result i32) ;; label = @1
nop
get_local 0
get_local 0
br_if 0 (;@1;)
end)
(func (;29;) (type 5) (param i32) (result i32)
block (result i32) ;; label = @1
get_local 0
nop
get_local 0
br_if 0 (;@1;)
end)
(func (;30;) (type 5) (param i32) (result i32)
block (result i32) ;; label = @1
get_local 0
get_local 0
nop
br_if 0 (;@1;)
end)
(func (;31;) (type 5) (param i32) (result i32)
block (result i32) ;; label = @1
nop
nop
get_local 0
nop
nop
get_local 0
nop
nop
br_if 0 (;@1;)
end)
(func (;32;) (type 5) (param i32) (result i32)
block (result i32) ;; label = @1
nop
get_local 0
get_local 0
br_table 0 (;@1;) 0 (;@1;)
end)
(func (;33;) (type 5) (param i32) (result i32)
block (result i32) ;; label = @1
get_local 0
nop
get_local 0
br_table 0 (;@1;) 0 (;@1;)
end)
(func (;34;) (type 5) (param i32) (result i32)
block (result i32) ;; label = @1
get_local 0
get_local 0
nop
br_table 0 (;@1;) 0 (;@1;)
end)
(func (;35;) (type 5) (param i32) (result i32)
block (result i32) ;; label = @1
nop
nop
get_local 0
nop
nop
get_local 0
nop
nop
br_table 0 (;@1;) 0 (;@1;)
end)
(func (;36;) (type 5) (param i32) (result i32)
nop
get_local 0
return)
(func (;37;) (type 5) (param i32) (result i32)
get_local 0
nop
return)
(func (;38;) (type 5) (param i32) (result i32)
nop
nop
get_local 0
nop
nop
return)
(func (;39;) (type 2) (param i32 i32 i32) (result i32)
nop
get_local 0
get_local 1
get_local 2
call 1)
(func (;40;) (type 2) (param i32 i32 i32) (result i32)
get_local 0
nop
get_local 1
get_local 2
call 1)
(func (;41;) (type 2) (param i32 i32 i32) (result i32)
get_local 0
get_local 1
nop
get_local 2
call 1)
(func (;42;) (type 2) (param i32 i32 i32) (result i32)
get_local 0
get_local 1
get_local 2
nop
call 1)
(func (;43;) (type 2) (param i32 i32 i32) (result i32)
nop
nop
get_local 0
nop
nop
get_local 1
nop
nop
get_local 2
nop
nop
call 1)
(func (;44;) (type 5) (param i32) (result i32)
nop
get_local 0
i32.ctz)
(func (;45;) (type 5) (param i32) (result i32)
get_local 0
nop
i32.ctz)
(func (;46;) (type 5) (param i32) (result i32)
nop
nop
get_local 0
nop
nop
i32.ctz)
(func (;47;) (type 5) (param i32) (result i32)
nop
get_local 0
get_local 0
i32.add)
(func (;48;) (type 5) (param i32) (result i32)
get_local 0
nop
get_local 0
i32.add)
(func (;49;) (type 5) (param i32) (result i32)
get_local 0
get_local 0
nop
i32.add)
(func (;50;) (type 5) (param i32) (result i32)
nop
get_local 0
nop
nop
get_local 0
nop
nop
i32.add)
(func (;51;) (type 5) (param i32) (result i32)
nop
get_local 0
i32.eqz)
(func (;52;) (type 5) (param i32) (result i32)
get_local 0
nop
i32.eqz)
(func (;53;) (type 5) (param i32) (result i32)
nop
nop
get_local 0
nop
nop
i32.eqz)
(func (;54;) (type 5) (param i32) (result i32)
nop
get_local 0
get_local 0
i32.ne)
(func (;55;) (type 5) (param i32) (result i32)
get_local 0
nop
get_local 0
i32.ne)
(func (;56;) (type 5) (param i32) (result i32)
get_local 0
get_local 0
nop
i32.lt_u)
(func (;57;) (type 5) (param i32) (result i32)
nop
get_local 0
nop
nop
get_local 0
nop
nop
i32.le_s)
(func (;58;) (type 5) (param i32) (result i32)
nop
get_local 0
memory.grow)
(func (;59;) (type 5) (param i32) (result i32)
get_local 0
nop
memory.grow)
(func (;60;) (type 5) (param i32) (result i32)
nop
nop
get_local 0
nop
nop
memory.grow)
(func (;61;) (type 0) (param i32 i32) (result i32)
get_local 0)
(func (;62;) (type 3) (result i32)
block (result i32) ;; label = @1
nop
i32.const 1
i32.const 2
i32.const 0
call_indirect (type 0)
end)
(func (;63;) (type 3) (result i32)
block (result i32) ;; label = @1
i32.const 1
nop
i32.const 2
i32.const 0
call_indirect (type 0)
end)
(func (;64;) (type 3) (result i32)
block (result i32) ;; label = @1
i32.const 1
i32.const 2
nop
i32.const 0
call_indirect (type 0)
end)
(func (;65;) (type 3) (result i32)
block (result i32) ;; label = @1
i32.const 1
i32.const 2
i32.const 0
nop
call_indirect (type 0)
end)
(func (;66;) (type 3) (result i32)
block (result i32) ;; label = @1
nop
nop
i32.const 1
nop
nop
i32.const 2
nop
nop
i32.const 0
nop
nop
call_indirect (type 0)
end)
(func (;67;) (type 5) (param i32) (result i32)
nop
i32.const 2
set_local 0
get_local 0)
(func (;68;) (type 5) (param i32) (result i32)
i32.const 2
nop
set_local 0
get_local 0)
(func (;69;) (type 5) (param i32) (result i32)
nop
nop
i32.const 2
nop
nop
set_local 0
get_local 0)
(func (;70;) (type 5) (param i32) (result i32)
nop
i32.const 2
tee_local 0)
(func (;71;) (type 5) (param i32) (result i32)
i32.const 2
nop
tee_local 0)
(func (;72;) (type 5) (param i32) (result i32)
nop
nop
i32.const 2
nop
nop
tee_local 0)
(func (;73;) (type 3) (result i32)
nop
i32.const 2
set_global 0
get_global 0)
(func (;74;) (type 3) (result i32)
i32.const 2
nop
set_global 0
get_global 0)
(func (;75;) (type 3) (result i32)
nop
nop
i32.const 2
nop
nop
set_global 0
get_global 0)
(func (;76;) (type 5) (param i32) (result i32)
nop
get_local 0
i32.load)
(func (;77;) (type 5) (param i32) (result i32)
get_local 0
nop
i32.load)
(func (;78;) (type 5) (param i32) (result i32)
nop
nop
get_local 0
nop
nop
i32.load)
(func (;79;) (type 6) (param i32 i32)
nop
get_local 0
get_local 1
i32.store)
(func (;80;) (type 6) (param i32 i32)
get_local 0
nop
get_local 1
i32.store)
(func (;81;) (type 6) (param i32 i32)
get_local 0
get_local 1
nop
i32.store)
(func (;82;) (type 6) (param i32 i32)
nop
nop
get_local 0
nop
nop
get_local 1
nop
nop
i32.store)
(table (;0;) 1 1 anyfunc)
(memory (;0;) 1)
(global (;0;) (mut i32) (i32.const 0))
(export \"as-func-first\" (func 2))
(export \"as-func-mid\" (func 3))
(export \"as-func-last\" (func 4))
(export \"as-func-everywhere\" (func 5))
(export \"as-drop-first\" (func 6))
(export \"as-drop-last\" (func 7))
(export \"as-drop-everywhere\" (func 8))
(export \"as-select-first\" (func 9))
(export \"as-select-mid1\" (func 10))
(export \"as-select-mid2\" (func 11))
(export \"as-select-last\" (func 12))
(export \"as-select-everywhere\" (func 13))
(export \"as-block-first\" (func 14))
(export \"as-block-mid\" (func 15))
(export \"as-block-last\" (func 16))
(export \"as-block-everywhere\" (func 17))
(export \"as-loop-first\" (func 18))
(export \"as-loop-mid\" (func 19))
(export \"as-loop-last\" (func 20))
(export \"as-loop-everywhere\" (func 21))
(export \"as-if-condition\" (func 22))
(export \"as-if-then\" (func 23))
(export \"as-if-else\" (func 24))
(export \"as-br-first\" (func 25))
(export \"as-br-last\" (func 26))
(export \"as-br-everywhere\" (func 27))
(export \"as-br_if-first\" (func 28))
(export \"as-br_if-mid\" (func 29))
(export \"as-br_if-last\" (func 30))
(export \"as-br_if-everywhere\" (func 31))
(export \"as-br_table-first\" (func 32))
(export \"as-br_table-mid\" (func 33))
(export \"as-br_table-last\" (func 34))
(export \"as-br_table-everywhere\" (func 35))
(export \"as-return-first\" (func 36))
(export \"as-return-last\" (func 37))
(export \"as-return-everywhere\" (func 38))
(export \"as-call-first\" (func 39))
(export \"as-call-mid1\" (func 40))
(export \"as-call-mid2\" (func 41))
(export \"as-call-last\" (func 42))
(export \"as-call-everywhere\" (func 43))
(export \"as-unary-first\" (func 44))
(export \"as-unary-last\" (func 45))
(export \"as-unary-everywhere\" (func 46))
(export \"as-binary-first\" (func 47))
(export \"as-binary-mid\" (func 48))
(export \"as-binary-last\" (func 49))
(export \"as-binary-everywhere\" (func 50))
(export \"as-test-first\" (func 51))
(export \"as-test-last\" (func 52))
(export \"as-test-everywhere\" (func 53))
(export \"as-compare-first\" (func 54))
(export \"as-compare-mid\" (func 55))
(export \"as-compare-last\" (func 56))
(export \"as-compare-everywhere\" (func 57))
(export \"as-memory.grow-first\" (func 58))
(export \"as-memory.grow-last\" (func 59))
(export \"as-memory.grow-everywhere\" (func 60))
(export \"as-call_indirect-first\" (func 62))
(export \"as-call_indirect-mid1\" (func 63))
(export \"as-call_indirect-mid2\" (func 64))
(export \"as-call_indirect-last\" (func 65))
(export \"as-call_indirect-everywhere\" (func 66))
(export \"as-set_local-first\" (func 67))
(export \"as-set_local-last\" (func 68))
(export \"as-set_local-everywhere\" (func 69))
(export \"as-tee_local-first\" (func 70))
(export \"as-tee_local-last\" (func 71))
(export \"as-tee_local-everywhere\" (func 72))
(export \"as-set_global-first\" (func 73))
(export \"as-set_global-last\" (func 74))
(export \"as-set_global-everywhere\" (func 75))
(export \"as-load-first\" (func 76))
(export \"as-load-last\" (func 77))
(export \"as-load-everywhere\" (func 78))
(export \"as-store-first\" (func 79))
(export \"as-store-mid\" (func 80))
(export \"as-store-last\" (func 81))
(export \"as-store-everywhere\" (func 82))
(elem (;0;) (i32.const 0) 61))
";
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 306
fn c1_l306_action_invoke(instance: &mut Instance) -> Result<(), String> {
println!("Executing function {}", "c1_l306_action_invoke");
let result = instance.call("as-func-first", &[]);
assert_eq!(result, Ok(Some(Value::I32(1 as i32))));
result.map(|_| ())
}
// Line 307
fn c2_l307_action_invoke(instance: &mut Instance) -> Result<(), String> {
println!("Executing function {}", "c2_l307_action_invoke");
let result = instance.call("as-func-mid", &[]);
assert_eq!(result, Ok(Some(Value::I32(2 as i32))));
result.map(|_| ())
}
// Line 308
fn c3_l308_action_invoke(instance: &mut Instance) -> Result<(), String> {
println!("Executing function {}", "c3_l308_action_invoke");
let result = instance.call("as-func-last", &[]);
assert_eq!(result, Ok(Some(Value::I32(3 as i32))));
result.map(|_| ())
}
// Line 309
fn c4_l309_action_invoke(instance: &mut Instance) -> Result<(), String> {
println!("Executing function {}", "c4_l309_action_invoke");
let result = instance.call("as-func-everywhere", &[]);
assert_eq!(result, Ok(Some(Value::I32(4 as i32))));
result.map(|_| ())
}
// Line 311
fn c5_l311_action_invoke(instance: &mut Instance) -> Result<(), String> {
println!("Executing function {}", "c5_l311_action_invoke");
let result = instance.call("as-drop-first", &[Value::I32(0 as i32)]);
assert_eq!(result, Ok(None));
result.map(|_| ())
}
// Line 312
fn c6_l312_action_invoke(instance: &mut Instance) -> Result<(), String> {
println!("Executing function {}", "c6_l312_action_invoke");
let result = instance.call("as-drop-last", &[Value::I32(0 as i32)]);
assert_eq!(result, Ok(None));
result.map(|_| ())
}
// Line 313
fn c7_l313_action_invoke(instance: &mut Instance) -> Result<(), String> {
println!("Executing function {}", "c7_l313_action_invoke");
let result = instance.call("as-drop-everywhere", &[Value::I32(0 as i32)]);
assert_eq!(result, Ok(None));
result.map(|_| ())
}
// Line 315
fn c8_l315_action_invoke(instance: &mut Instance) -> Result<(), String> {
println!("Executing function {}", "c8_l315_action_invoke");
let result = instance.call("as-select-first", &[Value::I32(3 as i32)]);
assert_eq!(result, Ok(Some(Value::I32(3 as i32))));
result.map(|_| ())
}
// Line 316
fn c9_l316_action_invoke(instance: &mut Instance) -> Result<(), String> {
println!("Executing function {}", "c9_l316_action_invoke");
let result = instance.call("as-select-mid1", &[Value::I32(3 as i32)]);
assert_eq!(result, Ok(Some(Value::I32(3 as i32))));
result.map(|_| ())
}
// Line 317
fn c10_l317_action_invoke(instance: &mut Instance) -> Result<(), String> {
println!("Executing function {}", "c10_l317_action_invoke");
let result = instance.call("as-select-mid2", &[Value::I32(3 as i32)]);
assert_eq!(result, Ok(Some(Value::I32(3 as i32))));
result.map(|_| ())
}
// Line 318
fn c11_l318_action_invoke(instance: &mut Instance) -> Result<(), String> {
println!("Executing function {}", "c11_l318_action_invoke");
let result = instance.call("as-select-last", &[Value::I32(3 as i32)]);
assert_eq!(result, Ok(Some(Value::I32(3 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-select-everywhere", &[Value::I32(3 as i32)]);
assert_eq!(result, Ok(Some(Value::I32(3 as i32))));
result.map(|_| ())
}
// Line 321
fn c13_l321_action_invoke(instance: &mut Instance) -> Result<(), String> {
println!("Executing function {}", "c13_l321_action_invoke");
let result = instance.call("as-block-first", &[]);
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-block-mid", &[]);
assert_eq!(result, Ok(Some(Value::I32(2 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-block-last", &[]);
assert_eq!(result, Ok(Some(Value::I32(3 as i32))));
result.map(|_| ())
}
// Line 324
fn c16_l324_action_invoke(instance: &mut Instance) -> Result<(), String> {
println!("Executing function {}", "c16_l324_action_invoke");
let result = instance.call("as-block-everywhere", &[]);
assert_eq!(result, Ok(Some(Value::I32(4 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-loop-first", &[]);
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-loop-mid", &[]);
assert_eq!(result, Ok(Some(Value::I32(2 as i32))));
result.map(|_| ())
}
// Line 328
fn c19_l328_action_invoke(instance: &mut Instance) -> Result<(), String> {
println!("Executing function {}", "c19_l328_action_invoke");
let result = instance.call("as-loop-last", &[]);
assert_eq!(result, Ok(Some(Value::I32(3 as i32))));
result.map(|_| ())
}
// Line 329
fn c20_l329_action_invoke(instance: &mut Instance) -> Result<(), String> {
println!("Executing function {}", "c20_l329_action_invoke");
let result = instance.call("as-loop-everywhere", &[]);
assert_eq!(result, Ok(Some(Value::I32(4 as i32))));
result.map(|_| ())
}
// Line 331
fn c21_l331_action_invoke(instance: &mut Instance) -> Result<(), String> {
println!("Executing function {}", "c21_l331_action_invoke");
let result = instance.call("as-if-condition", &[Value::I32(0 as i32)]);
assert_eq!(result, Ok(None));
result.map(|_| ())
}
// Line 332
fn c22_l332_action_invoke(instance: &mut Instance) -> Result<(), String> {
println!("Executing function {}", "c22_l332_action_invoke");
let result = instance.call("as-if-condition", &[Value::I32(-1 as i32)]);
assert_eq!(result, Ok(None));
result.map(|_| ())
}
// Line 333
fn c23_l333_action_invoke(instance: &mut Instance) -> Result<(), String> {
println!("Executing function {}", "c23_l333_action_invoke");
let result = instance.call("as-if-then", &[Value::I32(0 as i32)]);
assert_eq!(result, Ok(None));
result.map(|_| ())
}
// Line 334
fn c24_l334_action_invoke(instance: &mut Instance) -> Result<(), String> {
println!("Executing function {}", "c24_l334_action_invoke");
let result = instance.call("as-if-then", &[Value::I32(4 as i32)]);
assert_eq!(result, Ok(None));
result.map(|_| ())
}
// Line 335
fn c25_l335_action_invoke(instance: &mut Instance) -> Result<(), String> {
println!("Executing function {}", "c25_l335_action_invoke");
let result = instance.call("as-if-else", &[Value::I32(0 as i32)]);
assert_eq!(result, Ok(None));
result.map(|_| ())
}
// Line 336
fn c26_l336_action_invoke(instance: &mut Instance) -> Result<(), String> {
println!("Executing function {}", "c26_l336_action_invoke");
let result = instance.call("as-if-else", &[Value::I32(3 as i32)]);
assert_eq!(result, Ok(None));
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-br-first", &[Value::I32(5 as i32)]);
assert_eq!(result, Ok(Some(Value::I32(5 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-br-last", &[Value::I32(6 as i32)]);
assert_eq!(result, Ok(Some(Value::I32(6 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-br-everywhere", &[Value::I32(7 as i32)]);
assert_eq!(result, Ok(Some(Value::I32(7 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-br_if-first", &[Value::I32(4 as i32)]);
assert_eq!(result, Ok(Some(Value::I32(4 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-br_if-mid", &[Value::I32(5 as i32)]);
assert_eq!(result, Ok(Some(Value::I32(5 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-br_if-last", &[Value::I32(6 as i32)]);
assert_eq!(result, Ok(Some(Value::I32(6 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-br_if-everywhere", &[Value::I32(7 as i32)]);
assert_eq!(result, Ok(Some(Value::I32(7 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("as-br_table-first", &[Value::I32(4 as i32)]);
assert_eq!(result, Ok(Some(Value::I32(4 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("as-br_table-mid", &[Value::I32(5 as i32)]);
assert_eq!(result, Ok(Some(Value::I32(5 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("as-br_table-last", &[Value::I32(6 as i32)]);
assert_eq!(result, Ok(Some(Value::I32(6 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("as-br_table-everywhere", &[Value::I32(7 as i32)]);
assert_eq!(result, Ok(Some(Value::I32(7 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("as-return-first", &[Value::I32(5 as i32)]);
assert_eq!(result, Ok(Some(Value::I32(5 as i32))));
result.map(|_| ())
}
// Line 353
fn c39_l353_action_invoke(instance: &mut Instance) -> Result<(), String> {
println!("Executing function {}", "c39_l353_action_invoke");
let result = instance.call("as-return-last", &[Value::I32(6 as i32)]);
assert_eq!(result, Ok(Some(Value::I32(6 as i32))));
result.map(|_| ())
}
// Line 354
fn c40_l354_action_invoke(instance: &mut Instance) -> Result<(), String> {
println!("Executing function {}", "c40_l354_action_invoke");
let result = instance.call("as-return-everywhere", &[Value::I32(7 as i32)]);
assert_eq!(result, Ok(Some(Value::I32(7 as i32))));
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("as-call-first", &[Value::I32(3 as i32), Value::I32(1 as i32), Value::I32(2 as i32)]);
assert_eq!(result, Ok(Some(Value::I32(2 as i32))));
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("as-call-mid1", &[Value::I32(3 as i32), Value::I32(1 as i32), Value::I32(2 as i32)]);
assert_eq!(result, Ok(Some(Value::I32(2 as i32))));
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("as-call-mid2", &[Value::I32(0 as i32), Value::I32(3 as i32), Value::I32(1 as i32)]);
assert_eq!(result, Ok(Some(Value::I32(2 as i32))));
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("as-call-last", &[Value::I32(10 as i32), Value::I32(9 as i32), Value::I32(-1 as i32)]);
assert_eq!(result, Ok(Some(Value::I32(20 as i32))));
result.map(|_| ())
}
// Line 360
fn c45_l360_action_invoke(instance: &mut Instance) -> Result<(), String> {
println!("Executing function {}", "c45_l360_action_invoke");
let result = instance.call("as-call-everywhere", &[Value::I32(2 as i32), Value::I32(1 as i32), Value::I32(5 as i32)]);
assert_eq!(result, Ok(Some(Value::I32(-2 as i32))));
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("as-unary-first", &[Value::I32(30 as i32)]);
assert_eq!(result, Ok(Some(Value::I32(1 as i32))));
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("as-unary-last", &[Value::I32(30 as i32)]);
assert_eq!(result, Ok(Some(Value::I32(1 as i32))));
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("as-unary-everywhere", &[Value::I32(12 as i32)]);
assert_eq!(result, Ok(Some(Value::I32(2 as i32))));
result.map(|_| ())
}
// Line 366
fn c49_l366_action_invoke(instance: &mut Instance) -> Result<(), String> {
println!("Executing function {}", "c49_l366_action_invoke");
let result = instance.call("as-binary-first", &[Value::I32(3 as i32)]);
assert_eq!(result, Ok(Some(Value::I32(6 as i32))));
result.map(|_| ())
}
// Line 367
fn c50_l367_action_invoke(instance: &mut Instance) -> Result<(), String> {
println!("Executing function {}", "c50_l367_action_invoke");
let result = instance.call("as-binary-mid", &[Value::I32(3 as i32)]);
assert_eq!(result, Ok(Some(Value::I32(6 as i32))));
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("as-binary-last", &[Value::I32(3 as i32)]);
assert_eq!(result, Ok(Some(Value::I32(6 as i32))));
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("as-binary-everywhere", &[Value::I32(3 as i32)]);
assert_eq!(result, Ok(Some(Value::I32(6 as i32))));
result.map(|_| ())
}
// Line 371
fn c53_l371_action_invoke(instance: &mut Instance) -> Result<(), String> {
println!("Executing function {}", "c53_l371_action_invoke");
let result = instance.call("as-test-first", &[Value::I32(0 as i32)]);
assert_eq!(result, Ok(Some(Value::I32(1 as i32))));
result.map(|_| ())
}
// Line 372
fn c54_l372_action_invoke(instance: &mut Instance) -> Result<(), String> {
println!("Executing function {}", "c54_l372_action_invoke");
let result = instance.call("as-test-last", &[Value::I32(0 as i32)]);
assert_eq!(result, Ok(Some(Value::I32(1 as i32))));
result.map(|_| ())
}
// Line 373
fn c55_l373_action_invoke(instance: &mut Instance) -> Result<(), String> {
println!("Executing function {}", "c55_l373_action_invoke");
let result = instance.call("as-test-everywhere", &[Value::I32(0 as i32)]);
assert_eq!(result, Ok(Some(Value::I32(1 as i32))));
result.map(|_| ())
}
// Line 375
fn c56_l375_action_invoke(instance: &mut Instance) -> Result<(), String> {
println!("Executing function {}", "c56_l375_action_invoke");
let result = instance.call("as-compare-first", &[Value::I32(3 as i32)]);
assert_eq!(result, Ok(Some(Value::I32(0 as i32))));
result.map(|_| ())
}
// Line 376
fn c57_l376_action_invoke(instance: &mut Instance) -> Result<(), String> {
println!("Executing function {}", "c57_l376_action_invoke");
let result = instance.call("as-compare-mid", &[Value::I32(3 as i32)]);
assert_eq!(result, Ok(Some(Value::I32(0 as i32))));
result.map(|_| ())
}
// Line 377
fn c58_l377_action_invoke(instance: &mut Instance) -> Result<(), String> {
println!("Executing function {}", "c58_l377_action_invoke");
let result = instance.call("as-compare-last", &[Value::I32(3 as i32)]);
assert_eq!(result, Ok(Some(Value::I32(0 as i32))));
result.map(|_| ())
}
// Line 378
fn c59_l378_action_invoke(instance: &mut Instance) -> Result<(), String> {
println!("Executing function {}", "c59_l378_action_invoke");
let result = instance.call("as-compare-everywhere", &[Value::I32(3 as i32)]);
assert_eq!(result, Ok(Some(Value::I32(1 as i32))));
result.map(|_| ())
}
// Line 380
fn c60_l380_action_invoke(instance: &mut Instance) -> Result<(), String> {
println!("Executing function {}", "c60_l380_action_invoke");
let result = instance.call("as-memory.grow-first", &[Value::I32(0 as i32)]);
assert_eq!(result, Ok(Some(Value::I32(1 as i32))));
result.map(|_| ())
}
// Line 381
fn c61_l381_action_invoke(instance: &mut Instance) -> Result<(), String> {
println!("Executing function {}", "c61_l381_action_invoke");
let result = instance.call("as-memory.grow-last", &[Value::I32(2 as i32)]);
assert_eq!(result, Ok(Some(Value::I32(1 as i32))));
result.map(|_| ())
}
// Line 382
fn c62_l382_action_invoke(instance: &mut Instance) -> Result<(), String> {
println!("Executing function {}", "c62_l382_action_invoke");
let result = instance.call("as-memory.grow-everywhere", &[Value::I32(12 as i32)]);
assert_eq!(result, Ok(Some(Value::I32(3 as i32))));
result.map(|_| ())
}
// Line 384
fn c63_l384_action_invoke(instance: &mut Instance) -> Result<(), String> {
println!("Executing function {}", "c63_l384_action_invoke");
let result = instance.call("as-call_indirect-first", &[]);
assert_eq!(result, Ok(Some(Value::I32(1 as i32))));
result.map(|_| ())
}
// Line 385
fn c64_l385_action_invoke(instance: &mut Instance) -> Result<(), String> {
println!("Executing function {}", "c64_l385_action_invoke");
let result = instance.call("as-call_indirect-mid1", &[]);
assert_eq!(result, Ok(Some(Value::I32(1 as i32))));
result.map(|_| ())
}
// Line 386
fn c65_l386_action_invoke(instance: &mut Instance) -> Result<(), String> {
println!("Executing function {}", "c65_l386_action_invoke");
let result = instance.call("as-call_indirect-mid2", &[]);
assert_eq!(result, Ok(Some(Value::I32(1 as i32))));
result.map(|_| ())
}
// Line 387
fn c66_l387_action_invoke(instance: &mut Instance) -> Result<(), String> {
println!("Executing function {}", "c66_l387_action_invoke");
let result = instance.call("as-call_indirect-last", &[]);
assert_eq!(result, Ok(Some(Value::I32(1 as i32))));
result.map(|_| ())
}
// Line 388
fn c67_l388_action_invoke(instance: &mut Instance) -> Result<(), String> {
println!("Executing function {}", "c67_l388_action_invoke");
let result = instance.call("as-call_indirect-everywhere", &[]);
assert_eq!(result, Ok(Some(Value::I32(1 as i32))));
result.map(|_| ())
}
// Line 390
fn c68_l390_action_invoke(instance: &mut Instance) -> Result<(), String> {
println!("Executing function {}", "c68_l390_action_invoke");
let result = instance.call("as-set_local-first", &[Value::I32(1 as i32)]);
assert_eq!(result, Ok(Some(Value::I32(2 as i32))));
result.map(|_| ())
}
// Line 391
fn c69_l391_action_invoke(instance: &mut Instance) -> Result<(), String> {
println!("Executing function {}", "c69_l391_action_invoke");
let result = instance.call("as-set_local-last", &[Value::I32(1 as i32)]);
assert_eq!(result, Ok(Some(Value::I32(2 as i32))));
result.map(|_| ())
}
// Line 392
fn c70_l392_action_invoke(instance: &mut Instance) -> Result<(), String> {
println!("Executing function {}", "c70_l392_action_invoke");
let result = instance.call("as-set_local-everywhere", &[Value::I32(1 as i32)]);
assert_eq!(result, Ok(Some(Value::I32(2 as i32))));
result.map(|_| ())
}
// Line 394
fn c71_l394_action_invoke(instance: &mut Instance) -> Result<(), String> {
println!("Executing function {}", "c71_l394_action_invoke");
let result = instance.call("as-tee_local-first", &[Value::I32(1 as i32)]);
assert_eq!(result, Ok(Some(Value::I32(2 as i32))));
result.map(|_| ())
}
// Line 395
fn c72_l395_action_invoke(instance: &mut Instance) -> Result<(), String> {
println!("Executing function {}", "c72_l395_action_invoke");
let result = instance.call("as-tee_local-last", &[Value::I32(1 as i32)]);
assert_eq!(result, Ok(Some(Value::I32(2 as i32))));
result.map(|_| ())
}
// Line 396
fn c73_l396_action_invoke(instance: &mut Instance) -> Result<(), String> {
println!("Executing function {}", "c73_l396_action_invoke");
let result = instance.call("as-tee_local-everywhere", &[Value::I32(1 as i32)]);
assert_eq!(result, Ok(Some(Value::I32(2 as i32))));
result.map(|_| ())
}
// Line 398
fn c74_l398_action_invoke(instance: &mut Instance) -> Result<(), String> {
println!("Executing function {}", "c74_l398_action_invoke");
let result = instance.call("as-set_global-first", &[]);
assert_eq!(result, Ok(Some(Value::I32(2 as i32))));
result.map(|_| ())
}
// Line 399
fn c75_l399_action_invoke(instance: &mut Instance) -> Result<(), String> {
println!("Executing function {}", "c75_l399_action_invoke");
let result = instance.call("as-set_global-last", &[]);
assert_eq!(result, Ok(Some(Value::I32(2 as i32))));
result.map(|_| ())
}
// Line 400
fn c76_l400_action_invoke(instance: &mut Instance) -> Result<(), String> {
println!("Executing function {}", "c76_l400_action_invoke");
let result = instance.call("as-set_global-everywhere", &[]);
assert_eq!(result, Ok(Some(Value::I32(2 as i32))));
result.map(|_| ())
}
// Line 402
fn c77_l402_action_invoke(instance: &mut Instance) -> Result<(), String> {
println!("Executing function {}", "c77_l402_action_invoke");
let result = instance.call("as-load-first", &[Value::I32(100 as i32)]);
assert_eq!(result, Ok(Some(Value::I32(0 as i32))));
result.map(|_| ())
}
// Line 403
fn c78_l403_action_invoke(instance: &mut Instance) -> Result<(), String> {
println!("Executing function {}", "c78_l403_action_invoke");
let result = instance.call("as-load-last", &[Value::I32(100 as i32)]);
assert_eq!(result, Ok(Some(Value::I32(0 as i32))));
result.map(|_| ())
}
// Line 404
fn c79_l404_action_invoke(instance: &mut Instance) -> Result<(), String> {
println!("Executing function {}", "c79_l404_action_invoke");
let result = instance.call("as-load-everywhere", &[Value::I32(100 as i32)]);
assert_eq!(result, Ok(Some(Value::I32(0 as i32))));
result.map(|_| ())
}
// Line 406
fn c80_l406_action_invoke(instance: &mut Instance) -> Result<(), String> {
println!("Executing function {}", "c80_l406_action_invoke");
let result = instance.call("as-store-first", &[Value::I32(0 as i32), Value::I32(1 as i32)]);
assert_eq!(result, Ok(None));
result.map(|_| ())
}
// Line 407
fn c81_l407_action_invoke(instance: &mut Instance) -> Result<(), String> {
println!("Executing function {}", "c81_l407_action_invoke");
let result = instance.call("as-store-mid", &[Value::I32(0 as i32), Value::I32(2 as i32)]);
assert_eq!(result, Ok(None));
result.map(|_| ())
}
// Line 408
fn c82_l408_action_invoke(instance: &mut Instance) -> Result<(), String> {
println!("Executing function {}", "c82_l408_action_invoke");
let result = instance.call("as-store-last", &[Value::I32(0 as i32), Value::I32(3 as i32)]);
assert_eq!(result, Ok(None));
result.map(|_| ())
}
// Line 409
fn c83_l409_action_invoke(instance: &mut Instance) -> Result<(), String> {
println!("Executing function {}", "c83_l409_action_invoke");
let result = instance.call("as-store-everywhere", &[Value::I32(0 as i32), Value::I32(4 as i32)]);
assert_eq!(result, Ok(None));
result.map(|_| ())
}
// Line 412
#[test]
fn c84_l412_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, 5, 1, 3, 0, 1, 11];
let module = wasmer_runtime::compile(&wasm_binary, &CraneliftCompiler::new());
assert!(module.is_err(), "WASM should not compile as is invalid");
}
// Line 416
#[test]
fn c85_l416_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, 5, 1, 3, 0, 1, 11];
let module = wasmer_runtime::compile(&wasm_binary, &CraneliftCompiler::new());
assert!(module.is_err(), "WASM should not compile as is invalid");
}
// Line 420
#[test]
fn c86_l420_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, 5, 1, 3, 0, 1, 11];
let module = wasmer_runtime::compile(&wasm_binary, &CraneliftCompiler::new());
assert!(module.is_err(), "WASM should not compile as is invalid");
}
// Line 424
#[test]
fn c87_l424_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, 5, 1, 3, 0, 1, 11];
let module = wasmer_runtime::compile(&wasm_binary, &CraneliftCompiler::new());
assert!(module.is_err(), "WASM should not compile as is invalid");
}
#[test]
fn test_module_1() {
let mut instance = create_module_1();
// We group the calls together
start_module_1(&mut instance);
c1_l306_action_invoke(&mut instance);
c2_l307_action_invoke(&mut instance);
c3_l308_action_invoke(&mut instance);
c4_l309_action_invoke(&mut instance);
c5_l311_action_invoke(&mut instance);
c6_l312_action_invoke(&mut instance);
c7_l313_action_invoke(&mut instance);
c8_l315_action_invoke(&mut instance);
c9_l316_action_invoke(&mut instance);
c10_l317_action_invoke(&mut instance);
c11_l318_action_invoke(&mut instance);
c12_l319_action_invoke(&mut instance);
c13_l321_action_invoke(&mut instance);
c14_l322_action_invoke(&mut instance);
c15_l323_action_invoke(&mut instance);
c16_l324_action_invoke(&mut instance);
c17_l326_action_invoke(&mut instance);
c18_l327_action_invoke(&mut instance);
c19_l328_action_invoke(&mut instance);
c20_l329_action_invoke(&mut instance);
c21_l331_action_invoke(&mut instance);
c22_l332_action_invoke(&mut instance);
c23_l333_action_invoke(&mut instance);
c24_l334_action_invoke(&mut instance);
c25_l335_action_invoke(&mut instance);
c26_l336_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_l353_action_invoke(&mut instance);
c40_l354_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_l360_action_invoke(&mut instance);
c46_l362_action_invoke(&mut instance);
c47_l363_action_invoke(&mut instance);
c48_l364_action_invoke(&mut instance);
c49_l366_action_invoke(&mut instance);
c50_l367_action_invoke(&mut instance);
c51_l368_action_invoke(&mut instance);
c52_l369_action_invoke(&mut instance);
c53_l371_action_invoke(&mut instance);
c54_l372_action_invoke(&mut instance);
c55_l373_action_invoke(&mut instance);
c56_l375_action_invoke(&mut instance);
c57_l376_action_invoke(&mut instance);
c58_l377_action_invoke(&mut instance);
c59_l378_action_invoke(&mut instance);
c60_l380_action_invoke(&mut instance);
c61_l381_action_invoke(&mut instance);
c62_l382_action_invoke(&mut instance);
c63_l384_action_invoke(&mut instance);
c64_l385_action_invoke(&mut instance);
c65_l386_action_invoke(&mut instance);
c66_l387_action_invoke(&mut instance);
c67_l388_action_invoke(&mut instance);
c68_l390_action_invoke(&mut instance);
c69_l391_action_invoke(&mut instance);
c70_l392_action_invoke(&mut instance);
c71_l394_action_invoke(&mut instance);
c72_l395_action_invoke(&mut instance);
c73_l396_action_invoke(&mut instance);
c74_l398_action_invoke(&mut instance);
c75_l399_action_invoke(&mut instance);
c76_l400_action_invoke(&mut instance);
c77_l402_action_invoke(&mut instance);
c78_l403_action_invoke(&mut instance);
c79_l404_action_invoke(&mut instance);
c80_l406_action_invoke(&mut instance);
c81_l407_action_invoke(&mut instance);
c82_l408_action_invoke(&mut instance);
c83_l409_action_invoke(&mut instance);
}