mirror of
https://github.com/fluencelabs/wasmer
synced 2024-12-14 14:45:40 +00:00
12337 lines
578 KiB
Rust
12337 lines
578 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/float_exprs.wast
|
||
|
#![allow(
|
||
|
warnings,
|
||
|
dead_code
|
||
|
)]
|
||
|
use wabt::wat2wasm;
|
||
|
use std::{f32, f64};
|
||
|
|
||
|
use wasmer_runtime::types::Value;
|
||
|
use wasmer_runtime::{Instance, Module};
|
||
|
use wasmer_clif_backend::CraneliftCompiler;
|
||
|
|
||
|
use crate::spectests::_common::{
|
||
|
spectest_importobject,
|
||
|
NaNCheck,
|
||
|
};
|
||
|
|
||
|
|
||
|
// Line 6
|
||
|
fn create_module_1() -> Box<Instance> {
|
||
|
let module_str = "(module
|
||
|
(type (;0;) (func (param f64 f64 f64) (result f64)))
|
||
|
(func (;0;) (type 0) (param f64 f64 f64) (result f64)
|
||
|
get_local 0
|
||
|
get_local 1
|
||
|
f64.mul
|
||
|
get_local 2
|
||
|
f64.add)
|
||
|
(export \"f64.no_contraction\" (func 0)))
|
||
|
";
|
||
|
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 11
|
||
|
fn c1_l11_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c1_l11_action_invoke");
|
||
|
let result = instance.call("f64.no_contraction", &[Value::F64((-0.00000000000000000000000000000015967133604096234f64).to_bits()), Value::F64((87633521608271230000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.0f64).to_bits()), Value::F64((42896576204898460000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.0f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((-13992561434270632000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.0f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 12
|
||
|
fn c2_l12_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c2_l12_action_invoke");
|
||
|
let result = instance.call("f64.no_contraction", &[Value::F64((8341016642481988.0f64).to_bits()), Value::F64((0.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003223424965918293f64).to_bits()), Value::F64((0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000023310835741659086f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((0.0000000000000000000000000000000000000000000000000000000000000000000000000000000026886641288847496f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 13
|
||
|
fn c3_l13_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c3_l13_action_invoke");
|
||
|
let result = instance.call("f64.no_contraction", &[Value::F64((-0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000030119045290520013f64).to_bits()), Value::F64((52699336439236750000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.0f64).to_bits()), Value::F64((0.00000000000000000000000000000006654454781339856f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((-0.0000000000000000015872537009936566f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 14
|
||
|
fn c4_l14_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c4_l14_action_invoke");
|
||
|
let result = instance.call("f64.no_contraction", &[Value::F64((0.0000000000000000000031413936116780743f64).to_bits()), Value::F64((-0.0000000000000000000000000000007262766035707377f64).to_bits()), Value::F64((0.000000000000000000000000000000000000000000000000000000000000000004619684894228461f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((-0.00000000000000000000000000000000000000000000000000228152068276836f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 15
|
||
|
fn c5_l15_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c5_l15_action_invoke");
|
||
|
let result = instance.call("f64.no_contraction", &[Value::F64((-0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000016080464217402378f64).to_bits()), Value::F64((-382103410226833000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.0f64).to_bits()), Value::F64((0.00000000000000010541980504151345f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((0.00006144400215510552f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 19
|
||
|
|
||
|
#[test]
|
||
|
fn test_module_1() {
|
||
|
let mut instance = create_module_1();
|
||
|
// We group the calls together
|
||
|
start_module_1(&mut instance);
|
||
|
c1_l11_action_invoke(&mut instance);
|
||
|
c2_l12_action_invoke(&mut instance);
|
||
|
c3_l13_action_invoke(&mut instance);
|
||
|
c4_l14_action_invoke(&mut instance);
|
||
|
c5_l15_action_invoke(&mut instance);
|
||
|
}
|
||
|
fn create_module_2() -> Box<Instance> {
|
||
|
let module_str = "(module
|
||
|
(type (;0;) (func (param f32 f32 f32) (result f32)))
|
||
|
(type (;1;) (func (param f64 f64 f64) (result f64)))
|
||
|
(func (;0;) (type 0) (param f32 f32 f32) (result f32)
|
||
|
get_local 0
|
||
|
get_local 1
|
||
|
f32.mul
|
||
|
get_local 2
|
||
|
f32.add)
|
||
|
(func (;1;) (type 1) (param f64 f64 f64) (result f64)
|
||
|
get_local 0
|
||
|
get_local 1
|
||
|
f64.mul
|
||
|
get_local 2
|
||
|
f64.add)
|
||
|
(export \"f32.no_fma\" (func 0))
|
||
|
(export \"f64.no_fma\" (func 1)))
|
||
|
";
|
||
|
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_2(instance: &mut Instance) {
|
||
|
// TODO Review is explicit start needed? Start now called in runtime::Instance::new()
|
||
|
//instance.start();
|
||
|
}
|
||
|
|
||
|
// Line 26
|
||
|
fn c7_l26_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c7_l26_action_invoke");
|
||
|
let result = instance.call("f32.no_fma", &[Value::F32((35184304000000000000000000000000000000.0f32).to_bits()), Value::F32((0.00000021584361f32).to_bits()), Value::F32((259340640000000000000000000000000.0f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((266934960000000000000000000000000.0f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 27
|
||
|
fn c8_l27_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c8_l27_action_invoke");
|
||
|
let result = instance.call("f32.no_fma", &[Value::F32((0.0000000071753243f32).to_bits()), Value::F32((-0.000000000000001225534f32).to_bits()), Value::F32((0.0000000000000000000000000041316436f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((-0.0000000000000000000000087894724f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 28
|
||
|
fn c9_l28_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c9_l28_action_invoke");
|
||
|
let result = instance.call("f32.no_fma", &[Value::F32((231063440000.0f32).to_bits()), Value::F32((0.00020773262f32).to_bits()), Value::F32((1797.6421f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((48001210.0f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 29
|
||
|
fn c10_l29_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c10_l29_action_invoke");
|
||
|
let result = instance.call("f32.no_fma", &[Value::F32((0.0045542703f32).to_bits()), Value::F32((-7265493.5f32).to_bits()), Value::F32((-2.3964283f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((-33091.414f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 30
|
||
|
fn c11_l30_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c11_l30_action_invoke");
|
||
|
let result = instance.call("f32.no_fma", &[Value::F32((98881730000000000000000000000000000000.0f32).to_bits()), Value::F32((-0.0000000000000000000008570631f32).to_bits()), Value::F32((-21579143000.0f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((-84747910000000000.0f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 31
|
||
|
fn c12_l31_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c12_l31_action_invoke");
|
||
|
let result = instance.call("f64.no_fma", &[Value::F64((789084284375179200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.0f64).to_bits()), Value::F64((4215020052117360000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.0f64).to_bits()), Value::F64((-1336601081131744700000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.0f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((1989405000320312800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.0f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 32
|
||
|
fn c13_l32_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c13_l32_action_invoke");
|
||
|
let result = instance.call("f64.no_fma", &[Value::F64((5586822348009285500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.0f64).to_bits()), Value::F64((0.0000000000000000000000000000000000000007397302005677334f64).to_bits()), Value::F64((36567834172040920000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.0f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((4132741216029240700000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.0f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 33
|
||
|
fn c14_l33_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c14_l33_action_invoke");
|
||
|
let result = instance.call("f64.no_fma", &[Value::F64((0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000014260477822274587f64).to_bits()), Value::F64((-31087632036599860000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.0f64).to_bits()), Value::F64((343269235523777630000000000000000000000000000000000000000000000000000000.0f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((-4433244872049653000000000000000000000000000000000000000000000000000000000000000000000000.0f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 34
|
||
|
fn c15_l34_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c15_l34_action_invoke");
|
||
|
let result = instance.call("f64.no_fma", &[Value::F64((-0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000809034701735478f64).to_bits()), Value::F64((-24874417850667450000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.0f64).to_bits()), Value::F64((49484765138510810.0f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((250727437405094720.0f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 35
|
||
|
fn c16_l35_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c16_l35_action_invoke");
|
||
|
let result = instance.call("f64.no_fma", &[Value::F64((6723256985364377.0f64).to_bits()), Value::F64((285456566692879460000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.0f64).to_bits()), Value::F64((-5593839470050757000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.0f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((1919197856036028600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.0f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 40
|
||
|
|
||
|
#[test]
|
||
|
fn test_module_2() {
|
||
|
let mut instance = create_module_2();
|
||
|
// We group the calls together
|
||
|
start_module_2(&mut instance);
|
||
|
c7_l26_action_invoke(&mut instance);
|
||
|
c8_l27_action_invoke(&mut instance);
|
||
|
c9_l28_action_invoke(&mut instance);
|
||
|
c10_l29_action_invoke(&mut instance);
|
||
|
c11_l30_action_invoke(&mut instance);
|
||
|
c12_l31_action_invoke(&mut instance);
|
||
|
c13_l32_action_invoke(&mut instance);
|
||
|
c14_l33_action_invoke(&mut instance);
|
||
|
c15_l34_action_invoke(&mut instance);
|
||
|
c16_l35_action_invoke(&mut instance);
|
||
|
}
|
||
|
fn create_module_3() -> Box<Instance> {
|
||
|
let module_str = "(module
|
||
|
(type (;0;) (func (param f32) (result f32)))
|
||
|
(type (;1;) (func (param f64) (result f64)))
|
||
|
(func (;0;) (type 0) (param f32) (result f32)
|
||
|
get_local 0
|
||
|
f32.const 0x0p+0 (;=0;)
|
||
|
f32.add)
|
||
|
(func (;1;) (type 1) (param f64) (result f64)
|
||
|
get_local 0
|
||
|
f64.const 0x0p+0 (;=0;)
|
||
|
f64.add)
|
||
|
(export \"f32.no_fold_add_zero\" (func 0))
|
||
|
(export \"f64.no_fold_add_zero\" (func 1)))
|
||
|
";
|
||
|
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_3(instance: &mut Instance) {
|
||
|
// TODO Review is explicit start needed? Start now called in runtime::Instance::new()
|
||
|
//instance.start();
|
||
|
}
|
||
|
|
||
|
// Line 47
|
||
|
fn c18_l47_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c18_l47_action_invoke");
|
||
|
let result = instance.call("f32.no_fold_add_zero", &[Value::F32((-0.0f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((0.0f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 48
|
||
|
fn c19_l48_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c19_l48_action_invoke");
|
||
|
let result = instance.call("f64.no_fold_add_zero", &[Value::F64((-0.0f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((0.0f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 49
|
||
|
fn c20_l49_assert_return_arithmetic_nan(instance: &mut Instance) {
|
||
|
println!("Executing function {}", "c20_l49_assert_return_arithmetic_nan");
|
||
|
let result = instance.call("f32.no_fold_add_zero", &[Value::F32(f32::from_bits(2141192192) as u32)]).unwrap().expect("Missing result in c20_l49_assert_return_arithmetic_nan");
|
||
|
assert!(match result {
|
||
|
Value::F32(fp) => f32::from_bits(fp).is_quiet_nan(),
|
||
|
Value::F64(fp) => f64::from_bits(fp).is_quiet_nan(),
|
||
|
_ => unimplemented!()
|
||
|
})
|
||
|
}
|
||
|
|
||
|
// Line 50
|
||
|
fn c21_l50_assert_return_arithmetic_nan(instance: &mut Instance) {
|
||
|
println!("Executing function {}", "c21_l50_assert_return_arithmetic_nan");
|
||
|
let result = instance.call("f64.no_fold_add_zero", &[Value::F64(f64::from_bits(9219994337134247936) as u64)]).unwrap().expect("Missing result in c21_l50_assert_return_arithmetic_nan");
|
||
|
assert!(match result {
|
||
|
Value::F32(fp) => f32::from_bits(fp).is_quiet_nan(),
|
||
|
Value::F64(fp) => f64::from_bits(fp).is_quiet_nan(),
|
||
|
_ => unimplemented!()
|
||
|
})
|
||
|
}
|
||
|
|
||
|
// Line 54
|
||
|
|
||
|
#[test]
|
||
|
fn test_module_3() {
|
||
|
let mut instance = create_module_3();
|
||
|
// We group the calls together
|
||
|
start_module_3(&mut instance);
|
||
|
c18_l47_action_invoke(&mut instance);
|
||
|
c19_l48_action_invoke(&mut instance);
|
||
|
c20_l49_assert_return_arithmetic_nan(&mut instance);
|
||
|
c21_l50_assert_return_arithmetic_nan(&mut instance);
|
||
|
}
|
||
|
fn create_module_4() -> Box<Instance> {
|
||
|
let module_str = "(module
|
||
|
(type (;0;) (func (param f32) (result f32)))
|
||
|
(type (;1;) (func (param f64) (result f64)))
|
||
|
(func (;0;) (type 0) (param f32) (result f32)
|
||
|
f32.const 0x0p+0 (;=0;)
|
||
|
get_local 0
|
||
|
f32.sub)
|
||
|
(func (;1;) (type 1) (param f64) (result f64)
|
||
|
f64.const 0x0p+0 (;=0;)
|
||
|
get_local 0
|
||
|
f64.sub)
|
||
|
(export \"f32.no_fold_zero_sub\" (func 0))
|
||
|
(export \"f64.no_fold_zero_sub\" (func 1)))
|
||
|
";
|
||
|
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_4(instance: &mut Instance) {
|
||
|
// TODO Review is explicit start needed? Start now called in runtime::Instance::new()
|
||
|
//instance.start();
|
||
|
}
|
||
|
|
||
|
// Line 61
|
||
|
fn c23_l61_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c23_l61_action_invoke");
|
||
|
let result = instance.call("f32.no_fold_zero_sub", &[Value::F32((0.0f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((0.0f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 62
|
||
|
fn c24_l62_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c24_l62_action_invoke");
|
||
|
let result = instance.call("f64.no_fold_zero_sub", &[Value::F64((0.0f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((0.0f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 63
|
||
|
fn c25_l63_assert_return_arithmetic_nan(instance: &mut Instance) {
|
||
|
println!("Executing function {}", "c25_l63_assert_return_arithmetic_nan");
|
||
|
let result = instance.call("f32.no_fold_zero_sub", &[Value::F32(f32::from_bits(2141192192) as u32)]).unwrap().expect("Missing result in c25_l63_assert_return_arithmetic_nan");
|
||
|
assert!(match result {
|
||
|
Value::F32(fp) => f32::from_bits(fp).is_quiet_nan(),
|
||
|
Value::F64(fp) => f64::from_bits(fp).is_quiet_nan(),
|
||
|
_ => unimplemented!()
|
||
|
})
|
||
|
}
|
||
|
|
||
|
// Line 64
|
||
|
fn c26_l64_assert_return_arithmetic_nan(instance: &mut Instance) {
|
||
|
println!("Executing function {}", "c26_l64_assert_return_arithmetic_nan");
|
||
|
let result = instance.call("f64.no_fold_zero_sub", &[Value::F64(f64::from_bits(9219994337134247936) as u64)]).unwrap().expect("Missing result in c26_l64_assert_return_arithmetic_nan");
|
||
|
assert!(match result {
|
||
|
Value::F32(fp) => f32::from_bits(fp).is_quiet_nan(),
|
||
|
Value::F64(fp) => f64::from_bits(fp).is_quiet_nan(),
|
||
|
_ => unimplemented!()
|
||
|
})
|
||
|
}
|
||
|
|
||
|
// Line 68
|
||
|
|
||
|
#[test]
|
||
|
fn test_module_4() {
|
||
|
let mut instance = create_module_4();
|
||
|
// We group the calls together
|
||
|
start_module_4(&mut instance);
|
||
|
c23_l61_action_invoke(&mut instance);
|
||
|
c24_l62_action_invoke(&mut instance);
|
||
|
c25_l63_assert_return_arithmetic_nan(&mut instance);
|
||
|
c26_l64_assert_return_arithmetic_nan(&mut instance);
|
||
|
}
|
||
|
fn create_module_5() -> Box<Instance> {
|
||
|
let module_str = "(module
|
||
|
(type (;0;) (func (param f32) (result f32)))
|
||
|
(type (;1;) (func (param f64) (result f64)))
|
||
|
(func (;0;) (type 0) (param f32) (result f32)
|
||
|
get_local 0
|
||
|
f32.const 0x0p+0 (;=0;)
|
||
|
f32.sub)
|
||
|
(func (;1;) (type 1) (param f64) (result f64)
|
||
|
get_local 0
|
||
|
f64.const 0x0p+0 (;=0;)
|
||
|
f64.sub)
|
||
|
(export \"f32.no_fold_sub_zero\" (func 0))
|
||
|
(export \"f64.no_fold_sub_zero\" (func 1)))
|
||
|
";
|
||
|
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_5(instance: &mut Instance) {
|
||
|
// TODO Review is explicit start needed? Start now called in runtime::Instance::new()
|
||
|
//instance.start();
|
||
|
}
|
||
|
|
||
|
// Line 75
|
||
|
fn c28_l75_assert_return_arithmetic_nan(instance: &mut Instance) {
|
||
|
println!("Executing function {}", "c28_l75_assert_return_arithmetic_nan");
|
||
|
let result = instance.call("f32.no_fold_sub_zero", &[Value::F32(f32::from_bits(2141192192) as u32)]).unwrap().expect("Missing result in c28_l75_assert_return_arithmetic_nan");
|
||
|
assert!(match result {
|
||
|
Value::F32(fp) => f32::from_bits(fp).is_quiet_nan(),
|
||
|
Value::F64(fp) => f64::from_bits(fp).is_quiet_nan(),
|
||
|
_ => unimplemented!()
|
||
|
})
|
||
|
}
|
||
|
|
||
|
// Line 76
|
||
|
fn c29_l76_assert_return_arithmetic_nan(instance: &mut Instance) {
|
||
|
println!("Executing function {}", "c29_l76_assert_return_arithmetic_nan");
|
||
|
let result = instance.call("f64.no_fold_sub_zero", &[Value::F64(f64::from_bits(9219994337134247936) as u64)]).unwrap().expect("Missing result in c29_l76_assert_return_arithmetic_nan");
|
||
|
assert!(match result {
|
||
|
Value::F32(fp) => f32::from_bits(fp).is_quiet_nan(),
|
||
|
Value::F64(fp) => f64::from_bits(fp).is_quiet_nan(),
|
||
|
_ => unimplemented!()
|
||
|
})
|
||
|
}
|
||
|
|
||
|
// Line 80
|
||
|
|
||
|
#[test]
|
||
|
fn test_module_5() {
|
||
|
let mut instance = create_module_5();
|
||
|
// We group the calls together
|
||
|
start_module_5(&mut instance);
|
||
|
c28_l75_assert_return_arithmetic_nan(&mut instance);
|
||
|
c29_l76_assert_return_arithmetic_nan(&mut instance);
|
||
|
}
|
||
|
fn create_module_6() -> Box<Instance> {
|
||
|
let module_str = "(module
|
||
|
(type (;0;) (func (param f32) (result f32)))
|
||
|
(type (;1;) (func (param f64) (result f64)))
|
||
|
(func (;0;) (type 0) (param f32) (result f32)
|
||
|
get_local 0
|
||
|
f32.const 0x0p+0 (;=0;)
|
||
|
f32.mul)
|
||
|
(func (;1;) (type 1) (param f64) (result f64)
|
||
|
get_local 0
|
||
|
f64.const 0x0p+0 (;=0;)
|
||
|
f64.mul)
|
||
|
(export \"f32.no_fold_mul_zero\" (func 0))
|
||
|
(export \"f64.no_fold_mul_zero\" (func 1)))
|
||
|
";
|
||
|
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_6(instance: &mut Instance) {
|
||
|
// TODO Review is explicit start needed? Start now called in runtime::Instance::new()
|
||
|
//instance.start();
|
||
|
}
|
||
|
|
||
|
// Line 87
|
||
|
fn c31_l87_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c31_l87_action_invoke");
|
||
|
let result = instance.call("f32.no_fold_mul_zero", &[Value::F32((-0.0f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((-0.0f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 88
|
||
|
fn c32_l88_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c32_l88_action_invoke");
|
||
|
let result = instance.call("f32.no_fold_mul_zero", &[Value::F32((-1.0f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((-0.0f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 89
|
||
|
fn c33_l89_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c33_l89_action_invoke");
|
||
|
let result = instance.call("f32.no_fold_mul_zero", &[Value::F32((-2.0f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((-0.0f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 90
|
||
|
fn c34_l90_assert_return_arithmetic_nan(instance: &mut Instance) {
|
||
|
println!("Executing function {}", "c34_l90_assert_return_arithmetic_nan");
|
||
|
let result = instance.call("f32.no_fold_mul_zero", &[Value::F32(f32::from_bits(2141192192) as u32)]).unwrap().expect("Missing result in c34_l90_assert_return_arithmetic_nan");
|
||
|
assert!(match result {
|
||
|
Value::F32(fp) => f32::from_bits(fp).is_quiet_nan(),
|
||
|
Value::F64(fp) => f64::from_bits(fp).is_quiet_nan(),
|
||
|
_ => unimplemented!()
|
||
|
})
|
||
|
}
|
||
|
|
||
|
// Line 91
|
||
|
fn c35_l91_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c35_l91_action_invoke");
|
||
|
let result = instance.call("f64.no_fold_mul_zero", &[Value::F64((-0.0f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((-0.0f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 92
|
||
|
fn c36_l92_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c36_l92_action_invoke");
|
||
|
let result = instance.call("f64.no_fold_mul_zero", &[Value::F64((-1.0f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((-0.0f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 93
|
||
|
fn c37_l93_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c37_l93_action_invoke");
|
||
|
let result = instance.call("f64.no_fold_mul_zero", &[Value::F64((-2.0f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((-0.0f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 94
|
||
|
fn c38_l94_assert_return_arithmetic_nan(instance: &mut Instance) {
|
||
|
println!("Executing function {}", "c38_l94_assert_return_arithmetic_nan");
|
||
|
let result = instance.call("f64.no_fold_mul_zero", &[Value::F64(f64::from_bits(9219994337134247936) as u64)]).unwrap().expect("Missing result in c38_l94_assert_return_arithmetic_nan");
|
||
|
assert!(match result {
|
||
|
Value::F32(fp) => f32::from_bits(fp).is_quiet_nan(),
|
||
|
Value::F64(fp) => f64::from_bits(fp).is_quiet_nan(),
|
||
|
_ => unimplemented!()
|
||
|
})
|
||
|
}
|
||
|
|
||
|
// Line 99
|
||
|
|
||
|
#[test]
|
||
|
fn test_module_6() {
|
||
|
let mut instance = create_module_6();
|
||
|
// We group the calls together
|
||
|
start_module_6(&mut instance);
|
||
|
c31_l87_action_invoke(&mut instance);
|
||
|
c32_l88_action_invoke(&mut instance);
|
||
|
c33_l89_action_invoke(&mut instance);
|
||
|
c34_l90_assert_return_arithmetic_nan(&mut instance);
|
||
|
c35_l91_action_invoke(&mut instance);
|
||
|
c36_l92_action_invoke(&mut instance);
|
||
|
c37_l93_action_invoke(&mut instance);
|
||
|
c38_l94_assert_return_arithmetic_nan(&mut instance);
|
||
|
}
|
||
|
fn create_module_7() -> Box<Instance> {
|
||
|
let module_str = "(module
|
||
|
(type (;0;) (func (param f32) (result f32)))
|
||
|
(type (;1;) (func (param f64) (result f64)))
|
||
|
(func (;0;) (type 0) (param f32) (result f32)
|
||
|
get_local 0
|
||
|
f32.const 0x1p+0 (;=1;)
|
||
|
f32.mul)
|
||
|
(func (;1;) (type 1) (param f64) (result f64)
|
||
|
get_local 0
|
||
|
f64.const 0x1p+0 (;=1;)
|
||
|
f64.mul)
|
||
|
(export \"f32.no_fold_mul_one\" (func 0))
|
||
|
(export \"f64.no_fold_mul_one\" (func 1)))
|
||
|
";
|
||
|
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_7(instance: &mut Instance) {
|
||
|
// TODO Review is explicit start needed? Start now called in runtime::Instance::new()
|
||
|
//instance.start();
|
||
|
}
|
||
|
|
||
|
// Line 106
|
||
|
fn c40_l106_assert_return_arithmetic_nan(instance: &mut Instance) {
|
||
|
println!("Executing function {}", "c40_l106_assert_return_arithmetic_nan");
|
||
|
let result = instance.call("f32.no_fold_mul_one", &[Value::F32(f32::from_bits(2141192192) as u32)]).unwrap().expect("Missing result in c40_l106_assert_return_arithmetic_nan");
|
||
|
assert!(match result {
|
||
|
Value::F32(fp) => f32::from_bits(fp).is_quiet_nan(),
|
||
|
Value::F64(fp) => f64::from_bits(fp).is_quiet_nan(),
|
||
|
_ => unimplemented!()
|
||
|
})
|
||
|
}
|
||
|
|
||
|
// Line 107
|
||
|
fn c41_l107_assert_return_arithmetic_nan(instance: &mut Instance) {
|
||
|
println!("Executing function {}", "c41_l107_assert_return_arithmetic_nan");
|
||
|
let result = instance.call("f64.no_fold_mul_one", &[Value::F64(f64::from_bits(9219994337134247936) as u64)]).unwrap().expect("Missing result in c41_l107_assert_return_arithmetic_nan");
|
||
|
assert!(match result {
|
||
|
Value::F32(fp) => f32::from_bits(fp).is_quiet_nan(),
|
||
|
Value::F64(fp) => f64::from_bits(fp).is_quiet_nan(),
|
||
|
_ => unimplemented!()
|
||
|
})
|
||
|
}
|
||
|
|
||
|
// Line 111
|
||
|
|
||
|
#[test]
|
||
|
fn test_module_7() {
|
||
|
let mut instance = create_module_7();
|
||
|
// We group the calls together
|
||
|
start_module_7(&mut instance);
|
||
|
c40_l106_assert_return_arithmetic_nan(&mut instance);
|
||
|
c41_l107_assert_return_arithmetic_nan(&mut instance);
|
||
|
}
|
||
|
fn create_module_8() -> Box<Instance> {
|
||
|
let module_str = "(module
|
||
|
(type (;0;) (func (param f32) (result f32)))
|
||
|
(type (;1;) (func (param f64) (result f64)))
|
||
|
(func (;0;) (type 0) (param f32) (result f32)
|
||
|
f32.const 0x0p+0 (;=0;)
|
||
|
get_local 0
|
||
|
f32.div)
|
||
|
(func (;1;) (type 1) (param f64) (result f64)
|
||
|
f64.const 0x0p+0 (;=0;)
|
||
|
get_local 0
|
||
|
f64.div)
|
||
|
(export \"f32.no_fold_zero_div\" (func 0))
|
||
|
(export \"f64.no_fold_zero_div\" (func 1)))
|
||
|
";
|
||
|
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_8(instance: &mut Instance) {
|
||
|
// TODO Review is explicit start needed? Start now called in runtime::Instance::new()
|
||
|
//instance.start();
|
||
|
}
|
||
|
|
||
|
// Line 118
|
||
|
fn c43_l118_assert_return_canonical_nan(instance: &mut Instance) {
|
||
|
println!("Executing function {}", "c43_l118_assert_return_canonical_nan");
|
||
|
let result = instance.call("f32.no_fold_zero_div", &[Value::F32((0.0f32).to_bits())]).unwrap().expect("Missing result in c43_l118_assert_return_canonical_nan");
|
||
|
assert!(match result {
|
||
|
Value::F32(fp) => f32::from_bits(fp).is_quiet_nan(),
|
||
|
Value::F64(fp) => f64::from_bits(fp).is_quiet_nan(),
|
||
|
_ => unimplemented!()
|
||
|
})
|
||
|
}
|
||
|
|
||
|
// Line 119
|
||
|
fn c44_l119_assert_return_canonical_nan(instance: &mut Instance) {
|
||
|
println!("Executing function {}", "c44_l119_assert_return_canonical_nan");
|
||
|
let result = instance.call("f32.no_fold_zero_div", &[Value::F32((-0.0f32).to_bits())]).unwrap().expect("Missing result in c44_l119_assert_return_canonical_nan");
|
||
|
assert!(match result {
|
||
|
Value::F32(fp) => f32::from_bits(fp).is_quiet_nan(),
|
||
|
Value::F64(fp) => f64::from_bits(fp).is_quiet_nan(),
|
||
|
_ => unimplemented!()
|
||
|
})
|
||
|
}
|
||
|
|
||
|
// Line 120
|
||
|
fn c45_l120_assert_return_canonical_nan(instance: &mut Instance) {
|
||
|
println!("Executing function {}", "c45_l120_assert_return_canonical_nan");
|
||
|
let result = instance.call("f32.no_fold_zero_div", &[Value::F32(f32::from_bits(2143289344) as u32)]).unwrap().expect("Missing result in c45_l120_assert_return_canonical_nan");
|
||
|
assert!(match result {
|
||
|
Value::F32(fp) => f32::from_bits(fp).is_quiet_nan(),
|
||
|
Value::F64(fp) => f64::from_bits(fp).is_quiet_nan(),
|
||
|
_ => unimplemented!()
|
||
|
})
|
||
|
}
|
||
|
|
||
|
// Line 121
|
||
|
fn c46_l121_assert_return_arithmetic_nan(instance: &mut Instance) {
|
||
|
println!("Executing function {}", "c46_l121_assert_return_arithmetic_nan");
|
||
|
let result = instance.call("f32.no_fold_zero_div", &[Value::F32(f32::from_bits(2141192192) as u32)]).unwrap().expect("Missing result in c46_l121_assert_return_arithmetic_nan");
|
||
|
assert!(match result {
|
||
|
Value::F32(fp) => f32::from_bits(fp).is_quiet_nan(),
|
||
|
Value::F64(fp) => f64::from_bits(fp).is_quiet_nan(),
|
||
|
_ => unimplemented!()
|
||
|
})
|
||
|
}
|
||
|
|
||
|
// Line 122
|
||
|
fn c47_l122_assert_return_canonical_nan(instance: &mut Instance) {
|
||
|
println!("Executing function {}", "c47_l122_assert_return_canonical_nan");
|
||
|
let result = instance.call("f64.no_fold_zero_div", &[Value::F64((0.0f64).to_bits())]).unwrap().expect("Missing result in c47_l122_assert_return_canonical_nan");
|
||
|
assert!(match result {
|
||
|
Value::F32(fp) => f32::from_bits(fp).is_quiet_nan(),
|
||
|
Value::F64(fp) => f64::from_bits(fp).is_quiet_nan(),
|
||
|
_ => unimplemented!()
|
||
|
})
|
||
|
}
|
||
|
|
||
|
// Line 123
|
||
|
fn c48_l123_assert_return_canonical_nan(instance: &mut Instance) {
|
||
|
println!("Executing function {}", "c48_l123_assert_return_canonical_nan");
|
||
|
let result = instance.call("f64.no_fold_zero_div", &[Value::F64((-0.0f64).to_bits())]).unwrap().expect("Missing result in c48_l123_assert_return_canonical_nan");
|
||
|
assert!(match result {
|
||
|
Value::F32(fp) => f32::from_bits(fp).is_quiet_nan(),
|
||
|
Value::F64(fp) => f64::from_bits(fp).is_quiet_nan(),
|
||
|
_ => unimplemented!()
|
||
|
})
|
||
|
}
|
||
|
|
||
|
// Line 124
|
||
|
fn c49_l124_assert_return_canonical_nan(instance: &mut Instance) {
|
||
|
println!("Executing function {}", "c49_l124_assert_return_canonical_nan");
|
||
|
let result = instance.call("f64.no_fold_zero_div", &[Value::F64(f64::from_bits(9221120237041090560) as u64)]).unwrap().expect("Missing result in c49_l124_assert_return_canonical_nan");
|
||
|
assert!(match result {
|
||
|
Value::F32(fp) => f32::from_bits(fp).is_quiet_nan(),
|
||
|
Value::F64(fp) => f64::from_bits(fp).is_quiet_nan(),
|
||
|
_ => unimplemented!()
|
||
|
})
|
||
|
}
|
||
|
|
||
|
// Line 125
|
||
|
fn c50_l125_assert_return_arithmetic_nan(instance: &mut Instance) {
|
||
|
println!("Executing function {}", "c50_l125_assert_return_arithmetic_nan");
|
||
|
let result = instance.call("f64.no_fold_zero_div", &[Value::F64(f64::from_bits(9219994337134247936) as u64)]).unwrap().expect("Missing result in c50_l125_assert_return_arithmetic_nan");
|
||
|
assert!(match result {
|
||
|
Value::F32(fp) => f32::from_bits(fp).is_quiet_nan(),
|
||
|
Value::F64(fp) => f64::from_bits(fp).is_quiet_nan(),
|
||
|
_ => unimplemented!()
|
||
|
})
|
||
|
}
|
||
|
|
||
|
// Line 129
|
||
|
|
||
|
#[test]
|
||
|
fn test_module_8() {
|
||
|
let mut instance = create_module_8();
|
||
|
// We group the calls together
|
||
|
start_module_8(&mut instance);
|
||
|
c43_l118_assert_return_canonical_nan(&mut instance);
|
||
|
c44_l119_assert_return_canonical_nan(&mut instance);
|
||
|
c45_l120_assert_return_canonical_nan(&mut instance);
|
||
|
c46_l121_assert_return_arithmetic_nan(&mut instance);
|
||
|
c47_l122_assert_return_canonical_nan(&mut instance);
|
||
|
c48_l123_assert_return_canonical_nan(&mut instance);
|
||
|
c49_l124_assert_return_canonical_nan(&mut instance);
|
||
|
c50_l125_assert_return_arithmetic_nan(&mut instance);
|
||
|
}
|
||
|
fn create_module_9() -> Box<Instance> {
|
||
|
let module_str = "(module
|
||
|
(type (;0;) (func (param f32) (result f32)))
|
||
|
(type (;1;) (func (param f64) (result f64)))
|
||
|
(func (;0;) (type 0) (param f32) (result f32)
|
||
|
get_local 0
|
||
|
f32.const 0x1p+0 (;=1;)
|
||
|
f32.div)
|
||
|
(func (;1;) (type 1) (param f64) (result f64)
|
||
|
get_local 0
|
||
|
f64.const 0x1p+0 (;=1;)
|
||
|
f64.div)
|
||
|
(export \"f32.no_fold_div_one\" (func 0))
|
||
|
(export \"f64.no_fold_div_one\" (func 1)))
|
||
|
";
|
||
|
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_9(instance: &mut Instance) {
|
||
|
// TODO Review is explicit start needed? Start now called in runtime::Instance::new()
|
||
|
//instance.start();
|
||
|
}
|
||
|
|
||
|
// Line 136
|
||
|
fn c52_l136_assert_return_arithmetic_nan(instance: &mut Instance) {
|
||
|
println!("Executing function {}", "c52_l136_assert_return_arithmetic_nan");
|
||
|
let result = instance.call("f32.no_fold_div_one", &[Value::F32(f32::from_bits(2141192192) as u32)]).unwrap().expect("Missing result in c52_l136_assert_return_arithmetic_nan");
|
||
|
assert!(match result {
|
||
|
Value::F32(fp) => f32::from_bits(fp).is_quiet_nan(),
|
||
|
Value::F64(fp) => f64::from_bits(fp).is_quiet_nan(),
|
||
|
_ => unimplemented!()
|
||
|
})
|
||
|
}
|
||
|
|
||
|
// Line 137
|
||
|
fn c53_l137_assert_return_arithmetic_nan(instance: &mut Instance) {
|
||
|
println!("Executing function {}", "c53_l137_assert_return_arithmetic_nan");
|
||
|
let result = instance.call("f64.no_fold_div_one", &[Value::F64(f64::from_bits(9219994337134247936) as u64)]).unwrap().expect("Missing result in c53_l137_assert_return_arithmetic_nan");
|
||
|
assert!(match result {
|
||
|
Value::F32(fp) => f32::from_bits(fp).is_quiet_nan(),
|
||
|
Value::F64(fp) => f64::from_bits(fp).is_quiet_nan(),
|
||
|
_ => unimplemented!()
|
||
|
})
|
||
|
}
|
||
|
|
||
|
// Line 141
|
||
|
|
||
|
#[test]
|
||
|
fn test_module_9() {
|
||
|
let mut instance = create_module_9();
|
||
|
// We group the calls together
|
||
|
start_module_9(&mut instance);
|
||
|
c52_l136_assert_return_arithmetic_nan(&mut instance);
|
||
|
c53_l137_assert_return_arithmetic_nan(&mut instance);
|
||
|
}
|
||
|
fn create_module_10() -> Box<Instance> {
|
||
|
let module_str = "(module
|
||
|
(type (;0;) (func (param f32) (result f32)))
|
||
|
(type (;1;) (func (param f64) (result f64)))
|
||
|
(func (;0;) (type 0) (param f32) (result f32)
|
||
|
get_local 0
|
||
|
f32.const -0x1p+0 (;=-1;)
|
||
|
f32.div)
|
||
|
(func (;1;) (type 1) (param f64) (result f64)
|
||
|
get_local 0
|
||
|
f64.const -0x1p+0 (;=-1;)
|
||
|
f64.div)
|
||
|
(export \"f32.no_fold_div_neg1\" (func 0))
|
||
|
(export \"f64.no_fold_div_neg1\" (func 1)))
|
||
|
";
|
||
|
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_10(instance: &mut Instance) {
|
||
|
// TODO Review is explicit start needed? Start now called in runtime::Instance::new()
|
||
|
//instance.start();
|
||
|
}
|
||
|
|
||
|
// Line 148
|
||
|
fn c55_l148_assert_return_arithmetic_nan(instance: &mut Instance) {
|
||
|
println!("Executing function {}", "c55_l148_assert_return_arithmetic_nan");
|
||
|
let result = instance.call("f32.no_fold_div_neg1", &[Value::F32(f32::from_bits(2141192192) as u32)]).unwrap().expect("Missing result in c55_l148_assert_return_arithmetic_nan");
|
||
|
assert!(match result {
|
||
|
Value::F32(fp) => f32::from_bits(fp).is_quiet_nan(),
|
||
|
Value::F64(fp) => f64::from_bits(fp).is_quiet_nan(),
|
||
|
_ => unimplemented!()
|
||
|
})
|
||
|
}
|
||
|
|
||
|
// Line 149
|
||
|
fn c56_l149_assert_return_arithmetic_nan(instance: &mut Instance) {
|
||
|
println!("Executing function {}", "c56_l149_assert_return_arithmetic_nan");
|
||
|
let result = instance.call("f64.no_fold_div_neg1", &[Value::F64(f64::from_bits(9219994337134247936) as u64)]).unwrap().expect("Missing result in c56_l149_assert_return_arithmetic_nan");
|
||
|
assert!(match result {
|
||
|
Value::F32(fp) => f32::from_bits(fp).is_quiet_nan(),
|
||
|
Value::F64(fp) => f64::from_bits(fp).is_quiet_nan(),
|
||
|
_ => unimplemented!()
|
||
|
})
|
||
|
}
|
||
|
|
||
|
// Line 153
|
||
|
|
||
|
#[test]
|
||
|
fn test_module_10() {
|
||
|
let mut instance = create_module_10();
|
||
|
// We group the calls together
|
||
|
start_module_10(&mut instance);
|
||
|
c55_l148_assert_return_arithmetic_nan(&mut instance);
|
||
|
c56_l149_assert_return_arithmetic_nan(&mut instance);
|
||
|
}
|
||
|
fn create_module_11() -> Box<Instance> {
|
||
|
let module_str = "(module
|
||
|
(type (;0;) (func (param f32) (result f32)))
|
||
|
(type (;1;) (func (param f64) (result f64)))
|
||
|
(func (;0;) (type 0) (param f32) (result f32)
|
||
|
f32.const -0x0p+0 (;=-0;)
|
||
|
get_local 0
|
||
|
f32.sub)
|
||
|
(func (;1;) (type 1) (param f64) (result f64)
|
||
|
f64.const -0x0p+0 (;=-0;)
|
||
|
get_local 0
|
||
|
f64.sub)
|
||
|
(export \"f32.no_fold_neg0_sub\" (func 0))
|
||
|
(export \"f64.no_fold_neg0_sub\" (func 1)))
|
||
|
";
|
||
|
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_11(instance: &mut Instance) {
|
||
|
// TODO Review is explicit start needed? Start now called in runtime::Instance::new()
|
||
|
//instance.start();
|
||
|
}
|
||
|
|
||
|
// Line 160
|
||
|
fn c58_l160_assert_return_arithmetic_nan(instance: &mut Instance) {
|
||
|
println!("Executing function {}", "c58_l160_assert_return_arithmetic_nan");
|
||
|
let result = instance.call("f32.no_fold_neg0_sub", &[Value::F32(f32::from_bits(2141192192) as u32)]).unwrap().expect("Missing result in c58_l160_assert_return_arithmetic_nan");
|
||
|
assert!(match result {
|
||
|
Value::F32(fp) => f32::from_bits(fp).is_quiet_nan(),
|
||
|
Value::F64(fp) => f64::from_bits(fp).is_quiet_nan(),
|
||
|
_ => unimplemented!()
|
||
|
})
|
||
|
}
|
||
|
|
||
|
// Line 161
|
||
|
fn c59_l161_assert_return_arithmetic_nan(instance: &mut Instance) {
|
||
|
println!("Executing function {}", "c59_l161_assert_return_arithmetic_nan");
|
||
|
let result = instance.call("f64.no_fold_neg0_sub", &[Value::F64(f64::from_bits(9219994337134247936) as u64)]).unwrap().expect("Missing result in c59_l161_assert_return_arithmetic_nan");
|
||
|
assert!(match result {
|
||
|
Value::F32(fp) => f32::from_bits(fp).is_quiet_nan(),
|
||
|
Value::F64(fp) => f64::from_bits(fp).is_quiet_nan(),
|
||
|
_ => unimplemented!()
|
||
|
})
|
||
|
}
|
||
|
|
||
|
// Line 165
|
||
|
|
||
|
#[test]
|
||
|
fn test_module_11() {
|
||
|
let mut instance = create_module_11();
|
||
|
// We group the calls together
|
||
|
start_module_11(&mut instance);
|
||
|
c58_l160_assert_return_arithmetic_nan(&mut instance);
|
||
|
c59_l161_assert_return_arithmetic_nan(&mut instance);
|
||
|
}
|
||
|
fn create_module_12() -> Box<Instance> {
|
||
|
let module_str = "(module
|
||
|
(type (;0;) (func (param f32) (result f32)))
|
||
|
(type (;1;) (func (param f64) (result f64)))
|
||
|
(func (;0;) (type 0) (param f32) (result f32)
|
||
|
f32.const -0x1p+0 (;=-1;)
|
||
|
get_local 0
|
||
|
f32.mul)
|
||
|
(func (;1;) (type 1) (param f64) (result f64)
|
||
|
f64.const -0x1p+0 (;=-1;)
|
||
|
get_local 0
|
||
|
f64.mul)
|
||
|
(export \"f32.no_fold_neg1_mul\" (func 0))
|
||
|
(export \"f64.no_fold_neg1_mul\" (func 1)))
|
||
|
";
|
||
|
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_12(instance: &mut Instance) {
|
||
|
// TODO Review is explicit start needed? Start now called in runtime::Instance::new()
|
||
|
//instance.start();
|
||
|
}
|
||
|
|
||
|
// Line 172
|
||
|
fn c61_l172_assert_return_arithmetic_nan(instance: &mut Instance) {
|
||
|
println!("Executing function {}", "c61_l172_assert_return_arithmetic_nan");
|
||
|
let result = instance.call("f32.no_fold_neg1_mul", &[Value::F32(f32::from_bits(2141192192) as u32)]).unwrap().expect("Missing result in c61_l172_assert_return_arithmetic_nan");
|
||
|
assert!(match result {
|
||
|
Value::F32(fp) => f32::from_bits(fp).is_quiet_nan(),
|
||
|
Value::F64(fp) => f64::from_bits(fp).is_quiet_nan(),
|
||
|
_ => unimplemented!()
|
||
|
})
|
||
|
}
|
||
|
|
||
|
// Line 173
|
||
|
fn c62_l173_assert_return_arithmetic_nan(instance: &mut Instance) {
|
||
|
println!("Executing function {}", "c62_l173_assert_return_arithmetic_nan");
|
||
|
let result = instance.call("f64.no_fold_neg1_mul", &[Value::F64(f64::from_bits(9219994337134247936) as u64)]).unwrap().expect("Missing result in c62_l173_assert_return_arithmetic_nan");
|
||
|
assert!(match result {
|
||
|
Value::F32(fp) => f32::from_bits(fp).is_quiet_nan(),
|
||
|
Value::F64(fp) => f64::from_bits(fp).is_quiet_nan(),
|
||
|
_ => unimplemented!()
|
||
|
})
|
||
|
}
|
||
|
|
||
|
// Line 177
|
||
|
|
||
|
#[test]
|
||
|
fn test_module_12() {
|
||
|
let mut instance = create_module_12();
|
||
|
// We group the calls together
|
||
|
start_module_12(&mut instance);
|
||
|
c61_l172_assert_return_arithmetic_nan(&mut instance);
|
||
|
c62_l173_assert_return_arithmetic_nan(&mut instance);
|
||
|
}
|
||
|
fn create_module_13() -> Box<Instance> {
|
||
|
let module_str = "(module
|
||
|
(type (;0;) (func (param f32) (result i32)))
|
||
|
(type (;1;) (func (param f64) (result i32)))
|
||
|
(func (;0;) (type 0) (param f32) (result i32)
|
||
|
get_local 0
|
||
|
get_local 0
|
||
|
f32.eq)
|
||
|
(func (;1;) (type 1) (param f64) (result i32)
|
||
|
get_local 0
|
||
|
get_local 0
|
||
|
f64.eq)
|
||
|
(export \"f32.no_fold_eq_self\" (func 0))
|
||
|
(export \"f64.no_fold_eq_self\" (func 1)))
|
||
|
";
|
||
|
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_13(instance: &mut Instance) {
|
||
|
// TODO Review is explicit start needed? Start now called in runtime::Instance::new()
|
||
|
//instance.start();
|
||
|
}
|
||
|
|
||
|
// Line 184
|
||
|
fn c64_l184_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c64_l184_action_invoke");
|
||
|
let result = instance.call("f32.no_fold_eq_self", &[Value::F32(f32::from_bits(2143289344) as u32)]);
|
||
|
assert_eq!(result, Ok(Some(Value::I32(0 as i32))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 185
|
||
|
fn c65_l185_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c65_l185_action_invoke");
|
||
|
let result = instance.call("f64.no_fold_eq_self", &[Value::F64(f64::from_bits(9221120237041090560) as u64)]);
|
||
|
assert_eq!(result, Ok(Some(Value::I32(0 as i32))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 189
|
||
|
|
||
|
#[test]
|
||
|
fn test_module_13() {
|
||
|
let mut instance = create_module_13();
|
||
|
// We group the calls together
|
||
|
start_module_13(&mut instance);
|
||
|
c64_l184_action_invoke(&mut instance);
|
||
|
c65_l185_action_invoke(&mut instance);
|
||
|
}
|
||
|
fn create_module_14() -> Box<Instance> {
|
||
|
let module_str = "(module
|
||
|
(type (;0;) (func (param f32) (result i32)))
|
||
|
(type (;1;) (func (param f64) (result i32)))
|
||
|
(func (;0;) (type 0) (param f32) (result i32)
|
||
|
get_local 0
|
||
|
get_local 0
|
||
|
f32.ne)
|
||
|
(func (;1;) (type 1) (param f64) (result i32)
|
||
|
get_local 0
|
||
|
get_local 0
|
||
|
f64.ne)
|
||
|
(export \"f32.no_fold_ne_self\" (func 0))
|
||
|
(export \"f64.no_fold_ne_self\" (func 1)))
|
||
|
";
|
||
|
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_14(instance: &mut Instance) {
|
||
|
// TODO Review is explicit start needed? Start now called in runtime::Instance::new()
|
||
|
//instance.start();
|
||
|
}
|
||
|
|
||
|
// Line 196
|
||
|
fn c67_l196_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c67_l196_action_invoke");
|
||
|
let result = instance.call("f32.no_fold_ne_self", &[Value::F32(f32::from_bits(2143289344) as u32)]);
|
||
|
assert_eq!(result, Ok(Some(Value::I32(1 as i32))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 197
|
||
|
fn c68_l197_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c68_l197_action_invoke");
|
||
|
let result = instance.call("f64.no_fold_ne_self", &[Value::F64(f64::from_bits(9221120237041090560) as u64)]);
|
||
|
assert_eq!(result, Ok(Some(Value::I32(1 as i32))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 201
|
||
|
|
||
|
#[test]
|
||
|
fn test_module_14() {
|
||
|
let mut instance = create_module_14();
|
||
|
// We group the calls together
|
||
|
start_module_14(&mut instance);
|
||
|
c67_l196_action_invoke(&mut instance);
|
||
|
c68_l197_action_invoke(&mut instance);
|
||
|
}
|
||
|
fn create_module_15() -> Box<Instance> {
|
||
|
let module_str = "(module
|
||
|
(type (;0;) (func (param f32) (result f32)))
|
||
|
(type (;1;) (func (param f64) (result f64)))
|
||
|
(func (;0;) (type 0) (param f32) (result f32)
|
||
|
get_local 0
|
||
|
get_local 0
|
||
|
f32.sub)
|
||
|
(func (;1;) (type 1) (param f64) (result f64)
|
||
|
get_local 0
|
||
|
get_local 0
|
||
|
f64.sub)
|
||
|
(export \"f32.no_fold_sub_self\" (func 0))
|
||
|
(export \"f64.no_fold_sub_self\" (func 1)))
|
||
|
";
|
||
|
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_15(instance: &mut Instance) {
|
||
|
// TODO Review is explicit start needed? Start now called in runtime::Instance::new()
|
||
|
//instance.start();
|
||
|
}
|
||
|
|
||
|
// Line 208
|
||
|
fn c70_l208_assert_return_canonical_nan(instance: &mut Instance) {
|
||
|
println!("Executing function {}", "c70_l208_assert_return_canonical_nan");
|
||
|
let result = instance.call("f32.no_fold_sub_self", &[Value::F32(f32::INFINITY.to_bits())]).unwrap().expect("Missing result in c70_l208_assert_return_canonical_nan");
|
||
|
assert!(match result {
|
||
|
Value::F32(fp) => f32::from_bits(fp).is_quiet_nan(),
|
||
|
Value::F64(fp) => f64::from_bits(fp).is_quiet_nan(),
|
||
|
_ => unimplemented!()
|
||
|
})
|
||
|
}
|
||
|
|
||
|
// Line 209
|
||
|
fn c71_l209_assert_return_canonical_nan(instance: &mut Instance) {
|
||
|
println!("Executing function {}", "c71_l209_assert_return_canonical_nan");
|
||
|
let result = instance.call("f32.no_fold_sub_self", &[Value::F32(f32::from_bits(2143289344) as u32)]).unwrap().expect("Missing result in c71_l209_assert_return_canonical_nan");
|
||
|
assert!(match result {
|
||
|
Value::F32(fp) => f32::from_bits(fp).is_quiet_nan(),
|
||
|
Value::F64(fp) => f64::from_bits(fp).is_quiet_nan(),
|
||
|
_ => unimplemented!()
|
||
|
})
|
||
|
}
|
||
|
|
||
|
// Line 210
|
||
|
fn c72_l210_assert_return_canonical_nan(instance: &mut Instance) {
|
||
|
println!("Executing function {}", "c72_l210_assert_return_canonical_nan");
|
||
|
let result = instance.call("f64.no_fold_sub_self", &[Value::F64(f64::INFINITY.to_bits())]).unwrap().expect("Missing result in c72_l210_assert_return_canonical_nan");
|
||
|
assert!(match result {
|
||
|
Value::F32(fp) => f32::from_bits(fp).is_quiet_nan(),
|
||
|
Value::F64(fp) => f64::from_bits(fp).is_quiet_nan(),
|
||
|
_ => unimplemented!()
|
||
|
})
|
||
|
}
|
||
|
|
||
|
// Line 211
|
||
|
fn c73_l211_assert_return_canonical_nan(instance: &mut Instance) {
|
||
|
println!("Executing function {}", "c73_l211_assert_return_canonical_nan");
|
||
|
let result = instance.call("f64.no_fold_sub_self", &[Value::F64(f64::from_bits(9221120237041090560) as u64)]).unwrap().expect("Missing result in c73_l211_assert_return_canonical_nan");
|
||
|
assert!(match result {
|
||
|
Value::F32(fp) => f32::from_bits(fp).is_quiet_nan(),
|
||
|
Value::F64(fp) => f64::from_bits(fp).is_quiet_nan(),
|
||
|
_ => unimplemented!()
|
||
|
})
|
||
|
}
|
||
|
|
||
|
// Line 215
|
||
|
|
||
|
#[test]
|
||
|
fn test_module_15() {
|
||
|
let mut instance = create_module_15();
|
||
|
// We group the calls together
|
||
|
start_module_15(&mut instance);
|
||
|
c70_l208_assert_return_canonical_nan(&mut instance);
|
||
|
c71_l209_assert_return_canonical_nan(&mut instance);
|
||
|
c72_l210_assert_return_canonical_nan(&mut instance);
|
||
|
c73_l211_assert_return_canonical_nan(&mut instance);
|
||
|
}
|
||
|
fn create_module_16() -> Box<Instance> {
|
||
|
let module_str = "(module
|
||
|
(type (;0;) (func (param f32) (result f32)))
|
||
|
(type (;1;) (func (param f64) (result f64)))
|
||
|
(func (;0;) (type 0) (param f32) (result f32)
|
||
|
get_local 0
|
||
|
get_local 0
|
||
|
f32.div)
|
||
|
(func (;1;) (type 1) (param f64) (result f64)
|
||
|
get_local 0
|
||
|
get_local 0
|
||
|
f64.div)
|
||
|
(export \"f32.no_fold_div_self\" (func 0))
|
||
|
(export \"f64.no_fold_div_self\" (func 1)))
|
||
|
";
|
||
|
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_16(instance: &mut Instance) {
|
||
|
// TODO Review is explicit start needed? Start now called in runtime::Instance::new()
|
||
|
//instance.start();
|
||
|
}
|
||
|
|
||
|
// Line 222
|
||
|
fn c75_l222_assert_return_canonical_nan(instance: &mut Instance) {
|
||
|
println!("Executing function {}", "c75_l222_assert_return_canonical_nan");
|
||
|
let result = instance.call("f32.no_fold_div_self", &[Value::F32(f32::INFINITY.to_bits())]).unwrap().expect("Missing result in c75_l222_assert_return_canonical_nan");
|
||
|
assert!(match result {
|
||
|
Value::F32(fp) => f32::from_bits(fp).is_quiet_nan(),
|
||
|
Value::F64(fp) => f64::from_bits(fp).is_quiet_nan(),
|
||
|
_ => unimplemented!()
|
||
|
})
|
||
|
}
|
||
|
|
||
|
// Line 223
|
||
|
fn c76_l223_assert_return_canonical_nan(instance: &mut Instance) {
|
||
|
println!("Executing function {}", "c76_l223_assert_return_canonical_nan");
|
||
|
let result = instance.call("f32.no_fold_div_self", &[Value::F32(f32::from_bits(2143289344) as u32)]).unwrap().expect("Missing result in c76_l223_assert_return_canonical_nan");
|
||
|
assert!(match result {
|
||
|
Value::F32(fp) => f32::from_bits(fp).is_quiet_nan(),
|
||
|
Value::F64(fp) => f64::from_bits(fp).is_quiet_nan(),
|
||
|
_ => unimplemented!()
|
||
|
})
|
||
|
}
|
||
|
|
||
|
// Line 224
|
||
|
fn c77_l224_assert_return_canonical_nan(instance: &mut Instance) {
|
||
|
println!("Executing function {}", "c77_l224_assert_return_canonical_nan");
|
||
|
let result = instance.call("f32.no_fold_div_self", &[Value::F32((0.0f32).to_bits())]).unwrap().expect("Missing result in c77_l224_assert_return_canonical_nan");
|
||
|
assert!(match result {
|
||
|
Value::F32(fp) => f32::from_bits(fp).is_quiet_nan(),
|
||
|
Value::F64(fp) => f64::from_bits(fp).is_quiet_nan(),
|
||
|
_ => unimplemented!()
|
||
|
})
|
||
|
}
|
||
|
|
||
|
// Line 225
|
||
|
fn c78_l225_assert_return_canonical_nan(instance: &mut Instance) {
|
||
|
println!("Executing function {}", "c78_l225_assert_return_canonical_nan");
|
||
|
let result = instance.call("f32.no_fold_div_self", &[Value::F32((-0.0f32).to_bits())]).unwrap().expect("Missing result in c78_l225_assert_return_canonical_nan");
|
||
|
assert!(match result {
|
||
|
Value::F32(fp) => f32::from_bits(fp).is_quiet_nan(),
|
||
|
Value::F64(fp) => f64::from_bits(fp).is_quiet_nan(),
|
||
|
_ => unimplemented!()
|
||
|
})
|
||
|
}
|
||
|
|
||
|
// Line 226
|
||
|
fn c79_l226_assert_return_canonical_nan(instance: &mut Instance) {
|
||
|
println!("Executing function {}", "c79_l226_assert_return_canonical_nan");
|
||
|
let result = instance.call("f64.no_fold_div_self", &[Value::F64(f64::INFINITY.to_bits())]).unwrap().expect("Missing result in c79_l226_assert_return_canonical_nan");
|
||
|
assert!(match result {
|
||
|
Value::F32(fp) => f32::from_bits(fp).is_quiet_nan(),
|
||
|
Value::F64(fp) => f64::from_bits(fp).is_quiet_nan(),
|
||
|
_ => unimplemented!()
|
||
|
})
|
||
|
}
|
||
|
|
||
|
// Line 227
|
||
|
fn c80_l227_assert_return_canonical_nan(instance: &mut Instance) {
|
||
|
println!("Executing function {}", "c80_l227_assert_return_canonical_nan");
|
||
|
let result = instance.call("f64.no_fold_div_self", &[Value::F64(f64::from_bits(9221120237041090560) as u64)]).unwrap().expect("Missing result in c80_l227_assert_return_canonical_nan");
|
||
|
assert!(match result {
|
||
|
Value::F32(fp) => f32::from_bits(fp).is_quiet_nan(),
|
||
|
Value::F64(fp) => f64::from_bits(fp).is_quiet_nan(),
|
||
|
_ => unimplemented!()
|
||
|
})
|
||
|
}
|
||
|
|
||
|
// Line 228
|
||
|
fn c81_l228_assert_return_canonical_nan(instance: &mut Instance) {
|
||
|
println!("Executing function {}", "c81_l228_assert_return_canonical_nan");
|
||
|
let result = instance.call("f64.no_fold_div_self", &[Value::F64((0.0f64).to_bits())]).unwrap().expect("Missing result in c81_l228_assert_return_canonical_nan");
|
||
|
assert!(match result {
|
||
|
Value::F32(fp) => f32::from_bits(fp).is_quiet_nan(),
|
||
|
Value::F64(fp) => f64::from_bits(fp).is_quiet_nan(),
|
||
|
_ => unimplemented!()
|
||
|
})
|
||
|
}
|
||
|
|
||
|
// Line 229
|
||
|
fn c82_l229_assert_return_canonical_nan(instance: &mut Instance) {
|
||
|
println!("Executing function {}", "c82_l229_assert_return_canonical_nan");
|
||
|
let result = instance.call("f64.no_fold_div_self", &[Value::F64((-0.0f64).to_bits())]).unwrap().expect("Missing result in c82_l229_assert_return_canonical_nan");
|
||
|
assert!(match result {
|
||
|
Value::F32(fp) => f32::from_bits(fp).is_quiet_nan(),
|
||
|
Value::F64(fp) => f64::from_bits(fp).is_quiet_nan(),
|
||
|
_ => unimplemented!()
|
||
|
})
|
||
|
}
|
||
|
|
||
|
// Line 233
|
||
|
|
||
|
#[test]
|
||
|
fn test_module_16() {
|
||
|
let mut instance = create_module_16();
|
||
|
// We group the calls together
|
||
|
start_module_16(&mut instance);
|
||
|
c75_l222_assert_return_canonical_nan(&mut instance);
|
||
|
c76_l223_assert_return_canonical_nan(&mut instance);
|
||
|
c77_l224_assert_return_canonical_nan(&mut instance);
|
||
|
c78_l225_assert_return_canonical_nan(&mut instance);
|
||
|
c79_l226_assert_return_canonical_nan(&mut instance);
|
||
|
c80_l227_assert_return_canonical_nan(&mut instance);
|
||
|
c81_l228_assert_return_canonical_nan(&mut instance);
|
||
|
c82_l229_assert_return_canonical_nan(&mut instance);
|
||
|
}
|
||
|
fn create_module_17() -> Box<Instance> {
|
||
|
let module_str = "(module
|
||
|
(type (;0;) (func (param f32) (result f32)))
|
||
|
(type (;1;) (func (param f64) (result f64)))
|
||
|
(func (;0;) (type 0) (param f32) (result f32)
|
||
|
get_local 0
|
||
|
f32.const 0x1.8p+1 (;=3;)
|
||
|
f32.div)
|
||
|
(func (;1;) (type 1) (param f64) (result f64)
|
||
|
get_local 0
|
||
|
f64.const 0x1.8p+1 (;=3;)
|
||
|
f64.div)
|
||
|
(export \"f32.no_fold_div_3\" (func 0))
|
||
|
(export \"f64.no_fold_div_3\" (func 1)))
|
||
|
";
|
||
|
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_17(instance: &mut Instance) {
|
||
|
// TODO Review is explicit start needed? Start now called in runtime::Instance::new()
|
||
|
//instance.start();
|
||
|
}
|
||
|
|
||
|
// Line 240
|
||
|
fn c84_l240_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c84_l240_action_invoke");
|
||
|
let result = instance.call("f32.no_fold_div_3", &[Value::F32((-1361679000000000.0f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((-453892980000000.0f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 241
|
||
|
fn c85_l241_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c85_l241_action_invoke");
|
||
|
let result = instance.call("f32.no_fold_div_3", &[Value::F32((-18736880000000000000000000000.0f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((-6245626600000000000000000000.0f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 242
|
||
|
fn c86_l242_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c86_l242_action_invoke");
|
||
|
let result = instance.call("f32.no_fold_div_3", &[Value::F32((-0.00000000000000000000000012045131f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((-0.000000000000000000000000040150435f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 243
|
||
|
fn c87_l243_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c87_l243_action_invoke");
|
||
|
let result = instance.call("f32.no_fold_div_3", &[Value::F32((-0.00000000000000000000000000000000000005281346f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((-0.000000000000000000000000000000000000017604486f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 244
|
||
|
fn c88_l244_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c88_l244_action_invoke");
|
||
|
let result = instance.call("f32.no_fold_div_3", &[Value::F32((-0.000000000000000025495563f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((-0.000000000000000008498521f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 245
|
||
|
fn c89_l245_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c89_l245_action_invoke");
|
||
|
let result = instance.call("f64.no_fold_div_3", &[Value::F64((-29563579573969634000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.0f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((-9854526524656545000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.0f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 246
|
||
|
fn c90_l246_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c90_l246_action_invoke");
|
||
|
let result = instance.call("f64.no_fold_div_3", &[Value::F64((-0.000000000000000000000000000000000000000000000000009291150921449772f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((-0.000000000000000000000000000000000000000000000000003097050307149924f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 247
|
||
|
fn c91_l247_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c91_l247_action_invoke");
|
||
|
let result = instance.call("f64.no_fold_div_3", &[Value::F64((0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000013808061543557006f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004602687181185669f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 248
|
||
|
fn c92_l248_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c92_l248_action_invoke");
|
||
|
let result = instance.call("f64.no_fold_div_3", &[Value::F64((-1378076163468349000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.0f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((-459358721156116300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.0f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 249
|
||
|
fn c93_l249_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c93_l249_action_invoke");
|
||
|
let result = instance.call("f64.no_fold_div_3", &[Value::F64((86324008088313660000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.0f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((28774669362771220000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.0f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 253
|
||
|
|
||
|
#[test]
|
||
|
fn test_module_17() {
|
||
|
let mut instance = create_module_17();
|
||
|
// We group the calls together
|
||
|
start_module_17(&mut instance);
|
||
|
c84_l240_action_invoke(&mut instance);
|
||
|
c85_l241_action_invoke(&mut instance);
|
||
|
c86_l242_action_invoke(&mut instance);
|
||
|
c87_l243_action_invoke(&mut instance);
|
||
|
c88_l244_action_invoke(&mut instance);
|
||
|
c89_l245_action_invoke(&mut instance);
|
||
|
c90_l246_action_invoke(&mut instance);
|
||
|
c91_l247_action_invoke(&mut instance);
|
||
|
c92_l248_action_invoke(&mut instance);
|
||
|
c93_l249_action_invoke(&mut instance);
|
||
|
}
|
||
|
fn create_module_18() -> Box<Instance> {
|
||
|
let module_str = "(module
|
||
|
(type (;0;) (func (param f32 f32 f32) (result f32)))
|
||
|
(type (;1;) (func (param f64 f64 f64) (result f64)))
|
||
|
(func (;0;) (type 0) (param f32 f32 f32) (result f32)
|
||
|
get_local 0
|
||
|
get_local 2
|
||
|
f32.mul
|
||
|
get_local 1
|
||
|
get_local 2
|
||
|
f32.mul
|
||
|
f32.add)
|
||
|
(func (;1;) (type 1) (param f64 f64 f64) (result f64)
|
||
|
get_local 0
|
||
|
get_local 2
|
||
|
f64.mul
|
||
|
get_local 1
|
||
|
get_local 2
|
||
|
f64.mul
|
||
|
f64.add)
|
||
|
(export \"f32.no_factor\" (func 0))
|
||
|
(export \"f64.no_factor\" (func 1)))
|
||
|
";
|
||
|
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_18(instance: &mut Instance) {
|
||
|
// TODO Review is explicit start needed? Start now called in runtime::Instance::new()
|
||
|
//instance.start();
|
||
|
}
|
||
|
|
||
|
// Line 260
|
||
|
fn c95_l260_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c95_l260_action_invoke");
|
||
|
let result = instance.call("f32.no_factor", &[Value::F32((-1435111700000.0f32).to_bits()), Value::F32((-853617640000000.0f32).to_bits()), Value::F32((1113849300000000000.0f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((-952399900000000000000000000000000.0f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 261
|
||
|
fn c96_l261_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c96_l261_action_invoke");
|
||
|
let result = instance.call("f32.no_factor", &[Value::F32((-0.026666632f32).to_bits()), Value::F32((0.048412822f32).to_bits()), Value::F32((-0.002813697f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((-0.0000611872f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 262
|
||
|
fn c97_l262_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c97_l262_action_invoke");
|
||
|
let result = instance.call("f32.no_factor", &[Value::F32((-0.00000000000046619777f32).to_bits()), Value::F32((0.00000000000000000010478377f32).to_bits()), Value::F32((14469202000000000000000000000000000000.0f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((-6745508000000000000000000.0f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 263
|
||
|
fn c98_l263_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c98_l263_action_invoke");
|
||
|
let result = instance.call("f32.no_factor", &[Value::F32((-0.00000000000000000010689046f32).to_bits()), Value::F32((0.00000000000000000000000010694433f32).to_bits()), Value::F32((568307000000000000000000000000000000.0f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((-60746540000000000.0f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 264
|
||
|
fn c99_l264_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c99_l264_action_invoke");
|
||
|
let result = instance.call("f32.no_factor", &[Value::F32((-0.000000000000000000000000063545994f32).to_bits()), Value::F32((0.0000000000000000000007524625f32).to_bits()), Value::F32((1626770.3f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((0.0000000000000012239803f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 265
|
||
|
fn c100_l265_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c100_l265_action_invoke");
|
||
|
let result = instance.call("f64.no_factor", &[Value::F64((0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000028390554709988774f64).to_bits()), Value::F64((0.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001473981250649641f64).to_bits()), Value::F64((-0.000000000000000000000000000000000000000000000000000000000000000000029001229846550766f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((-0.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008233610026197336f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 266
|
||
|
fn c101_l266_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c101_l266_action_invoke");
|
||
|
let result = instance.call("f64.no_factor", &[Value::F64((0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006461015505916123f64).to_bits()), Value::F64((-0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000023923242802975938f64).to_bits()), Value::F64((-0.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000015300738798561604f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((0.0f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 267
|
||
|
fn c102_l267_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c102_l267_action_invoke");
|
||
|
let result = instance.call("f64.no_factor", &[Value::F64((-0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002939056292080733f64).to_bits()), Value::F64((-0.0000000000000000000000000000000000000000000000000000000000000000000000000000000000002146156743463356f64).to_bits()), Value::F64((-2510967223130241600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.0f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((538892923853642600000000000000000000000000000000000000000000.0f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 268
|
||
|
fn c103_l268_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c103_l268_action_invoke");
|
||
|
let result = instance.call("f64.no_factor", &[Value::F64((-0.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000017785466771708878f64).to_bits()), Value::F64((0.0000000000000000000000000000000000000000000000000000000000000000000000000000009328516775403213f64).to_bits()), Value::F64((-0.00000000000000000000000000000000000000000000000000000000000000000000000000012121009044876735f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((-0.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001130710359943689f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 269
|
||
|
fn c104_l269_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c104_l269_action_invoke");
|
||
|
let result = instance.call("f64.no_factor", &[Value::F64((0.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000015194859063177362f64).to_bits()), Value::F64((0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000883589921438065f64).to_bits()), Value::F64((-1735830019469195800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.0f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((-0.0000000000000000000000000015337619131701908f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 273
|
||
|
|
||
|
#[test]
|
||
|
fn test_module_18() {
|
||
|
let mut instance = create_module_18();
|
||
|
// We group the calls together
|
||
|
start_module_18(&mut instance);
|
||
|
c95_l260_action_invoke(&mut instance);
|
||
|
c96_l261_action_invoke(&mut instance);
|
||
|
c97_l262_action_invoke(&mut instance);
|
||
|
c98_l263_action_invoke(&mut instance);
|
||
|
c99_l264_action_invoke(&mut instance);
|
||
|
c100_l265_action_invoke(&mut instance);
|
||
|
c101_l266_action_invoke(&mut instance);
|
||
|
c102_l267_action_invoke(&mut instance);
|
||
|
c103_l268_action_invoke(&mut instance);
|
||
|
c104_l269_action_invoke(&mut instance);
|
||
|
}
|
||
|
fn create_module_19() -> Box<Instance> {
|
||
|
let module_str = "(module
|
||
|
(type (;0;) (func (param f32 f32 f32) (result f32)))
|
||
|
(type (;1;) (func (param f64 f64 f64) (result f64)))
|
||
|
(func (;0;) (type 0) (param f32 f32 f32) (result f32)
|
||
|
get_local 0
|
||
|
get_local 1
|
||
|
f32.add
|
||
|
get_local 2
|
||
|
f32.mul)
|
||
|
(func (;1;) (type 1) (param f64 f64 f64) (result f64)
|
||
|
get_local 0
|
||
|
get_local 1
|
||
|
f64.add
|
||
|
get_local 2
|
||
|
f64.mul)
|
||
|
(export \"f32.no_distribute\" (func 0))
|
||
|
(export \"f64.no_distribute\" (func 1)))
|
||
|
";
|
||
|
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_19(instance: &mut Instance) {
|
||
|
// TODO Review is explicit start needed? Start now called in runtime::Instance::new()
|
||
|
//instance.start();
|
||
|
}
|
||
|
|
||
|
// Line 280
|
||
|
fn c106_l280_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c106_l280_action_invoke");
|
||
|
let result = instance.call("f32.no_distribute", &[Value::F32((-1435111700000.0f32).to_bits()), Value::F32((-853617640000000.0f32).to_bits()), Value::F32((1113849300000000000.0f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((-952400000000000000000000000000000.0f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 281
|
||
|
fn c107_l281_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c107_l281_action_invoke");
|
||
|
let result = instance.call("f32.no_distribute", &[Value::F32((-0.026666632f32).to_bits()), Value::F32((0.048412822f32).to_bits()), Value::F32((-0.002813697f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((-0.000061187195f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 282
|
||
|
fn c108_l282_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c108_l282_action_invoke");
|
||
|
let result = instance.call("f32.no_distribute", &[Value::F32((-0.00000000000046619777f32).to_bits()), Value::F32((0.00000000000000000010478377f32).to_bits()), Value::F32((14469202000000000000000000000000000000.0f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((-6745508500000000000000000.0f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 283
|
||
|
fn c109_l283_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c109_l283_action_invoke");
|
||
|
let result = instance.call("f32.no_distribute", &[Value::F32((-0.00000000000000000010689046f32).to_bits()), Value::F32((0.00000000000000000000000010694433f32).to_bits()), Value::F32((568307000000000000000000000000000000.0f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((-60746536000000000.0f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 284
|
||
|
fn c110_l284_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c110_l284_action_invoke");
|
||
|
let result = instance.call("f32.no_distribute", &[Value::F32((-0.000000000000000000000000063545994f32).to_bits()), Value::F32((0.0000000000000000000007524625f32).to_bits()), Value::F32((1626770.3f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((0.0000000000000012239802f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 285
|
||
|
fn c111_l285_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c111_l285_action_invoke");
|
||
|
let result = instance.call("f64.no_distribute", &[Value::F64((0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000028390554709988774f64).to_bits()), Value::F64((0.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001473981250649641f64).to_bits()), Value::F64((-0.000000000000000000000000000000000000000000000000000000000000000000029001229846550766f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((-0.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008233610026197337f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 286
|
||
|
fn c112_l286_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c112_l286_action_invoke");
|
||
|
let result = instance.call("f64.no_distribute", &[Value::F64((0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006461015505916123f64).to_bits()), Value::F64((-0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000023923242802975938f64).to_bits()), Value::F64((-0.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000015300738798561604f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((-0.0f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 287
|
||
|
fn c113_l287_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c113_l287_action_invoke");
|
||
|
let result = instance.call("f64.no_distribute", &[Value::F64((-0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002939056292080733f64).to_bits()), Value::F64((-0.0000000000000000000000000000000000000000000000000000000000000000000000000000000000002146156743463356f64).to_bits()), Value::F64((-2510967223130241600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.0f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((538892923853642500000000000000000000000000000000000000000000.0f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 288
|
||
|
fn c114_l288_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c114_l288_action_invoke");
|
||
|
let result = instance.call("f64.no_distribute", &[Value::F64((-0.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000017785466771708878f64).to_bits()), Value::F64((0.0000000000000000000000000000000000000000000000000000000000000000000000000000009328516775403213f64).to_bits()), Value::F64((-0.00000000000000000000000000000000000000000000000000000000000000000000000000012121009044876735f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((-0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000011307103599436889f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 289
|
||
|
fn c115_l289_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c115_l289_action_invoke");
|
||
|
let result = instance.call("f64.no_distribute", &[Value::F64((0.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000015194859063177362f64).to_bits()), Value::F64((0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000883589921438065f64).to_bits()), Value::F64((-1735830019469195800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.0f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((-0.0000000000000000000000000015337619131701907f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 293
|
||
|
|
||
|
#[test]
|
||
|
fn test_module_19() {
|
||
|
let mut instance = create_module_19();
|
||
|
// We group the calls together
|
||
|
start_module_19(&mut instance);
|
||
|
c106_l280_action_invoke(&mut instance);
|
||
|
c107_l281_action_invoke(&mut instance);
|
||
|
c108_l282_action_invoke(&mut instance);
|
||
|
c109_l283_action_invoke(&mut instance);
|
||
|
c110_l284_action_invoke(&mut instance);
|
||
|
c111_l285_action_invoke(&mut instance);
|
||
|
c112_l286_action_invoke(&mut instance);
|
||
|
c113_l287_action_invoke(&mut instance);
|
||
|
c114_l288_action_invoke(&mut instance);
|
||
|
c115_l289_action_invoke(&mut instance);
|
||
|
}
|
||
|
fn create_module_20() -> Box<Instance> {
|
||
|
let module_str = "(module
|
||
|
(type (;0;) (func (param f32 f32 f32) (result f32)))
|
||
|
(type (;1;) (func (param f64 f64 f64) (result f64)))
|
||
|
(func (;0;) (type 0) (param f32 f32 f32) (result f32)
|
||
|
get_local 0
|
||
|
get_local 1
|
||
|
get_local 2
|
||
|
f32.div
|
||
|
f32.mul)
|
||
|
(func (;1;) (type 1) (param f64 f64 f64) (result f64)
|
||
|
get_local 0
|
||
|
get_local 1
|
||
|
get_local 2
|
||
|
f64.div
|
||
|
f64.mul)
|
||
|
(export \"f32.no_regroup_div_mul\" (func 0))
|
||
|
(export \"f64.no_regroup_div_mul\" (func 1)))
|
||
|
";
|
||
|
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_20(instance: &mut Instance) {
|
||
|
// TODO Review is explicit start needed? Start now called in runtime::Instance::new()
|
||
|
//instance.start();
|
||
|
}
|
||
|
|
||
|
// Line 300
|
||
|
fn c117_l300_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c117_l300_action_invoke");
|
||
|
let result = instance.call("f32.no_regroup_div_mul", &[Value::F32((-0.00000000000000000000000000000000002831349f32).to_bits()), Value::F32((-0.00000000000000000007270787f32).to_bits()), Value::F32((0.000000000000000000000000000000000016406605f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((0.00000000000000000012547468f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 301
|
||
|
fn c118_l301_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c118_l301_action_invoke");
|
||
|
let result = instance.call("f32.no_regroup_div_mul", &[Value::F32((-3145897700000000000000000000.0f32).to_bits()), Value::F32((-0.000000000000000000000000000000000040864003f32).to_bits()), Value::F32((-9245928300000000000000.0f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((-0.0f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 302
|
||
|
fn c119_l302_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c119_l302_action_invoke");
|
||
|
let result = instance.call("f32.no_regroup_div_mul", &[Value::F32((-93157.43f32).to_bits()), Value::F32((-0.00000081292654f32).to_bits()), Value::F32((-0.00000000000000000000000000000000000015469397f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((-489548120000000000000000000000000000.0f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 303
|
||
|
fn c120_l303_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c120_l303_action_invoke");
|
||
|
let result = instance.call("f32.no_regroup_div_mul", &[Value::F32((-0.00000000000000000000000000008899643f32).to_bits()), Value::F32((17887725000000000000000.0f32).to_bits()), Value::F32((514680230000000000000.0f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((-0.000000000000000000000000003093073f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 304
|
||
|
fn c121_l304_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c121_l304_action_invoke");
|
||
|
let result = instance.call("f32.no_regroup_div_mul", &[Value::F32((9222036000000000000000000000000000.0f32).to_bits()), Value::F32((33330492.0f32).to_bits()), Value::F32((-3253108800000000000000.0f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((-94486550000000000000.0f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 305
|
||
|
fn c122_l305_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c122_l305_action_invoke");
|
||
|
let result = instance.call("f64.no_regroup_div_mul", &[Value::F64((0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000005698811412550059f64).to_bits()), Value::F64((-0.0000000000000000000000000000000000018313439132919336f64).to_bits()), Value::F64((0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000009543270551003098f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((-1093596114413331000000000000000.0f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 306
|
||
|
fn c123_l306_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c123_l306_action_invoke");
|
||
|
let result = instance.call("f64.no_regroup_div_mul", &[Value::F64((357289288425507550000000000000000000000000000000000000000000000000000000000000000000000000000000000000.0f64).to_bits()), Value::F64((0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003952760844538651f64).to_bits()), Value::F64((-1450781241254900800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.0f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((-0.0f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 307
|
||
|
fn c124_l307_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c124_l307_action_invoke");
|
||
|
let result = instance.call("f64.no_regroup_div_mul", &[Value::F64((0.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000009124278383497107f64).to_bits()), Value::F64((55561345277147970000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.0f64).to_bits()), Value::F64((0.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000025090826940306507f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64(f64::INFINITY.to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 308
|
||
|
fn c125_l308_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c125_l308_action_invoke");
|
||
|
let result = instance.call("f64.no_regroup_div_mul", &[Value::F64((-4492093000352015000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.0f64).to_bits()), Value::F64((-12087878984017852000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.0f64).to_bits()), Value::F64((-596613380626062300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.0f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((-91013507803376260000000000000000000000000000000000000000000000000000000000000.0f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 309
|
||
|
fn c126_l309_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c126_l309_action_invoke");
|
||
|
let result = instance.call("f64.no_regroup_div_mul", &[Value::F64((0.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000007470269158630455f64).to_bits()), Value::F64((0.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000007568026329781282f64).to_bits()), Value::F64((-0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001055389683973521f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((-0.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000005356807494101561f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 313
|
||
|
|
||
|
#[test]
|
||
|
fn test_module_20() {
|
||
|
let mut instance = create_module_20();
|
||
|
// We group the calls together
|
||
|
start_module_20(&mut instance);
|
||
|
c117_l300_action_invoke(&mut instance);
|
||
|
c118_l301_action_invoke(&mut instance);
|
||
|
c119_l302_action_invoke(&mut instance);
|
||
|
c120_l303_action_invoke(&mut instance);
|
||
|
c121_l304_action_invoke(&mut instance);
|
||
|
c122_l305_action_invoke(&mut instance);
|
||
|
c123_l306_action_invoke(&mut instance);
|
||
|
c124_l307_action_invoke(&mut instance);
|
||
|
c125_l308_action_invoke(&mut instance);
|
||
|
c126_l309_action_invoke(&mut instance);
|
||
|
}
|
||
|
fn create_module_21() -> Box<Instance> {
|
||
|
let module_str = "(module
|
||
|
(type (;0;) (func (param f32 f32 f32) (result f32)))
|
||
|
(type (;1;) (func (param f64 f64 f64) (result f64)))
|
||
|
(func (;0;) (type 0) (param f32 f32 f32) (result f32)
|
||
|
get_local 0
|
||
|
get_local 1
|
||
|
f32.mul
|
||
|
get_local 2
|
||
|
f32.div)
|
||
|
(func (;1;) (type 1) (param f64 f64 f64) (result f64)
|
||
|
get_local 0
|
||
|
get_local 1
|
||
|
f64.mul
|
||
|
get_local 2
|
||
|
f64.div)
|
||
|
(export \"f32.no_regroup_mul_div\" (func 0))
|
||
|
(export \"f64.no_regroup_mul_div\" (func 1)))
|
||
|
";
|
||
|
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_21(instance: &mut Instance) {
|
||
|
// TODO Review is explicit start needed? Start now called in runtime::Instance::new()
|
||
|
//instance.start();
|
||
|
}
|
||
|
|
||
|
// Line 320
|
||
|
fn c128_l320_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c128_l320_action_invoke");
|
||
|
let result = instance.call("f32.no_regroup_mul_div", &[Value::F32((-0.00000000000000000000000000000000002831349f32).to_bits()), Value::F32((-0.00000000000000000007270787f32).to_bits()), Value::F32((0.000000000000000000000000000000000016406605f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((0.0f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 321
|
||
|
fn c129_l321_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c129_l321_action_invoke");
|
||
|
let result = instance.call("f32.no_regroup_mul_div", &[Value::F32((-3145897700000000000000000000.0f32).to_bits()), Value::F32((-0.000000000000000000000000000000000040864003f32).to_bits()), Value::F32((-9245928300000000000000.0f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((-0.000000000000000000000000000013903848f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 322
|
||
|
fn c130_l322_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c130_l322_action_invoke");
|
||
|
let result = instance.call("f32.no_regroup_mul_div", &[Value::F32((-93157.43f32).to_bits()), Value::F32((-0.00000081292654f32).to_bits()), Value::F32((-0.00000000000000000000000000000000000015469397f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((-489548160000000000000000000000000000.0f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 323
|
||
|
fn c131_l323_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c131_l323_action_invoke");
|
||
|
let result = instance.call("f32.no_regroup_mul_div", &[Value::F32((-0.00000000000000000000000000008899643f32).to_bits()), Value::F32((17887725000000000000000.0f32).to_bits()), Value::F32((514680230000000000000.0f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((-0.0000000000000000000000000030930732f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 324
|
||
|
fn c132_l324_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c132_l324_action_invoke");
|
||
|
let result = instance.call("f32.no_regroup_mul_div", &[Value::F32((9222036000000000000000000000000000.0f32).to_bits()), Value::F32((33330492.0f32).to_bits()), Value::F32((-3253108800000000000000.0f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32(f32::NEG_INFINITY.to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 325
|
||
|
fn c133_l325_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c133_l325_action_invoke");
|
||
|
let result = instance.call("f64.no_regroup_mul_div", &[Value::F64((0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000005698811412550059f64).to_bits()), Value::F64((-0.0000000000000000000000000000000000018313439132919336f64).to_bits()), Value::F64((0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000009543270551003098f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((-1093596114413331100000000000000.0f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 326
|
||
|
fn c134_l326_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c134_l326_action_invoke");
|
||
|
let result = instance.call("f64.no_regroup_mul_div", &[Value::F64((357289288425507550000000000000000000000000000000000000000000000000000000000000000000000000000000000000.0f64).to_bits()), Value::F64((0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003952760844538651f64).to_bits()), Value::F64((-1450781241254900800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.0f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((-0.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000009734611044734945f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 327
|
||
|
fn c135_l327_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c135_l327_action_invoke");
|
||
|
let result = instance.call("f64.no_regroup_mul_div", &[Value::F64((0.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000009124278383497107f64).to_bits()), Value::F64((55561345277147970000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.0f64).to_bits()), Value::F64((0.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000025090826940306507f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((20204881364667663000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.0f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 328
|
||
|
fn c136_l328_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c136_l328_action_invoke");
|
||
|
let result = instance.call("f64.no_regroup_mul_div", &[Value::F64((-4492093000352015000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.0f64).to_bits()), Value::F64((-12087878984017852000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.0f64).to_bits()), Value::F64((-596613380626062300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.0f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64(f64::NEG_INFINITY.to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 329
|
||
|
fn c137_l329_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c137_l329_action_invoke");
|
||
|
let result = instance.call("f64.no_regroup_mul_div", &[Value::F64((0.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000007470269158630455f64).to_bits()), Value::F64((0.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000007568026329781282f64).to_bits()), Value::F64((-0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001055389683973521f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((-0.0f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 333
|
||
|
|
||
|
#[test]
|
||
|
fn test_module_21() {
|
||
|
let mut instance = create_module_21();
|
||
|
// We group the calls together
|
||
|
start_module_21(&mut instance);
|
||
|
c128_l320_action_invoke(&mut instance);
|
||
|
c129_l321_action_invoke(&mut instance);
|
||
|
c130_l322_action_invoke(&mut instance);
|
||
|
c131_l323_action_invoke(&mut instance);
|
||
|
c132_l324_action_invoke(&mut instance);
|
||
|
c133_l325_action_invoke(&mut instance);
|
||
|
c134_l326_action_invoke(&mut instance);
|
||
|
c135_l327_action_invoke(&mut instance);
|
||
|
c136_l328_action_invoke(&mut instance);
|
||
|
c137_l329_action_invoke(&mut instance);
|
||
|
}
|
||
|
fn create_module_22() -> Box<Instance> {
|
||
|
let module_str = "(module
|
||
|
(type (;0;) (func (param f32 f32 f32 f32) (result f32)))
|
||
|
(type (;1;) (func (param f64 f64 f64 f64) (result f64)))
|
||
|
(func (;0;) (type 0) (param f32 f32 f32 f32) (result f32)
|
||
|
get_local 0
|
||
|
get_local 1
|
||
|
f32.add
|
||
|
get_local 2
|
||
|
f32.add
|
||
|
get_local 3
|
||
|
f32.add)
|
||
|
(func (;1;) (type 1) (param f64 f64 f64 f64) (result f64)
|
||
|
get_local 0
|
||
|
get_local 1
|
||
|
f64.add
|
||
|
get_local 2
|
||
|
f64.add
|
||
|
get_local 3
|
||
|
f64.add)
|
||
|
(export \"f32.no_reassociate_add\" (func 0))
|
||
|
(export \"f64.no_reassociate_add\" (func 1)))
|
||
|
";
|
||
|
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_22(instance: &mut Instance) {
|
||
|
// TODO Review is explicit start needed? Start now called in runtime::Instance::new()
|
||
|
//instance.start();
|
||
|
}
|
||
|
|
||
|
// Line 340
|
||
|
fn c139_l340_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c139_l340_action_invoke");
|
||
|
let result = instance.call("f32.no_reassociate_add", &[Value::F32((-24154321000000.0f32).to_bits()), Value::F32((26125812000.0f32).to_bits()), Value::F32((-238608080000000.0f32).to_bits()), Value::F32((-2478953500000.0f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((-265215220000000.0f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 341
|
||
|
fn c140_l341_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c140_l341_action_invoke");
|
||
|
let result = instance.call("f32.no_reassociate_add", &[Value::F32((0.0036181053f32).to_bits()), Value::F32((-0.00985944f32).to_bits()), Value::F32((0.063375376f32).to_bits()), Value::F32((-0.011150199f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((0.04598384f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 342
|
||
|
fn c141_l342_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c141_l342_action_invoke");
|
||
|
let result = instance.call("f32.no_reassociate_add", &[Value::F32((-34206968000.0f32).to_bits()), Value::F32((-3770877200000.0f32).to_bits()), Value::F32((30868425000000.0f32).to_bits()), Value::F32((421132080000.0f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((27484470000000.0f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 343
|
||
|
fn c142_l343_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c142_l343_action_invoke");
|
||
|
let result = instance.call("f32.no_reassociate_add", &[Value::F32((153506400000000.0f32).to_bits()), Value::F32((925114700000000.0f32).to_bits()), Value::F32((-36021854000.0f32).to_bits()), Value::F32((2450846000000000.0f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((3529431000000000.0f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 344
|
||
|
fn c143_l344_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c143_l344_action_invoke");
|
||
|
let result = instance.call("f32.no_reassociate_add", &[Value::F32((470600300000000000000000000000000.0f32).to_bits()), Value::F32((-396552040000000000000000000000000.0f32).to_bits()), Value::F32((48066940000000000000000000000000.0f32).to_bits()), Value::F32((-35644073000000000000000000000.0f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((122079560000000000000000000000000.0f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 345
|
||
|
fn c144_l345_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c144_l345_action_invoke");
|
||
|
let result = instance.call("f64.no_reassociate_add", &[Value::F64((-20704652927717020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.0f64).to_bits()), Value::F64((1594689704376369700000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.0f64).to_bits()), Value::F64((451106636559416130000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.0f64).to_bits()), Value::F64((-1374333509186863300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.0f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((-921652887575998600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.0f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 346
|
||
|
fn c145_l346_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c145_l346_action_invoke");
|
||
|
let result = instance.call("f64.no_reassociate_add", &[Value::F64((0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003485747658213531f64).to_bits()), Value::F64((0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000031210957391311754f64).to_bits()), Value::F64((-0.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000683008546431621f64).to_bits()), Value::F64((-0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002617177347131095f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((-0.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000022324206697150536f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 347
|
||
|
fn c146_l347_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c146_l347_action_invoke");
|
||
|
let result = instance.call("f64.no_reassociate_add", &[Value::F64((-5412584921122726300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.0f64).to_bits()), Value::F64((597603656170379500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.0f64).to_bits()), Value::F64((-355830077793396300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.0f64).to_bits()), Value::F64((373627259957625440000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.0f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((-5768414998318146000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.0f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 348
|
||
|
fn c147_l348_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c147_l348_action_invoke");
|
||
|
let result = instance.call("f64.no_reassociate_add", &[Value::F64((-0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006469047714189599f64).to_bits()), Value::F64((0.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000064286584974746f64).to_bits()), Value::F64((-0.00000000000000000000000000000000000000000000000000000000000000000000000000000021277698072285604f64).to_bits()), Value::F64((0.0000000000000000000000000000000000000000000000000000000000000000000000000000008768287273189493f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((0.0000000000000000000000000000000000000000000000000000000000000000000000000000006640517465960996f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 349
|
||
|
fn c148_l349_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c148_l349_action_invoke");
|
||
|
let result = instance.call("f64.no_reassociate_add", &[Value::F64((-16422137086414828000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.0f64).to_bits()), Value::F64((-88032137939790710000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.0f64).to_bits()), Value::F64((449957059782857850000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.0f64).to_bits()), Value::F64((-114091267166274390000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.0f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((319443655442136560000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.0f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 353
|
||
|
|
||
|
#[test]
|
||
|
fn test_module_22() {
|
||
|
let mut instance = create_module_22();
|
||
|
// We group the calls together
|
||
|
start_module_22(&mut instance);
|
||
|
c139_l340_action_invoke(&mut instance);
|
||
|
c140_l341_action_invoke(&mut instance);
|
||
|
c141_l342_action_invoke(&mut instance);
|
||
|
c142_l343_action_invoke(&mut instance);
|
||
|
c143_l344_action_invoke(&mut instance);
|
||
|
c144_l345_action_invoke(&mut instance);
|
||
|
c145_l346_action_invoke(&mut instance);
|
||
|
c146_l347_action_invoke(&mut instance);
|
||
|
c147_l348_action_invoke(&mut instance);
|
||
|
c148_l349_action_invoke(&mut instance);
|
||
|
}
|
||
|
fn create_module_23() -> Box<Instance> {
|
||
|
let module_str = "(module
|
||
|
(type (;0;) (func (param f32 f32 f32 f32) (result f32)))
|
||
|
(type (;1;) (func (param f64 f64 f64 f64) (result f64)))
|
||
|
(func (;0;) (type 0) (param f32 f32 f32 f32) (result f32)
|
||
|
get_local 0
|
||
|
get_local 1
|
||
|
f32.mul
|
||
|
get_local 2
|
||
|
f32.mul
|
||
|
get_local 3
|
||
|
f32.mul)
|
||
|
(func (;1;) (type 1) (param f64 f64 f64 f64) (result f64)
|
||
|
get_local 0
|
||
|
get_local 1
|
||
|
f64.mul
|
||
|
get_local 2
|
||
|
f64.mul
|
||
|
get_local 3
|
||
|
f64.mul)
|
||
|
(export \"f32.no_reassociate_mul\" (func 0))
|
||
|
(export \"f64.no_reassociate_mul\" (func 1)))
|
||
|
";
|
||
|
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_23(instance: &mut Instance) {
|
||
|
// TODO Review is explicit start needed? Start now called in runtime::Instance::new()
|
||
|
//instance.start();
|
||
|
}
|
||
|
|
||
|
// Line 360
|
||
|
fn c150_l360_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c150_l360_action_invoke");
|
||
|
let result = instance.call("f32.no_reassociate_mul", &[Value::F32((0.00000000000000000000000000000000001904515f32).to_bits()), Value::F32((0.00000000022548861f32).to_bits()), Value::F32((-6964322000000000000000000000000.0f32).to_bits()), Value::F32((0.000000000000000026902832f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((-0.00000000000000000000000000000078764173f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 361
|
||
|
fn c151_l361_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c151_l361_action_invoke");
|
||
|
let result = instance.call("f32.no_reassociate_mul", &[Value::F32((0.000000000000000018733125f32).to_bits()), Value::F32((-7565904000000000000000000000000.0f32).to_bits()), Value::F32((-0.000000000000000000000000000000000000030807684f32).to_bits()), Value::F32((-1592759200000000000000.0f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((-0.0069547286f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 362
|
||
|
fn c152_l362_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c152_l362_action_invoke");
|
||
|
let result = instance.call("f32.no_reassociate_mul", &[Value::F32((0.0000000000000050355575f32).to_bits()), Value::F32((-56466884000000000.0f32).to_bits()), Value::F32((-0.0000000000011740512f32).to_bits()), Value::F32((84984730000000000000000.0f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((28370654000000.0f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 363
|
||
|
fn c153_l363_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c153_l363_action_invoke");
|
||
|
let result = instance.call("f32.no_reassociate_mul", &[Value::F32((0.000000000000000000000000000000046394946f32).to_bits()), Value::F32((254449360000000000000000.0f32).to_bits()), Value::F32((-72460980000000000.0f32).to_bits()), Value::F32((-962511040000000000.0f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((823345100000000000000000000.0f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 364
|
||
|
fn c154_l364_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c154_l364_action_invoke");
|
||
|
let result = instance.call("f32.no_reassociate_mul", &[Value::F32((-0.0000000000000000000000000000019420536f32).to_bits()), Value::F32((0.0000000000000023200355f32).to_bits()), Value::F32((-9.772748f32).to_bits()), Value::F32((864066000000000000.0f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((0.000000000000000000000000035113616f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 365
|
||
|
fn c155_l365_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c155_l365_action_invoke");
|
||
|
let result = instance.call("f64.no_reassociate_mul", &[Value::F64((-0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003109868654414946f64).to_bits()), Value::F64((-20713190487745434000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.0f64).to_bits()), Value::F64((-0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000007162612845524978f64).to_bits()), Value::F64((-88478253295969090000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.0f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((40822261813278614000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.0f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 366
|
||
|
fn c156_l366_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c156_l366_action_invoke");
|
||
|
let result = instance.call("f64.no_reassociate_mul", &[Value::F64((60442716412956810000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.0f64).to_bits()), Value::F64((0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006700545015107397f64).to_bits()), Value::F64((-0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000031469664275798185f64).to_bits()), Value::F64((-6401677295640561500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.0f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((0.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008159057447560471f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 367
|
||
|
fn c157_l367_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c157_l367_action_invoke");
|
||
|
let result = instance.call("f64.no_reassociate_mul", &[Value::F64((0.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002216807720454268f64).to_bits()), Value::F64((-1802234186536721600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.0f64).to_bits()), Value::F64((0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000007500283778521931f64).to_bits()), Value::F64((-414412152433956900000000000.0f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001241793627299937f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 368
|
||
|
fn c158_l368_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c158_l368_action_invoke");
|
||
|
let result = instance.call("f64.no_reassociate_mul", &[Value::F64((24318065966298720000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.0f64).to_bits()), Value::F64((0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006508014075793436f64).to_bits()), Value::F64((17596421287233897000000000000000000000000000000000000000000000000000.0f64).to_bits()), Value::F64((-0.0000001416141401305358f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((-3943741918531223000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.0f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 369
|
||
|
fn c159_l369_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c159_l369_action_invoke");
|
||
|
let result = instance.call("f64.no_reassociate_mul", &[Value::F64((0.00000000000000000000000000000000000000000000000000000000000000000000003849767156964772f64).to_bits()), Value::F64((0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000070008754943224875f64).to_bits()), Value::F64((-2536887825218386500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.0f64).to_bits()), Value::F64((-0.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006101114518858449f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004171548126376117f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 373
|
||
|
|
||
|
#[test]
|
||
|
fn test_module_23() {
|
||
|
let mut instance = create_module_23();
|
||
|
// We group the calls together
|
||
|
start_module_23(&mut instance);
|
||
|
c150_l360_action_invoke(&mut instance);
|
||
|
c151_l361_action_invoke(&mut instance);
|
||
|
c152_l362_action_invoke(&mut instance);
|
||
|
c153_l363_action_invoke(&mut instance);
|
||
|
c154_l364_action_invoke(&mut instance);
|
||
|
c155_l365_action_invoke(&mut instance);
|
||
|
c156_l366_action_invoke(&mut instance);
|
||
|
c157_l367_action_invoke(&mut instance);
|
||
|
c158_l368_action_invoke(&mut instance);
|
||
|
c159_l369_action_invoke(&mut instance);
|
||
|
}
|
||
|
fn create_module_24() -> Box<Instance> {
|
||
|
let module_str = "(module
|
||
|
(type (;0;) (func (param f32) (result f32)))
|
||
|
(type (;1;) (func (param f64) (result f64)))
|
||
|
(func (;0;) (type 0) (param f32) (result f32)
|
||
|
get_local 0
|
||
|
f32.const 0x0p+0 (;=0;)
|
||
|
f32.div)
|
||
|
(func (;1;) (type 1) (param f64) (result f64)
|
||
|
get_local 0
|
||
|
f64.const 0x0p+0 (;=0;)
|
||
|
f64.div)
|
||
|
(export \"f32.no_fold_div_0\" (func 0))
|
||
|
(export \"f64.no_fold_div_0\" (func 1)))
|
||
|
";
|
||
|
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_24(instance: &mut Instance) {
|
||
|
// TODO Review is explicit start needed? Start now called in runtime::Instance::new()
|
||
|
//instance.start();
|
||
|
}
|
||
|
|
||
|
// Line 380
|
||
|
fn c161_l380_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c161_l380_action_invoke");
|
||
|
let result = instance.call("f32.no_fold_div_0", &[Value::F32((1.0f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32(f32::INFINITY.to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 381
|
||
|
fn c162_l381_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c162_l381_action_invoke");
|
||
|
let result = instance.call("f32.no_fold_div_0", &[Value::F32((-1.0f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32(f32::NEG_INFINITY.to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 382
|
||
|
fn c163_l382_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c163_l382_action_invoke");
|
||
|
let result = instance.call("f32.no_fold_div_0", &[Value::F32(f32::INFINITY.to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32(f32::INFINITY.to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 383
|
||
|
fn c164_l383_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c164_l383_action_invoke");
|
||
|
let result = instance.call("f32.no_fold_div_0", &[Value::F32(f32::NEG_INFINITY.to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32(f32::NEG_INFINITY.to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 384
|
||
|
fn c165_l384_assert_return_canonical_nan(instance: &mut Instance) {
|
||
|
println!("Executing function {}", "c165_l384_assert_return_canonical_nan");
|
||
|
let result = instance.call("f32.no_fold_div_0", &[Value::F32((0.0f32).to_bits())]).unwrap().expect("Missing result in c165_l384_assert_return_canonical_nan");
|
||
|
assert!(match result {
|
||
|
Value::F32(fp) => f32::from_bits(fp).is_quiet_nan(),
|
||
|
Value::F64(fp) => f64::from_bits(fp).is_quiet_nan(),
|
||
|
_ => unimplemented!()
|
||
|
})
|
||
|
}
|
||
|
|
||
|
// Line 385
|
||
|
fn c166_l385_assert_return_canonical_nan(instance: &mut Instance) {
|
||
|
println!("Executing function {}", "c166_l385_assert_return_canonical_nan");
|
||
|
let result = instance.call("f32.no_fold_div_0", &[Value::F32((-0.0f32).to_bits())]).unwrap().expect("Missing result in c166_l385_assert_return_canonical_nan");
|
||
|
assert!(match result {
|
||
|
Value::F32(fp) => f32::from_bits(fp).is_quiet_nan(),
|
||
|
Value::F64(fp) => f64::from_bits(fp).is_quiet_nan(),
|
||
|
_ => unimplemented!()
|
||
|
})
|
||
|
}
|
||
|
|
||
|
// Line 386
|
||
|
fn c167_l386_assert_return_arithmetic_nan(instance: &mut Instance) {
|
||
|
println!("Executing function {}", "c167_l386_assert_return_arithmetic_nan");
|
||
|
let result = instance.call("f32.no_fold_div_0", &[Value::F32(f32::from_bits(2141192192) as u32)]).unwrap().expect("Missing result in c167_l386_assert_return_arithmetic_nan");
|
||
|
assert!(match result {
|
||
|
Value::F32(fp) => f32::from_bits(fp).is_quiet_nan(),
|
||
|
Value::F64(fp) => f64::from_bits(fp).is_quiet_nan(),
|
||
|
_ => unimplemented!()
|
||
|
})
|
||
|
}
|
||
|
|
||
|
// Line 387
|
||
|
fn c168_l387_assert_return_canonical_nan(instance: &mut Instance) {
|
||
|
println!("Executing function {}", "c168_l387_assert_return_canonical_nan");
|
||
|
let result = instance.call("f32.no_fold_div_0", &[Value::F32(f32::from_bits(2143289344) as u32)]).unwrap().expect("Missing result in c168_l387_assert_return_canonical_nan");
|
||
|
assert!(match result {
|
||
|
Value::F32(fp) => f32::from_bits(fp).is_quiet_nan(),
|
||
|
Value::F64(fp) => f64::from_bits(fp).is_quiet_nan(),
|
||
|
_ => unimplemented!()
|
||
|
})
|
||
|
}
|
||
|
|
||
|
// Line 388
|
||
|
fn c169_l388_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c169_l388_action_invoke");
|
||
|
let result = instance.call("f64.no_fold_div_0", &[Value::F64((1.0f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64(f64::INFINITY.to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 389
|
||
|
fn c170_l389_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c170_l389_action_invoke");
|
||
|
let result = instance.call("f64.no_fold_div_0", &[Value::F64((-1.0f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64(f64::NEG_INFINITY.to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 390
|
||
|
fn c171_l390_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c171_l390_action_invoke");
|
||
|
let result = instance.call("f64.no_fold_div_0", &[Value::F64(f64::INFINITY.to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64(f64::INFINITY.to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 391
|
||
|
fn c172_l391_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c172_l391_action_invoke");
|
||
|
let result = instance.call("f64.no_fold_div_0", &[Value::F64(f64::NEG_INFINITY.to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64(f64::NEG_INFINITY.to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 392
|
||
|
fn c173_l392_assert_return_canonical_nan(instance: &mut Instance) {
|
||
|
println!("Executing function {}", "c173_l392_assert_return_canonical_nan");
|
||
|
let result = instance.call("f64.no_fold_div_0", &[Value::F64((0.0f64).to_bits())]).unwrap().expect("Missing result in c173_l392_assert_return_canonical_nan");
|
||
|
assert!(match result {
|
||
|
Value::F32(fp) => f32::from_bits(fp).is_quiet_nan(),
|
||
|
Value::F64(fp) => f64::from_bits(fp).is_quiet_nan(),
|
||
|
_ => unimplemented!()
|
||
|
})
|
||
|
}
|
||
|
|
||
|
// Line 393
|
||
|
fn c174_l393_assert_return_canonical_nan(instance: &mut Instance) {
|
||
|
println!("Executing function {}", "c174_l393_assert_return_canonical_nan");
|
||
|
let result = instance.call("f64.no_fold_div_0", &[Value::F64((-0.0f64).to_bits())]).unwrap().expect("Missing result in c174_l393_assert_return_canonical_nan");
|
||
|
assert!(match result {
|
||
|
Value::F32(fp) => f32::from_bits(fp).is_quiet_nan(),
|
||
|
Value::F64(fp) => f64::from_bits(fp).is_quiet_nan(),
|
||
|
_ => unimplemented!()
|
||
|
})
|
||
|
}
|
||
|
|
||
|
// Line 394
|
||
|
fn c175_l394_assert_return_canonical_nan(instance: &mut Instance) {
|
||
|
println!("Executing function {}", "c175_l394_assert_return_canonical_nan");
|
||
|
let result = instance.call("f64.no_fold_div_0", &[Value::F64(f64::from_bits(9221120237041090560) as u64)]).unwrap().expect("Missing result in c175_l394_assert_return_canonical_nan");
|
||
|
assert!(match result {
|
||
|
Value::F32(fp) => f32::from_bits(fp).is_quiet_nan(),
|
||
|
Value::F64(fp) => f64::from_bits(fp).is_quiet_nan(),
|
||
|
_ => unimplemented!()
|
||
|
})
|
||
|
}
|
||
|
|
||
|
// Line 395
|
||
|
fn c176_l395_assert_return_arithmetic_nan(instance: &mut Instance) {
|
||
|
println!("Executing function {}", "c176_l395_assert_return_arithmetic_nan");
|
||
|
let result = instance.call("f64.no_fold_div_0", &[Value::F64(f64::from_bits(9219994337134247936) as u64)]).unwrap().expect("Missing result in c176_l395_assert_return_arithmetic_nan");
|
||
|
assert!(match result {
|
||
|
Value::F32(fp) => f32::from_bits(fp).is_quiet_nan(),
|
||
|
Value::F64(fp) => f64::from_bits(fp).is_quiet_nan(),
|
||
|
_ => unimplemented!()
|
||
|
})
|
||
|
}
|
||
|
|
||
|
// Line 399
|
||
|
|
||
|
#[test]
|
||
|
fn test_module_24() {
|
||
|
let mut instance = create_module_24();
|
||
|
// We group the calls together
|
||
|
start_module_24(&mut instance);
|
||
|
c161_l380_action_invoke(&mut instance);
|
||
|
c162_l381_action_invoke(&mut instance);
|
||
|
c163_l382_action_invoke(&mut instance);
|
||
|
c164_l383_action_invoke(&mut instance);
|
||
|
c165_l384_assert_return_canonical_nan(&mut instance);
|
||
|
c166_l385_assert_return_canonical_nan(&mut instance);
|
||
|
c167_l386_assert_return_arithmetic_nan(&mut instance);
|
||
|
c168_l387_assert_return_canonical_nan(&mut instance);
|
||
|
c169_l388_action_invoke(&mut instance);
|
||
|
c170_l389_action_invoke(&mut instance);
|
||
|
c171_l390_action_invoke(&mut instance);
|
||
|
c172_l391_action_invoke(&mut instance);
|
||
|
c173_l392_assert_return_canonical_nan(&mut instance);
|
||
|
c174_l393_assert_return_canonical_nan(&mut instance);
|
||
|
c175_l394_assert_return_canonical_nan(&mut instance);
|
||
|
c176_l395_assert_return_arithmetic_nan(&mut instance);
|
||
|
}
|
||
|
fn create_module_25() -> Box<Instance> {
|
||
|
let module_str = "(module
|
||
|
(type (;0;) (func (param f32) (result f32)))
|
||
|
(type (;1;) (func (param f64) (result f64)))
|
||
|
(func (;0;) (type 0) (param f32) (result f32)
|
||
|
get_local 0
|
||
|
f32.const -0x0p+0 (;=-0;)
|
||
|
f32.div)
|
||
|
(func (;1;) (type 1) (param f64) (result f64)
|
||
|
get_local 0
|
||
|
f64.const -0x0p+0 (;=-0;)
|
||
|
f64.div)
|
||
|
(export \"f32.no_fold_div_neg0\" (func 0))
|
||
|
(export \"f64.no_fold_div_neg0\" (func 1)))
|
||
|
";
|
||
|
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_25(instance: &mut Instance) {
|
||
|
// TODO Review is explicit start needed? Start now called in runtime::Instance::new()
|
||
|
//instance.start();
|
||
|
}
|
||
|
|
||
|
// Line 406
|
||
|
fn c178_l406_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c178_l406_action_invoke");
|
||
|
let result = instance.call("f32.no_fold_div_neg0", &[Value::F32((1.0f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32(f32::NEG_INFINITY.to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 407
|
||
|
fn c179_l407_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c179_l407_action_invoke");
|
||
|
let result = instance.call("f32.no_fold_div_neg0", &[Value::F32((-1.0f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32(f32::INFINITY.to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 408
|
||
|
fn c180_l408_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c180_l408_action_invoke");
|
||
|
let result = instance.call("f32.no_fold_div_neg0", &[Value::F32(f32::INFINITY.to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32(f32::NEG_INFINITY.to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 409
|
||
|
fn c181_l409_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c181_l409_action_invoke");
|
||
|
let result = instance.call("f32.no_fold_div_neg0", &[Value::F32(f32::NEG_INFINITY.to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32(f32::INFINITY.to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 410
|
||
|
fn c182_l410_assert_return_canonical_nan(instance: &mut Instance) {
|
||
|
println!("Executing function {}", "c182_l410_assert_return_canonical_nan");
|
||
|
let result = instance.call("f32.no_fold_div_neg0", &[Value::F32((0.0f32).to_bits())]).unwrap().expect("Missing result in c182_l410_assert_return_canonical_nan");
|
||
|
assert!(match result {
|
||
|
Value::F32(fp) => f32::from_bits(fp).is_quiet_nan(),
|
||
|
Value::F64(fp) => f64::from_bits(fp).is_quiet_nan(),
|
||
|
_ => unimplemented!()
|
||
|
})
|
||
|
}
|
||
|
|
||
|
// Line 411
|
||
|
fn c183_l411_assert_return_canonical_nan(instance: &mut Instance) {
|
||
|
println!("Executing function {}", "c183_l411_assert_return_canonical_nan");
|
||
|
let result = instance.call("f32.no_fold_div_neg0", &[Value::F32((-0.0f32).to_bits())]).unwrap().expect("Missing result in c183_l411_assert_return_canonical_nan");
|
||
|
assert!(match result {
|
||
|
Value::F32(fp) => f32::from_bits(fp).is_quiet_nan(),
|
||
|
Value::F64(fp) => f64::from_bits(fp).is_quiet_nan(),
|
||
|
_ => unimplemented!()
|
||
|
})
|
||
|
}
|
||
|
|
||
|
// Line 412
|
||
|
fn c184_l412_assert_return_arithmetic_nan(instance: &mut Instance) {
|
||
|
println!("Executing function {}", "c184_l412_assert_return_arithmetic_nan");
|
||
|
let result = instance.call("f32.no_fold_div_neg0", &[Value::F32(f32::from_bits(2141192192) as u32)]).unwrap().expect("Missing result in c184_l412_assert_return_arithmetic_nan");
|
||
|
assert!(match result {
|
||
|
Value::F32(fp) => f32::from_bits(fp).is_quiet_nan(),
|
||
|
Value::F64(fp) => f64::from_bits(fp).is_quiet_nan(),
|
||
|
_ => unimplemented!()
|
||
|
})
|
||
|
}
|
||
|
|
||
|
// Line 413
|
||
|
fn c185_l413_assert_return_canonical_nan(instance: &mut Instance) {
|
||
|
println!("Executing function {}", "c185_l413_assert_return_canonical_nan");
|
||
|
let result = instance.call("f32.no_fold_div_neg0", &[Value::F32(f32::from_bits(2143289344) as u32)]).unwrap().expect("Missing result in c185_l413_assert_return_canonical_nan");
|
||
|
assert!(match result {
|
||
|
Value::F32(fp) => f32::from_bits(fp).is_quiet_nan(),
|
||
|
Value::F64(fp) => f64::from_bits(fp).is_quiet_nan(),
|
||
|
_ => unimplemented!()
|
||
|
})
|
||
|
}
|
||
|
|
||
|
// Line 414
|
||
|
fn c186_l414_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c186_l414_action_invoke");
|
||
|
let result = instance.call("f64.no_fold_div_neg0", &[Value::F64((1.0f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64(f64::NEG_INFINITY.to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 415
|
||
|
fn c187_l415_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c187_l415_action_invoke");
|
||
|
let result = instance.call("f64.no_fold_div_neg0", &[Value::F64((-1.0f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64(f64::INFINITY.to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 416
|
||
|
fn c188_l416_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c188_l416_action_invoke");
|
||
|
let result = instance.call("f64.no_fold_div_neg0", &[Value::F64(f64::INFINITY.to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64(f64::NEG_INFINITY.to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 417
|
||
|
fn c189_l417_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c189_l417_action_invoke");
|
||
|
let result = instance.call("f64.no_fold_div_neg0", &[Value::F64(f64::NEG_INFINITY.to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64(f64::INFINITY.to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 418
|
||
|
fn c190_l418_assert_return_canonical_nan(instance: &mut Instance) {
|
||
|
println!("Executing function {}", "c190_l418_assert_return_canonical_nan");
|
||
|
let result = instance.call("f64.no_fold_div_neg0", &[Value::F64((0.0f64).to_bits())]).unwrap().expect("Missing result in c190_l418_assert_return_canonical_nan");
|
||
|
assert!(match result {
|
||
|
Value::F32(fp) => f32::from_bits(fp).is_quiet_nan(),
|
||
|
Value::F64(fp) => f64::from_bits(fp).is_quiet_nan(),
|
||
|
_ => unimplemented!()
|
||
|
})
|
||
|
}
|
||
|
|
||
|
// Line 419
|
||
|
fn c191_l419_assert_return_canonical_nan(instance: &mut Instance) {
|
||
|
println!("Executing function {}", "c191_l419_assert_return_canonical_nan");
|
||
|
let result = instance.call("f64.no_fold_div_neg0", &[Value::F64((-0.0f64).to_bits())]).unwrap().expect("Missing result in c191_l419_assert_return_canonical_nan");
|
||
|
assert!(match result {
|
||
|
Value::F32(fp) => f32::from_bits(fp).is_quiet_nan(),
|
||
|
Value::F64(fp) => f64::from_bits(fp).is_quiet_nan(),
|
||
|
_ => unimplemented!()
|
||
|
})
|
||
|
}
|
||
|
|
||
|
// Line 420
|
||
|
fn c192_l420_assert_return_canonical_nan(instance: &mut Instance) {
|
||
|
println!("Executing function {}", "c192_l420_assert_return_canonical_nan");
|
||
|
let result = instance.call("f64.no_fold_div_neg0", &[Value::F64(f64::from_bits(9221120237041090560) as u64)]).unwrap().expect("Missing result in c192_l420_assert_return_canonical_nan");
|
||
|
assert!(match result {
|
||
|
Value::F32(fp) => f32::from_bits(fp).is_quiet_nan(),
|
||
|
Value::F64(fp) => f64::from_bits(fp).is_quiet_nan(),
|
||
|
_ => unimplemented!()
|
||
|
})
|
||
|
}
|
||
|
|
||
|
// Line 421
|
||
|
fn c193_l421_assert_return_arithmetic_nan(instance: &mut Instance) {
|
||
|
println!("Executing function {}", "c193_l421_assert_return_arithmetic_nan");
|
||
|
let result = instance.call("f64.no_fold_div_neg0", &[Value::F64(f64::from_bits(9219994337134247936) as u64)]).unwrap().expect("Missing result in c193_l421_assert_return_arithmetic_nan");
|
||
|
assert!(match result {
|
||
|
Value::F32(fp) => f32::from_bits(fp).is_quiet_nan(),
|
||
|
Value::F64(fp) => f64::from_bits(fp).is_quiet_nan(),
|
||
|
_ => unimplemented!()
|
||
|
})
|
||
|
}
|
||
|
|
||
|
// Line 425
|
||
|
|
||
|
#[test]
|
||
|
fn test_module_25() {
|
||
|
let mut instance = create_module_25();
|
||
|
// We group the calls together
|
||
|
start_module_25(&mut instance);
|
||
|
c178_l406_action_invoke(&mut instance);
|
||
|
c179_l407_action_invoke(&mut instance);
|
||
|
c180_l408_action_invoke(&mut instance);
|
||
|
c181_l409_action_invoke(&mut instance);
|
||
|
c182_l410_assert_return_canonical_nan(&mut instance);
|
||
|
c183_l411_assert_return_canonical_nan(&mut instance);
|
||
|
c184_l412_assert_return_arithmetic_nan(&mut instance);
|
||
|
c185_l413_assert_return_canonical_nan(&mut instance);
|
||
|
c186_l414_action_invoke(&mut instance);
|
||
|
c187_l415_action_invoke(&mut instance);
|
||
|
c188_l416_action_invoke(&mut instance);
|
||
|
c189_l417_action_invoke(&mut instance);
|
||
|
c190_l418_assert_return_canonical_nan(&mut instance);
|
||
|
c191_l419_assert_return_canonical_nan(&mut instance);
|
||
|
c192_l420_assert_return_canonical_nan(&mut instance);
|
||
|
c193_l421_assert_return_arithmetic_nan(&mut instance);
|
||
|
}
|
||
|
fn create_module_26() -> Box<Instance> {
|
||
|
let module_str = "(module
|
||
|
(type (;0;) (func (param f32 f32) (result f32)))
|
||
|
(type (;1;) (func (param f64 f64) (result f64)))
|
||
|
(func (;0;) (type 0) (param f32 f32) (result f32)
|
||
|
get_local 0
|
||
|
get_local 0
|
||
|
f32.mul
|
||
|
get_local 1
|
||
|
get_local 1
|
||
|
f32.mul
|
||
|
f32.add
|
||
|
f32.sqrt)
|
||
|
(func (;1;) (type 1) (param f64 f64) (result f64)
|
||
|
get_local 0
|
||
|
get_local 0
|
||
|
f64.mul
|
||
|
get_local 1
|
||
|
get_local 1
|
||
|
f64.mul
|
||
|
f64.add
|
||
|
f64.sqrt)
|
||
|
(export \"f32.no_fold_to_hypot\" (func 0))
|
||
|
(export \"f64.no_fold_to_hypot\" (func 1)))
|
||
|
";
|
||
|
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_26(instance: &mut Instance) {
|
||
|
// TODO Review is explicit start needed? Start now called in runtime::Instance::new()
|
||
|
//instance.start();
|
||
|
}
|
||
|
|
||
|
// Line 434
|
||
|
fn c195_l434_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c195_l434_action_invoke");
|
||
|
let result = instance.call("f32.no_fold_to_hypot", &[Value::F32((0.00000000000000000000000072854914f32).to_bits()), Value::F32((0.0000000000000000000042365796f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((0.0000000000000000000042366535f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 435
|
||
|
fn c196_l435_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c196_l435_action_invoke");
|
||
|
let result = instance.call("f32.no_fold_to_hypot", &[Value::F32((-0.0000000000000000000007470285f32).to_bits()), Value::F32((-0.000000000000000000000000000000007453745f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((0.0000000000000000000007468044f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 436
|
||
|
fn c197_l436_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c197_l436_action_invoke");
|
||
|
let result = instance.call("f32.no_fold_to_hypot", &[Value::F32((-0.0000000000000000000000000000000000770895f32).to_bits()), Value::F32((-0.0000000000000000000032627214f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((0.0000000000000000000032627695f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 437
|
||
|
fn c198_l437_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c198_l437_action_invoke");
|
||
|
let result = instance.call("f32.no_fold_to_hypot", &[Value::F32((-35.42818f32).to_bits()), Value::F32((174209.48f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((174209.5f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 438
|
||
|
fn c199_l438_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c199_l438_action_invoke");
|
||
|
let result = instance.call("f32.no_fold_to_hypot", &[Value::F32((0.000000000000000000000020628143f32).to_bits()), Value::F32((-0.00000000000000000000046344753f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((0.000000000000000000000463032f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 439
|
||
|
fn c200_l439_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c200_l439_action_invoke");
|
||
|
let result = instance.call("f64.no_fold_to_hypot", &[Value::F64((0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003863640258986321f64).to_bits()), Value::F64((0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000019133014752624014f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000019120893753235554f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 440
|
||
|
fn c201_l440_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c201_l440_action_invoke");
|
||
|
let result = instance.call("f64.no_fold_to_hypot", &[Value::F64((138561238950329770000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.0f64).to_bits()), Value::F64((-2828038515930043000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.0f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((2828038519324483400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.0f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 441
|
||
|
fn c202_l441_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c202_l441_action_invoke");
|
||
|
let result = instance.call("f64.no_fold_to_hypot", &[Value::F64((0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006502729096641792f64).to_bits()), Value::F64((-0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004544399933151275f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006668276248455232f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 442
|
||
|
fn c203_l442_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c203_l442_action_invoke");
|
||
|
let result = instance.call("f64.no_fold_to_hypot", &[Value::F64((-0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000022340232024202604f64).to_bits()), Value::F64((0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003435929714143315f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000022340232023799234f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 443
|
||
|
fn c204_l443_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c204_l443_action_invoke");
|
||
|
let result = instance.call("f64.no_fold_to_hypot", &[Value::F64((0.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002797963998630554f64).to_bits()), Value::F64((-0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001906867996862016f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000019068679968620105f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 447
|
||
|
|
||
|
#[test]
|
||
|
fn test_module_26() {
|
||
|
let mut instance = create_module_26();
|
||
|
// We group the calls together
|
||
|
start_module_26(&mut instance);
|
||
|
c195_l434_action_invoke(&mut instance);
|
||
|
c196_l435_action_invoke(&mut instance);
|
||
|
c197_l436_action_invoke(&mut instance);
|
||
|
c198_l437_action_invoke(&mut instance);
|
||
|
c199_l438_action_invoke(&mut instance);
|
||
|
c200_l439_action_invoke(&mut instance);
|
||
|
c201_l440_action_invoke(&mut instance);
|
||
|
c202_l441_action_invoke(&mut instance);
|
||
|
c203_l442_action_invoke(&mut instance);
|
||
|
c204_l443_action_invoke(&mut instance);
|
||
|
}
|
||
|
fn create_module_27() -> Box<Instance> {
|
||
|
let module_str = "(module
|
||
|
(type (;0;) (func (param f32) (result f32)))
|
||
|
(func (;0;) (type 0) (param f32) (result f32)
|
||
|
f32.const 0x1p+0 (;=1;)
|
||
|
get_local 0
|
||
|
f32.div)
|
||
|
(export \"f32.no_approximate_reciprocal\" (func 0)))
|
||
|
";
|
||
|
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_27(instance: &mut Instance) {
|
||
|
// TODO Review is explicit start needed? Start now called in runtime::Instance::new()
|
||
|
//instance.start();
|
||
|
}
|
||
|
|
||
|
// Line 452
|
||
|
fn c206_l452_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c206_l452_action_invoke");
|
||
|
let result = instance.call("f32.no_approximate_reciprocal", &[Value::F32((-0.0011329757f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((-882.6315f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 453
|
||
|
fn c207_l453_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c207_l453_action_invoke");
|
||
|
let result = instance.call("f32.no_approximate_reciprocal", &[Value::F32((323753010000000000000000000000000000000.0f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((0.000000000000000000000000000000000000003088774f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 454
|
||
|
fn c208_l454_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c208_l454_action_invoke");
|
||
|
let result = instance.call("f32.no_approximate_reciprocal", &[Value::F32((-0.0000000000000000000000000001272599f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((-7857934600000000000000000000.0f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 455
|
||
|
fn c209_l455_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c209_l455_action_invoke");
|
||
|
let result = instance.call("f32.no_approximate_reciprocal", &[Value::F32((103020680000000000000000.0f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((0.000000000000000000000009706789f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 456
|
||
|
fn c210_l456_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c210_l456_action_invoke");
|
||
|
let result = instance.call("f32.no_approximate_reciprocal", &[Value::F32((-0.00000000000000000000000028443763f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((-3515709300000000000000000.0f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 460
|
||
|
|
||
|
#[test]
|
||
|
fn test_module_27() {
|
||
|
let mut instance = create_module_27();
|
||
|
// We group the calls together
|
||
|
start_module_27(&mut instance);
|
||
|
c206_l452_action_invoke(&mut instance);
|
||
|
c207_l453_action_invoke(&mut instance);
|
||
|
c208_l454_action_invoke(&mut instance);
|
||
|
c209_l455_action_invoke(&mut instance);
|
||
|
c210_l456_action_invoke(&mut instance);
|
||
|
}
|
||
|
fn create_module_28() -> Box<Instance> {
|
||
|
let module_str = "(module
|
||
|
(type (;0;) (func (param f32) (result f32)))
|
||
|
(type (;1;) (func (param f64) (result f64)))
|
||
|
(func (;0;) (type 0) (param f32) (result f32)
|
||
|
f32.const 0x1p+0 (;=1;)
|
||
|
get_local 0
|
||
|
f32.sqrt
|
||
|
f32.div)
|
||
|
(func (;1;) (type 1) (param f64) (result f64)
|
||
|
f64.const 0x1p+0 (;=1;)
|
||
|
get_local 0
|
||
|
f64.sqrt
|
||
|
f64.div)
|
||
|
(export \"f32.no_approximate_reciprocal_sqrt\" (func 0))
|
||
|
(export \"f64.no_fuse_reciprocal_sqrt\" (func 1)))
|
||
|
";
|
||
|
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_28(instance: &mut Instance) {
|
||
|
// TODO Review is explicit start needed? Start now called in runtime::Instance::new()
|
||
|
//instance.start();
|
||
|
}
|
||
|
|
||
|
// Line 467
|
||
|
fn c212_l467_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c212_l467_action_invoke");
|
||
|
let result = instance.call("f32.no_approximate_reciprocal_sqrt", &[Value::F32((0.00000000000016117865f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((2490842.5f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 468
|
||
|
fn c213_l468_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c213_l468_action_invoke");
|
||
|
let result = instance.call("f32.no_approximate_reciprocal_sqrt", &[Value::F32((0.0074491366f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((11.58636f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 469
|
||
|
fn c214_l469_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c214_l469_action_invoke");
|
||
|
let result = instance.call("f32.no_approximate_reciprocal_sqrt", &[Value::F32((0.00000000000000000002339817f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((6537460000.0f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 470
|
||
|
fn c215_l470_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c215_l470_action_invoke");
|
||
|
let result = instance.call("f32.no_approximate_reciprocal_sqrt", &[Value::F32((0.00000000000011123504f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((2998328.3f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 471
|
||
|
fn c216_l471_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c216_l471_action_invoke");
|
||
|
let result = instance.call("f32.no_approximate_reciprocal_sqrt", &[Value::F32((0.000000000000000000000000017653063f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((7526446300000.0f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 473
|
||
|
fn c217_l473_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c217_l473_action_invoke");
|
||
|
let result = instance.call("f64.no_fuse_reciprocal_sqrt", &[Value::F64((4472459252766337000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.0f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000014952947335898096f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 474
|
||
|
fn c218_l474_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c218_l474_action_invoke");
|
||
|
let result = instance.call("f64.no_fuse_reciprocal_sqrt", &[Value::F64((4752392260007119000000000000000000000000000000000000000000000000000000000000000000000000000000.0f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((0.000000000000000000000000000000000000000000000014505872638954843f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 475
|
||
|
fn c219_l475_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c219_l475_action_invoke");
|
||
|
let result = instance.call("f64.no_fuse_reciprocal_sqrt", &[Value::F64((29014415885392436000000000000000.0f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((0.00000000000000018564920084793608f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 476
|
||
|
fn c220_l476_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c220_l476_action_invoke");
|
||
|
let result = instance.call("f64.no_fuse_reciprocal_sqrt", &[Value::F64((1396612507697477800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.0f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000026758516751072132f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 477
|
||
|
fn c221_l477_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c221_l477_action_invoke");
|
||
|
let result = instance.call("f64.no_fuse_reciprocal_sqrt", &[Value::F64((151596415440704430000000000000000000000000000.0f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((0.00000000000000000000008121860649480894f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 481
|
||
|
|
||
|
#[test]
|
||
|
fn test_module_28() {
|
||
|
let mut instance = create_module_28();
|
||
|
// We group the calls together
|
||
|
start_module_28(&mut instance);
|
||
|
c212_l467_action_invoke(&mut instance);
|
||
|
c213_l468_action_invoke(&mut instance);
|
||
|
c214_l469_action_invoke(&mut instance);
|
||
|
c215_l470_action_invoke(&mut instance);
|
||
|
c216_l471_action_invoke(&mut instance);
|
||
|
c217_l473_action_invoke(&mut instance);
|
||
|
c218_l474_action_invoke(&mut instance);
|
||
|
c219_l475_action_invoke(&mut instance);
|
||
|
c220_l476_action_invoke(&mut instance);
|
||
|
c221_l477_action_invoke(&mut instance);
|
||
|
}
|
||
|
fn create_module_29() -> Box<Instance> {
|
||
|
let module_str = "(module
|
||
|
(type (;0;) (func (param f32) (result f32)))
|
||
|
(func (;0;) (type 0) (param f32) (result f32)
|
||
|
f32.const 0x1p+0 (;=1;)
|
||
|
get_local 0
|
||
|
f32.div
|
||
|
f32.sqrt)
|
||
|
(export \"f32.no_approximate_sqrt_reciprocal\" (func 0)))
|
||
|
";
|
||
|
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_29(instance: &mut Instance) {
|
||
|
// TODO Review is explicit start needed? Start now called in runtime::Instance::new()
|
||
|
//instance.start();
|
||
|
}
|
||
|
|
||
|
// Line 486
|
||
|
fn c223_l486_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c223_l486_action_invoke");
|
||
|
let result = instance.call("f32.no_approximate_sqrt_reciprocal", &[Value::F32((1895057100000000000.0f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((0.00000000072642176f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 487
|
||
|
fn c224_l487_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c224_l487_action_invoke");
|
||
|
let result = instance.call("f32.no_approximate_sqrt_reciprocal", &[Value::F32((0.002565894f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((19.741522f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 488
|
||
|
fn c225_l488_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c225_l488_action_invoke");
|
||
|
let result = instance.call("f32.no_approximate_sqrt_reciprocal", &[Value::F32((632654500000000000000.0f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((0.000000000039757284f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 489
|
||
|
fn c226_l489_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c226_l489_action_invoke");
|
||
|
let result = instance.call("f32.no_approximate_sqrt_reciprocal", &[Value::F32((14153.539f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((0.008405576f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 490
|
||
|
fn c227_l490_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c227_l490_action_invoke");
|
||
|
let result = instance.call("f32.no_approximate_sqrt_reciprocal", &[Value::F32((26173730000000000000000000000000.0f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((0.00000000000000019546418f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 494
|
||
|
|
||
|
#[test]
|
||
|
fn test_module_29() {
|
||
|
let mut instance = create_module_29();
|
||
|
// We group the calls together
|
||
|
start_module_29(&mut instance);
|
||
|
c223_l486_action_invoke(&mut instance);
|
||
|
c224_l487_action_invoke(&mut instance);
|
||
|
c225_l488_action_invoke(&mut instance);
|
||
|
c226_l489_action_invoke(&mut instance);
|
||
|
c227_l490_action_invoke(&mut instance);
|
||
|
}
|
||
|
fn create_module_30() -> Box<Instance> {
|
||
|
let module_str = "(module
|
||
|
(type (;0;) (func (param i32) (result i32)))
|
||
|
(type (;1;) (func (param i64) (result i64)))
|
||
|
(func (;0;) (type 0) (param i32) (result i32)
|
||
|
get_local 0
|
||
|
f32.convert_s/i32
|
||
|
i32.trunc_s/f32)
|
||
|
(func (;1;) (type 0) (param i32) (result i32)
|
||
|
get_local 0
|
||
|
f32.convert_u/i32
|
||
|
i32.trunc_u/f32)
|
||
|
(func (;2;) (type 1) (param i64) (result i64)
|
||
|
get_local 0
|
||
|
f64.convert_s/i64
|
||
|
i64.trunc_s/f64)
|
||
|
(func (;3;) (type 1) (param i64) (result i64)
|
||
|
get_local 0
|
||
|
f64.convert_u/i64
|
||
|
i64.trunc_u/f64)
|
||
|
(export \"i32.no_fold_f32_s\" (func 0))
|
||
|
(export \"i32.no_fold_f32_u\" (func 1))
|
||
|
(export \"i64.no_fold_f64_s\" (func 2))
|
||
|
(export \"i64.no_fold_f64_u\" (func 3)))
|
||
|
";
|
||
|
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_30(instance: &mut Instance) {
|
||
|
// TODO Review is explicit start needed? Start now called in runtime::Instance::new()
|
||
|
//instance.start();
|
||
|
}
|
||
|
|
||
|
// Line 505
|
||
|
fn c229_l505_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c229_l505_action_invoke");
|
||
|
let result = instance.call("i32.no_fold_f32_s", &[Value::I32(16777216 as i32)]);
|
||
|
assert_eq!(result, Ok(Some(Value::I32(16777216 as i32))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 506
|
||
|
fn c230_l506_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c230_l506_action_invoke");
|
||
|
let result = instance.call("i32.no_fold_f32_s", &[Value::I32(16777217 as i32)]);
|
||
|
assert_eq!(result, Ok(Some(Value::I32(16777216 as i32))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 507
|
||
|
fn c231_l507_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c231_l507_action_invoke");
|
||
|
let result = instance.call("i32.no_fold_f32_s", &[Value::I32(-268435440 as i32)]);
|
||
|
assert_eq!(result, Ok(Some(Value::I32(-268435440 as i32))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 509
|
||
|
fn c232_l509_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c232_l509_action_invoke");
|
||
|
let result = instance.call("i32.no_fold_f32_u", &[Value::I32(16777216 as i32)]);
|
||
|
assert_eq!(result, Ok(Some(Value::I32(16777216 as i32))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 510
|
||
|
fn c233_l510_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c233_l510_action_invoke");
|
||
|
let result = instance.call("i32.no_fold_f32_u", &[Value::I32(16777217 as i32)]);
|
||
|
assert_eq!(result, Ok(Some(Value::I32(16777216 as i32))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 511
|
||
|
fn c234_l511_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c234_l511_action_invoke");
|
||
|
let result = instance.call("i32.no_fold_f32_u", &[Value::I32(-268435440 as i32)]);
|
||
|
assert_eq!(result, Ok(Some(Value::I32(-268435456 as i32))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 513
|
||
|
fn c235_l513_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c235_l513_action_invoke");
|
||
|
let result = instance.call("i64.no_fold_f64_s", &[Value::I64(9007199254740992 as i64)]);
|
||
|
assert_eq!(result, Ok(Some(Value::I64(9007199254740992 as i64))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 514
|
||
|
fn c236_l514_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c236_l514_action_invoke");
|
||
|
let result = instance.call("i64.no_fold_f64_s", &[Value::I64(9007199254740993 as i64)]);
|
||
|
assert_eq!(result, Ok(Some(Value::I64(9007199254740992 as i64))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 515
|
||
|
fn c237_l515_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c237_l515_action_invoke");
|
||
|
let result = instance.call("i64.no_fold_f64_s", &[Value::I64(-1152921504606845952 as i64)]);
|
||
|
assert_eq!(result, Ok(Some(Value::I64(-1152921504606845952 as i64))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 517
|
||
|
fn c238_l517_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c238_l517_action_invoke");
|
||
|
let result = instance.call("i64.no_fold_f64_u", &[Value::I64(9007199254740992 as i64)]);
|
||
|
assert_eq!(result, Ok(Some(Value::I64(9007199254740992 as i64))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 518
|
||
|
fn c239_l518_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c239_l518_action_invoke");
|
||
|
let result = instance.call("i64.no_fold_f64_u", &[Value::I64(9007199254740993 as i64)]);
|
||
|
assert_eq!(result, Ok(Some(Value::I64(9007199254740992 as i64))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 519
|
||
|
fn c240_l519_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c240_l519_action_invoke");
|
||
|
let result = instance.call("i64.no_fold_f64_u", &[Value::I64(-1152921504606845952 as i64)]);
|
||
|
assert_eq!(result, Ok(Some(Value::I64(-1152921504606846976 as i64))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 523
|
||
|
|
||
|
#[test]
|
||
|
fn test_module_30() {
|
||
|
let mut instance = create_module_30();
|
||
|
// We group the calls together
|
||
|
start_module_30(&mut instance);
|
||
|
c229_l505_action_invoke(&mut instance);
|
||
|
c230_l506_action_invoke(&mut instance);
|
||
|
c231_l507_action_invoke(&mut instance);
|
||
|
c232_l509_action_invoke(&mut instance);
|
||
|
c233_l510_action_invoke(&mut instance);
|
||
|
c234_l511_action_invoke(&mut instance);
|
||
|
c235_l513_action_invoke(&mut instance);
|
||
|
c236_l514_action_invoke(&mut instance);
|
||
|
c237_l515_action_invoke(&mut instance);
|
||
|
c238_l517_action_invoke(&mut instance);
|
||
|
c239_l518_action_invoke(&mut instance);
|
||
|
c240_l519_action_invoke(&mut instance);
|
||
|
}
|
||
|
fn create_module_31() -> Box<Instance> {
|
||
|
let module_str = "(module
|
||
|
(type (;0;) (func (param f32 f32) (result f32)))
|
||
|
(type (;1;) (func (param f64 f64) (result f64)))
|
||
|
(func (;0;) (type 0) (param f32 f32) (result f32)
|
||
|
get_local 0
|
||
|
get_local 1
|
||
|
f32.add
|
||
|
get_local 1
|
||
|
f32.sub)
|
||
|
(func (;1;) (type 1) (param f64 f64) (result f64)
|
||
|
get_local 0
|
||
|
get_local 1
|
||
|
f64.add
|
||
|
get_local 1
|
||
|
f64.sub)
|
||
|
(export \"f32.no_fold_add_sub\" (func 0))
|
||
|
(export \"f64.no_fold_add_sub\" (func 1)))
|
||
|
";
|
||
|
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_31(instance: &mut Instance) {
|
||
|
// TODO Review is explicit start needed? Start now called in runtime::Instance::new()
|
||
|
//instance.start();
|
||
|
}
|
||
|
|
||
|
// Line 530
|
||
|
fn c242_l530_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c242_l530_action_invoke");
|
||
|
let result = instance.call("f32.no_fold_add_sub", &[Value::F32((0.000000000000012138282f32).to_bits()), Value::F32((-0.000000020946384f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((0.000000000000012434498f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 531
|
||
|
fn c243_l531_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c243_l531_action_invoke");
|
||
|
let result = instance.call("f32.no_fold_add_sub", &[Value::F32((-0.00000019768197f32).to_bits()), Value::F32((0.0000037154566f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((-0.00000019768208f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 532
|
||
|
fn c244_l532_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c244_l532_action_invoke");
|
||
|
let result = instance.call("f32.no_fold_add_sub", &[Value::F32((-9596213000000000000000000.0f32).to_bits()), Value::F32((-3538041400000000000000000000000.0f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((-9671407000000000000000000.0f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 533
|
||
|
fn c245_l533_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c245_l533_action_invoke");
|
||
|
let result = instance.call("f32.no_fold_add_sub", &[Value::F32((0.000000000000000000000005054346f32).to_bits()), Value::F32((0.000000000000000024572656f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((0.0000000000000000000000049630837f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 534
|
||
|
fn c246_l534_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c246_l534_action_invoke");
|
||
|
let result = instance.call("f32.no_fold_add_sub", &[Value::F32((-0.0000000000000000000000000000000033693147f32).to_bits()), Value::F32((-0.000000000000000000000000071014917f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((-0.000000000000000000000000000000006162976f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 536
|
||
|
fn c247_l536_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c247_l536_action_invoke");
|
||
|
let result = instance.call("f64.no_fold_add_sub", &[Value::F64((-0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008445702651973109f64).to_bits()), Value::F64((0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001110684389828854f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((-0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008445702651873978f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 537
|
||
|
fn c248_l537_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c248_l537_action_invoke");
|
||
|
let result = instance.call("f64.no_fold_add_sub", &[Value::F64((0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008198798715927055f64).to_bits()), Value::F64((0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004624035606110903f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008198798715897085f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 538
|
||
|
fn c249_l538_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c249_l538_action_invoke");
|
||
|
let result = instance.call("f64.no_fold_add_sub", &[Value::F64((-0.0000000013604511322066714f64).to_bits()), Value::F64((-0.1751431740707098f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((-0.0000000013604511406306585f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 539
|
||
|
fn c250_l539_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c250_l539_action_invoke");
|
||
|
let result = instance.call("f64.no_fold_add_sub", &[Value::F64((-0.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003944335437865966f64).to_bits()), Value::F64((0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001663809741322667f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((-0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000039443355500325104f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 540
|
||
|
fn c251_l540_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c251_l540_action_invoke");
|
||
|
let result = instance.call("f64.no_fold_add_sub", &[Value::F64((-0.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000005078309818866f64).to_bits()), Value::F64((-0.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010790431644461104f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((-0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000507831047937567f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 544
|
||
|
|
||
|
#[test]
|
||
|
fn test_module_31() {
|
||
|
let mut instance = create_module_31();
|
||
|
// We group the calls together
|
||
|
start_module_31(&mut instance);
|
||
|
c242_l530_action_invoke(&mut instance);
|
||
|
c243_l531_action_invoke(&mut instance);
|
||
|
c244_l532_action_invoke(&mut instance);
|
||
|
c245_l533_action_invoke(&mut instance);
|
||
|
c246_l534_action_invoke(&mut instance);
|
||
|
c247_l536_action_invoke(&mut instance);
|
||
|
c248_l537_action_invoke(&mut instance);
|
||
|
c249_l538_action_invoke(&mut instance);
|
||
|
c250_l539_action_invoke(&mut instance);
|
||
|
c251_l540_action_invoke(&mut instance);
|
||
|
}
|
||
|
fn create_module_32() -> Box<Instance> {
|
||
|
let module_str = "(module
|
||
|
(type (;0;) (func (param f32 f32) (result f32)))
|
||
|
(type (;1;) (func (param f64 f64) (result f64)))
|
||
|
(func (;0;) (type 0) (param f32 f32) (result f32)
|
||
|
get_local 0
|
||
|
get_local 1
|
||
|
f32.sub
|
||
|
get_local 1
|
||
|
f32.add)
|
||
|
(func (;1;) (type 1) (param f64 f64) (result f64)
|
||
|
get_local 0
|
||
|
get_local 1
|
||
|
f64.sub
|
||
|
get_local 1
|
||
|
f64.add)
|
||
|
(export \"f32.no_fold_sub_add\" (func 0))
|
||
|
(export \"f64.no_fold_sub_add\" (func 1)))
|
||
|
";
|
||
|
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_32(instance: &mut Instance) {
|
||
|
// TODO Review is explicit start needed? Start now called in runtime::Instance::new()
|
||
|
//instance.start();
|
||
|
}
|
||
|
|
||
|
// Line 551
|
||
|
fn c253_l551_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c253_l551_action_invoke");
|
||
|
let result = instance.call("f32.no_fold_sub_add", &[Value::F32((-676.47437f32).to_bits()), Value::F32((403.0368f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((-676.4744f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 552
|
||
|
fn c254_l552_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c254_l552_action_invoke");
|
||
|
let result = instance.call("f32.no_fold_sub_add", &[Value::F32((-0.0000000000000000000000000000000006305943f32).to_bits()), Value::F32((0.0000000000000000000000000000367186f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((-0.00000000000000000000000000000000063194576f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 553
|
||
|
fn c255_l553_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c255_l553_action_invoke");
|
||
|
let result = instance.call("f32.no_fold_sub_add", &[Value::F32((83184800.0f32).to_bits()), Value::F32((46216217000.0f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((83185660.0f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 554
|
||
|
fn c256_l554_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c256_l554_action_invoke");
|
||
|
let result = instance.call("f32.no_fold_sub_add", &[Value::F32((0.000000000002211957f32).to_bits()), Value::F32((-0.00000001043793f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((0.0000000000022115643f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 555
|
||
|
fn c257_l555_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c257_l555_action_invoke");
|
||
|
let result = instance.call("f32.no_fold_sub_add", &[Value::F32((0.14944395f32).to_bits()), Value::F32((-27393.65f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((0.15039063f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 557
|
||
|
fn c258_l557_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c258_l557_action_invoke");
|
||
|
let result = instance.call("f64.no_fold_sub_add", &[Value::F64((90365982617946240000000000000000000000000000000000000000000000000000000000000.0f64).to_bits()), Value::F64((-958186427535552000000000000000000000000000000000000000000000000000000000000000.0f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((90365982617946280000000000000000000000000000000000000000000000000000000000000.0f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 558
|
||
|
fn c259_l558_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c259_l558_action_invoke");
|
||
|
let result = instance.call("f64.no_fold_sub_add", &[Value::F64((0.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000044230403564658815f64).to_bits()), Value::F64((0.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000026713491049366576f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004423040356647721f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 559
|
||
|
fn c260_l559_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c260_l559_action_invoke");
|
||
|
let result = instance.call("f64.no_fold_sub_add", &[Value::F64((4095348452776429000000000000000000000000000000000000000000000000000000000000.0f64).to_bits()), Value::F64((-4050190019576568700000000000000000000000000000000000000000000000000000000000000000000000000.0f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((4070815637249397500000000000000000000000000000000000000000000000000000000000.0f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 560
|
||
|
fn c261_l560_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c261_l560_action_invoke");
|
||
|
let result = instance.call("f64.no_fold_sub_add", &[Value::F64((0.000000024008889207554433f64).to_bits()), Value::F64((-0.00017253797929188484f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((0.00000002400888920756506f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 561
|
||
|
fn c262_l561_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c262_l561_action_invoke");
|
||
|
let result = instance.call("f64.no_fold_sub_add", &[Value::F64((0.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000043367542918305866f64).to_bits()), Value::F64((-0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000039597706708227122f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004336754291830597f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 565
|
||
|
|
||
|
#[test]
|
||
|
fn test_module_32() {
|
||
|
let mut instance = create_module_32();
|
||
|
// We group the calls together
|
||
|
start_module_32(&mut instance);
|
||
|
c253_l551_action_invoke(&mut instance);
|
||
|
c254_l552_action_invoke(&mut instance);
|
||
|
c255_l553_action_invoke(&mut instance);
|
||
|
c256_l554_action_invoke(&mut instance);
|
||
|
c257_l555_action_invoke(&mut instance);
|
||
|
c258_l557_action_invoke(&mut instance);
|
||
|
c259_l558_action_invoke(&mut instance);
|
||
|
c260_l559_action_invoke(&mut instance);
|
||
|
c261_l560_action_invoke(&mut instance);
|
||
|
c262_l561_action_invoke(&mut instance);
|
||
|
}
|
||
|
fn create_module_33() -> Box<Instance> {
|
||
|
let module_str = "(module
|
||
|
(type (;0;) (func (param f32 f32) (result f32)))
|
||
|
(type (;1;) (func (param f64 f64) (result f64)))
|
||
|
(func (;0;) (type 0) (param f32 f32) (result f32)
|
||
|
get_local 0
|
||
|
get_local 1
|
||
|
f32.mul
|
||
|
get_local 1
|
||
|
f32.div)
|
||
|
(func (;1;) (type 1) (param f64 f64) (result f64)
|
||
|
get_local 0
|
||
|
get_local 1
|
||
|
f64.mul
|
||
|
get_local 1
|
||
|
f64.div)
|
||
|
(export \"f32.no_fold_mul_div\" (func 0))
|
||
|
(export \"f64.no_fold_mul_div\" (func 1)))
|
||
|
";
|
||
|
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_33(instance: &mut Instance) {
|
||
|
// TODO Review is explicit start needed? Start now called in runtime::Instance::new()
|
||
|
//instance.start();
|
||
|
}
|
||
|
|
||
|
// Line 572
|
||
|
fn c264_l572_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c264_l572_action_invoke");
|
||
|
let result = instance.call("f32.no_fold_mul_div", &[Value::F32((-32476715000000000.0f32).to_bits()), Value::F32((0.000000000000010121375f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((-32476713000000000.0f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 573
|
||
|
fn c265_l573_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c265_l573_action_invoke");
|
||
|
let result = instance.call("f32.no_fold_mul_div", &[Value::F32((-0.000000015561163f32).to_bits()), Value::F32((0.000000000000000000000000000000015799828f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((-0.000000015561145f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 574
|
||
|
fn c266_l574_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c266_l574_action_invoke");
|
||
|
let result = instance.call("f32.no_fold_mul_div", &[Value::F32((-0.00000000000000676311f32).to_bits()), Value::F32((-441324000000000.0f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((-0.0000000000000067631096f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 575
|
||
|
fn c267_l575_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c267_l575_action_invoke");
|
||
|
let result = instance.call("f32.no_fold_mul_div", &[Value::F32((7505613700000000.0f32).to_bits()), Value::F32((-2160384100000000000.0f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((7505613000000000.0f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 576
|
||
|
fn c268_l576_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c268_l576_action_invoke");
|
||
|
let result = instance.call("f32.no_fold_mul_div", &[Value::F32((-0.0000000000000000000000000002362576f32).to_bits()), Value::F32((-0.000000000010808759f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((-0.00000000000000000000000000023625765f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 578
|
||
|
fn c269_l578_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c269_l578_action_invoke");
|
||
|
let result = instance.call("f64.no_fold_mul_div", &[Value::F64((-0.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000013532103713575586f64).to_bits()), Value::F64((-0.00000000000000000000000000000000000000000000000000000000000003347836467564916f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((-0.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000013532103713672434f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 579
|
||
|
fn c270_l579_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c270_l579_action_invoke");
|
||
|
let result = instance.call("f64.no_fold_mul_div", &[Value::F64((77662174313180845000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.0f64).to_bits()), Value::F64((195959155606939530000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.0f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((77662174313180850000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.0f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 580
|
||
|
fn c271_l580_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c271_l580_action_invoke");
|
||
|
let result = instance.call("f64.no_fold_mul_div", &[Value::F64((-718011781190294800000000000000000000000000000000000000000000000000000000.0f64).to_bits()), Value::F64((-0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000009320036042623636f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((-718011781190294750000000000000000000000000000000000000000000000000000000.0f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 581
|
||
|
fn c272_l581_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c272_l581_action_invoke");
|
||
|
let result = instance.call("f64.no_fold_mul_div", &[Value::F64((0.000000000000000000000000000000000000000000000000017260010724693063f64).to_bits()), Value::F64((0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003568792428129926f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((0.00000000000000000000000000000000000000000000000001661286799244216f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 582
|
||
|
fn c273_l582_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c273_l582_action_invoke");
|
||
|
let result = instance.call("f64.no_fold_mul_div", &[Value::F64((-9145223045828962000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.0f64).to_bits()), Value::F64((-0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000005562094034342845f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((-9145223045828963000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.0f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 586
|
||
|
|
||
|
#[test]
|
||
|
fn test_module_33() {
|
||
|
let mut instance = create_module_33();
|
||
|
// We group the calls together
|
||
|
start_module_33(&mut instance);
|
||
|
c264_l572_action_invoke(&mut instance);
|
||
|
c265_l573_action_invoke(&mut instance);
|
||
|
c266_l574_action_invoke(&mut instance);
|
||
|
c267_l575_action_invoke(&mut instance);
|
||
|
c268_l576_action_invoke(&mut instance);
|
||
|
c269_l578_action_invoke(&mut instance);
|
||
|
c270_l579_action_invoke(&mut instance);
|
||
|
c271_l580_action_invoke(&mut instance);
|
||
|
c272_l581_action_invoke(&mut instance);
|
||
|
c273_l582_action_invoke(&mut instance);
|
||
|
}
|
||
|
fn create_module_34() -> Box<Instance> {
|
||
|
let module_str = "(module
|
||
|
(type (;0;) (func (param f32 f32) (result f32)))
|
||
|
(type (;1;) (func (param f64 f64) (result f64)))
|
||
|
(func (;0;) (type 0) (param f32 f32) (result f32)
|
||
|
get_local 0
|
||
|
get_local 1
|
||
|
f32.div
|
||
|
get_local 1
|
||
|
f32.mul)
|
||
|
(func (;1;) (type 1) (param f64 f64) (result f64)
|
||
|
get_local 0
|
||
|
get_local 1
|
||
|
f64.div
|
||
|
get_local 1
|
||
|
f64.mul)
|
||
|
(export \"f32.no_fold_div_mul\" (func 0))
|
||
|
(export \"f64.no_fold_div_mul\" (func 1)))
|
||
|
";
|
||
|
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_34(instance: &mut Instance) {
|
||
|
// TODO Review is explicit start needed? Start now called in runtime::Instance::new()
|
||
|
//instance.start();
|
||
|
}
|
||
|
|
||
|
// Line 593
|
||
|
fn c275_l593_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c275_l593_action_invoke");
|
||
|
let result = instance.call("f32.no_fold_div_mul", &[Value::F32((-511517980000.0f32).to_bits()), Value::F32((986062200.0f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((-511517950000.0f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 594
|
||
|
fn c276_l594_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c276_l594_action_invoke");
|
||
|
let result = instance.call("f32.no_fold_div_mul", &[Value::F32((-0.00000000000000024944853f32).to_bits()), Value::F32((-0.0000041539834f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((-0.00000000000000024944856f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 595
|
||
|
fn c277_l595_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c277_l595_action_invoke");
|
||
|
let result = instance.call("f32.no_fold_div_mul", &[Value::F32((0.000000000000000000000000000000000000020827855f32).to_bits()), Value::F32((-235.19847f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((0.000000000000000000000000000000000000020828013f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 596
|
||
|
fn c278_l596_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c278_l596_action_invoke");
|
||
|
let result = instance.call("f32.no_fold_div_mul", &[Value::F32((-0.000000000000000000000062499487f32).to_bits()), Value::F32((-696312600000000000.0f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((-0.00000000000000000000006249919f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 597
|
||
|
fn c279_l597_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c279_l597_action_invoke");
|
||
|
let result = instance.call("f32.no_fold_div_mul", &[Value::F32((0.0000000000000000000000000000058353514f32).to_bits()), Value::F32((212781120.0f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((0.000000000000000000000000000005835352f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 599
|
||
|
fn c280_l599_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c280_l599_action_invoke");
|
||
|
let result = instance.call("f64.no_fold_div_mul", &[Value::F64((0.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000035984644259935362f64).to_bits()), Value::F64((-28812263298033320000000000000000000000000000000000000000.0f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((0.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000035985034356565485f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 600
|
||
|
fn c281_l600_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c281_l600_action_invoke");
|
||
|
let result = instance.call("f64.no_fold_div_mul", &[Value::F64((-0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000017486367047479447f64).to_bits()), Value::F64((0.00000000000000016508738454798636f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((-0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001748636704747945f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 601
|
||
|
fn c282_l601_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c282_l601_action_invoke");
|
||
|
let result = instance.call("f64.no_fold_div_mul", &[Value::F64((-0.00000000000000000000000000000000000000000003140341989542684f64).to_bits()), Value::F64((942829809081919600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.0f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((-0.000000000000000000000000000000000000000000031403419895426836f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 602
|
||
|
fn c283_l602_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c283_l602_action_invoke");
|
||
|
let result = instance.call("f64.no_fold_div_mul", &[Value::F64((-0.000000000000000000000000000000000000000000000000000000000000000000000000000000000003919745428533519f64).to_bits()), Value::F64((-21314747179654705000000000000000000000000000000000000000000000000000000000000000000000.0f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((-0.0000000000000000000000000000000000000000000000000000000000000000000000000000000000039197454285335185f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 603
|
||
|
fn c284_l603_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c284_l603_action_invoke");
|
||
|
let result = instance.call("f64.no_fold_div_mul", &[Value::F64((-5734160003788982000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.0f64).to_bits()), Value::F64((6350805843612229000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.0f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((-5734160003788981000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.0f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 607
|
||
|
|
||
|
#[test]
|
||
|
fn test_module_34() {
|
||
|
let mut instance = create_module_34();
|
||
|
// We group the calls together
|
||
|
start_module_34(&mut instance);
|
||
|
c275_l593_action_invoke(&mut instance);
|
||
|
c276_l594_action_invoke(&mut instance);
|
||
|
c277_l595_action_invoke(&mut instance);
|
||
|
c278_l596_action_invoke(&mut instance);
|
||
|
c279_l597_action_invoke(&mut instance);
|
||
|
c280_l599_action_invoke(&mut instance);
|
||
|
c281_l600_action_invoke(&mut instance);
|
||
|
c282_l601_action_invoke(&mut instance);
|
||
|
c283_l602_action_invoke(&mut instance);
|
||
|
c284_l603_action_invoke(&mut instance);
|
||
|
}
|
||
|
fn create_module_35() -> Box<Instance> {
|
||
|
let module_str = "(module
|
||
|
(type (;0;) (func (param f32) (result f32)))
|
||
|
(type (;1;) (func (param f64) (result f64)))
|
||
|
(func (;0;) (type 0) (param f32) (result f32)
|
||
|
get_local 0
|
||
|
f32.const 0x1p+1 (;=2;)
|
||
|
f32.div
|
||
|
f32.const 0x1p+1 (;=2;)
|
||
|
f32.mul)
|
||
|
(func (;1;) (type 1) (param f64) (result f64)
|
||
|
get_local 0
|
||
|
f64.const 0x1p+1 (;=2;)
|
||
|
f64.div
|
||
|
f64.const 0x1p+1 (;=2;)
|
||
|
f64.mul)
|
||
|
(export \"f32.no_fold_div2_mul2\" (func 0))
|
||
|
(export \"f64.no_fold_div2_mul2\" (func 1)))
|
||
|
";
|
||
|
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_35(instance: &mut Instance) {
|
||
|
// TODO Review is explicit start needed? Start now called in runtime::Instance::new()
|
||
|
//instance.start();
|
||
|
}
|
||
|
|
||
|
// Line 614
|
||
|
fn c286_l614_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c286_l614_action_invoke");
|
||
|
let result = instance.call("f32.no_fold_div2_mul2", &[Value::F32((0.000000000000000000000000000000000000023509886f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((0.000000000000000000000000000000000000023509887f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 615
|
||
|
fn c287_l615_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c287_l615_action_invoke");
|
||
|
let result = instance.call("f64.no_fold_div2_mul2", &[Value::F64((0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000044501477170144023f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004450147717014403f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 619
|
||
|
|
||
|
#[test]
|
||
|
fn test_module_35() {
|
||
|
let mut instance = create_module_35();
|
||
|
// We group the calls together
|
||
|
start_module_35(&mut instance);
|
||
|
c286_l614_action_invoke(&mut instance);
|
||
|
c287_l615_action_invoke(&mut instance);
|
||
|
}
|
||
|
fn create_module_36() -> Box<Instance> {
|
||
|
let module_str = "(module
|
||
|
(type (;0;) (func (param f64) (result f64)))
|
||
|
(func (;0;) (type 0) (param f64) (result f64)
|
||
|
get_local 0
|
||
|
f32.demote/f64
|
||
|
f64.promote/f32)
|
||
|
(export \"no_fold_demote_promote\" (func 0)))
|
||
|
";
|
||
|
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_36(instance: &mut Instance) {
|
||
|
// TODO Review is explicit start needed? Start now called in runtime::Instance::new()
|
||
|
//instance.start();
|
||
|
}
|
||
|
|
||
|
// Line 624
|
||
|
fn c289_l624_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c289_l624_action_invoke");
|
||
|
let result = instance.call("no_fold_demote_promote", &[Value::F64((-0.00000000000000000000000000000000000000017176297220569481f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((-0.00000000000000000000000000000000000000017176275796615013f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 625
|
||
|
fn c290_l625_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c290_l625_action_invoke");
|
||
|
let result = instance.call("no_fold_demote_promote", &[Value::F64((-0.000000000000000000000000028464775573304055f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((-0.00000000000000000000000002846477619188087f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 626
|
||
|
fn c291_l626_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c291_l626_action_invoke");
|
||
|
let result = instance.call("no_fold_demote_promote", &[Value::F64((208970699699909230000000000000000.0f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((208970700445326000000000000000000.0f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 627
|
||
|
fn c292_l627_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c292_l627_action_invoke");
|
||
|
let result = instance.call("no_fold_demote_promote", &[Value::F64((-0.0000000000000000000000000047074160416121775f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((-0.0000000000000000000000000047074161331556024f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 628
|
||
|
fn c293_l628_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c293_l628_action_invoke");
|
||
|
let result = instance.call("no_fold_demote_promote", &[Value::F64((23359451497950880000000000000000.0f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((23359452224542198000000000000000.0f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 633
|
||
|
|
||
|
#[test]
|
||
|
fn test_module_36() {
|
||
|
let mut instance = create_module_36();
|
||
|
// We group the calls together
|
||
|
start_module_36(&mut instance);
|
||
|
c289_l624_action_invoke(&mut instance);
|
||
|
c290_l625_action_invoke(&mut instance);
|
||
|
c291_l626_action_invoke(&mut instance);
|
||
|
c292_l627_action_invoke(&mut instance);
|
||
|
c293_l628_action_invoke(&mut instance);
|
||
|
}
|
||
|
fn create_module_37() -> Box<Instance> {
|
||
|
let module_str = "(module
|
||
|
(type (;0;) (func (param f32) (result f32)))
|
||
|
(func (;0;) (type 0) (param f32) (result f32)
|
||
|
get_local 0
|
||
|
f64.promote/f32
|
||
|
f32.demote/f64)
|
||
|
(export \"no_fold_promote_demote\" (func 0)))
|
||
|
";
|
||
|
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_37(instance: &mut Instance) {
|
||
|
// TODO Review is explicit start needed? Start now called in runtime::Instance::new()
|
||
|
//instance.start();
|
||
|
}
|
||
|
|
||
|
// Line 638
|
||
|
fn c295_l638_assert_return_arithmetic_nan(instance: &mut Instance) {
|
||
|
println!("Executing function {}", "c295_l638_assert_return_arithmetic_nan");
|
||
|
let result = instance.call("no_fold_promote_demote", &[Value::F32(f32::from_bits(2141192192) as u32)]).unwrap().expect("Missing result in c295_l638_assert_return_arithmetic_nan");
|
||
|
assert!(match result {
|
||
|
Value::F32(fp) => f32::from_bits(fp).is_quiet_nan(),
|
||
|
Value::F64(fp) => f64::from_bits(fp).is_quiet_nan(),
|
||
|
_ => unimplemented!()
|
||
|
})
|
||
|
}
|
||
|
|
||
|
// Line 639
|
||
|
fn c296_l639_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c296_l639_action_invoke");
|
||
|
let result = instance.call("no_fold_promote_demote", &[Value::F32((0.0f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((0.0f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 640
|
||
|
fn c297_l640_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c297_l640_action_invoke");
|
||
|
let result = instance.call("no_fold_promote_demote", &[Value::F32((-0.0f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((-0.0f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 641
|
||
|
fn c298_l641_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c298_l641_action_invoke");
|
||
|
let result = instance.call("no_fold_promote_demote", &[Value::F32((0.000000000000000000000000000000000000000000001f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((0.000000000000000000000000000000000000000000001f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 642
|
||
|
fn c299_l642_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c299_l642_action_invoke");
|
||
|
let result = instance.call("no_fold_promote_demote", &[Value::F32((-0.000000000000000000000000000000000000000000001f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((-0.000000000000000000000000000000000000000000001f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 643
|
||
|
fn c300_l643_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c300_l643_action_invoke");
|
||
|
let result = instance.call("no_fold_promote_demote", &[Value::F32((0.000000000000000000000000000000000000011754942f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((0.000000000000000000000000000000000000011754942f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 644
|
||
|
fn c301_l644_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c301_l644_action_invoke");
|
||
|
let result = instance.call("no_fold_promote_demote", &[Value::F32((-0.000000000000000000000000000000000000011754942f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((-0.000000000000000000000000000000000000011754942f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 645
|
||
|
fn c302_l645_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c302_l645_action_invoke");
|
||
|
let result = instance.call("no_fold_promote_demote", &[Value::F32((0.000000000000000000000000000000000000011754944f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((0.000000000000000000000000000000000000011754944f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 646
|
||
|
fn c303_l646_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c303_l646_action_invoke");
|
||
|
let result = instance.call("no_fold_promote_demote", &[Value::F32((-0.000000000000000000000000000000000000011754944f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((-0.000000000000000000000000000000000000011754944f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 647
|
||
|
fn c304_l647_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c304_l647_action_invoke");
|
||
|
let result = instance.call("no_fold_promote_demote", &[Value::F32((340282350000000000000000000000000000000.0f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((340282350000000000000000000000000000000.0f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 648
|
||
|
fn c305_l648_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c305_l648_action_invoke");
|
||
|
let result = instance.call("no_fold_promote_demote", &[Value::F32((-340282350000000000000000000000000000000.0f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((-340282350000000000000000000000000000000.0f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 649
|
||
|
fn c306_l649_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c306_l649_action_invoke");
|
||
|
let result = instance.call("no_fold_promote_demote", &[Value::F32(f32::INFINITY.to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32(f32::INFINITY.to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 650
|
||
|
fn c307_l650_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c307_l650_action_invoke");
|
||
|
let result = instance.call("no_fold_promote_demote", &[Value::F32(f32::NEG_INFINITY.to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32(f32::NEG_INFINITY.to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 654
|
||
|
|
||
|
#[test]
|
||
|
fn test_module_37() {
|
||
|
let mut instance = create_module_37();
|
||
|
// We group the calls together
|
||
|
start_module_37(&mut instance);
|
||
|
c295_l638_assert_return_arithmetic_nan(&mut instance);
|
||
|
c296_l639_action_invoke(&mut instance);
|
||
|
c297_l640_action_invoke(&mut instance);
|
||
|
c298_l641_action_invoke(&mut instance);
|
||
|
c299_l642_action_invoke(&mut instance);
|
||
|
c300_l643_action_invoke(&mut instance);
|
||
|
c301_l644_action_invoke(&mut instance);
|
||
|
c302_l645_action_invoke(&mut instance);
|
||
|
c303_l646_action_invoke(&mut instance);
|
||
|
c304_l647_action_invoke(&mut instance);
|
||
|
c305_l648_action_invoke(&mut instance);
|
||
|
c306_l649_action_invoke(&mut instance);
|
||
|
c307_l650_action_invoke(&mut instance);
|
||
|
}
|
||
|
fn create_module_38() -> Box<Instance> {
|
||
|
let module_str = "(module
|
||
|
(type (;0;) (func (param f64 f32) (result f32)))
|
||
|
(type (;1;) (func (param f32 f64) (result f32)))
|
||
|
(func (;0;) (type 0) (param f64 f32) (result f32)
|
||
|
get_local 0
|
||
|
get_local 1
|
||
|
f64.promote/f32
|
||
|
f64.add
|
||
|
f32.demote/f64)
|
||
|
(func (;1;) (type 1) (param f32 f64) (result f32)
|
||
|
get_local 0
|
||
|
f64.promote/f32
|
||
|
get_local 1
|
||
|
f64.add
|
||
|
f32.demote/f64)
|
||
|
(export \"no_demote_mixed_add\" (func 0))
|
||
|
(export \"no_demote_mixed_add_commuted\" (func 1)))
|
||
|
";
|
||
|
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_38(instance: &mut Instance) {
|
||
|
// TODO Review is explicit start needed? Start now called in runtime::Instance::new()
|
||
|
//instance.start();
|
||
|
}
|
||
|
|
||
|
// Line 661
|
||
|
fn c309_l661_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c309_l661_action_invoke");
|
||
|
let result = instance.call("no_demote_mixed_add", &[Value::F64((0.00000000000000000000000000004941266527909197f64).to_bits()), Value::F32((0.0000000000000000000000000000000000018767183f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((0.000000000000000000000000000049412667f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 662
|
||
|
fn c310_l662_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c310_l662_action_invoke");
|
||
|
let result = instance.call("no_demote_mixed_add", &[Value::F64((140851523637.69385f64).to_bits()), Value::F32((401096440000.0f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((541947950000.0f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 663
|
||
|
fn c311_l663_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c311_l663_action_invoke");
|
||
|
let result = instance.call("no_demote_mixed_add", &[Value::F64((0.0000000000000000000000000000000000020831160914192852f64).to_bits()), Value::F32((-0.0000000000000000000000000000000000006050095f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((0.0000000000000000000000000000000000014781066f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 664
|
||
|
fn c312_l664_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c312_l664_action_invoke");
|
||
|
let result = instance.call("no_demote_mixed_add", &[Value::F64((-0.0000010032827553674626f64).to_bits()), Value::F32((0.0000000019312918f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((-0.0000010013515f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 665
|
||
|
fn c313_l665_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c313_l665_action_invoke");
|
||
|
let result = instance.call("no_demote_mixed_add", &[Value::F64((-0.0000013840207035752711f64).to_bits()), Value::F32((-0.0000000000005202814f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((-0.0000013840212f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 667
|
||
|
fn c314_l667_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c314_l667_action_invoke");
|
||
|
let result = instance.call("no_demote_mixed_add_commuted", &[Value::F32((0.0000000000000000000000000000000000018767183f32).to_bits()), Value::F64((0.00000000000000000000000000004941266527909197f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((0.000000000000000000000000000049412667f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 668
|
||
|
fn c315_l668_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c315_l668_action_invoke");
|
||
|
let result = instance.call("no_demote_mixed_add_commuted", &[Value::F32((401096440000.0f32).to_bits()), Value::F64((140851523637.69385f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((541947950000.0f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 669
|
||
|
fn c316_l669_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c316_l669_action_invoke");
|
||
|
let result = instance.call("no_demote_mixed_add_commuted", &[Value::F32((-0.0000000000000000000000000000000000006050095f32).to_bits()), Value::F64((0.0000000000000000000000000000000000020831160914192852f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((0.0000000000000000000000000000000000014781066f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 670
|
||
|
fn c317_l670_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c317_l670_action_invoke");
|
||
|
let result = instance.call("no_demote_mixed_add_commuted", &[Value::F32((0.0000000019312918f32).to_bits()), Value::F64((-0.0000010032827553674626f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((-0.0000010013515f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 671
|
||
|
fn c318_l671_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c318_l671_action_invoke");
|
||
|
let result = instance.call("no_demote_mixed_add_commuted", &[Value::F32((-0.0000000000005202814f32).to_bits()), Value::F64((-0.0000013840207035752711f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((-0.0000013840212f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 675
|
||
|
|
||
|
#[test]
|
||
|
fn test_module_38() {
|
||
|
let mut instance = create_module_38();
|
||
|
// We group the calls together
|
||
|
start_module_38(&mut instance);
|
||
|
c309_l661_action_invoke(&mut instance);
|
||
|
c310_l662_action_invoke(&mut instance);
|
||
|
c311_l663_action_invoke(&mut instance);
|
||
|
c312_l664_action_invoke(&mut instance);
|
||
|
c313_l665_action_invoke(&mut instance);
|
||
|
c314_l667_action_invoke(&mut instance);
|
||
|
c315_l668_action_invoke(&mut instance);
|
||
|
c316_l669_action_invoke(&mut instance);
|
||
|
c317_l670_action_invoke(&mut instance);
|
||
|
c318_l671_action_invoke(&mut instance);
|
||
|
}
|
||
|
fn create_module_39() -> Box<Instance> {
|
||
|
let module_str = "(module
|
||
|
(type (;0;) (func (param f64 f32) (result f32)))
|
||
|
(func (;0;) (type 0) (param f64 f32) (result f32)
|
||
|
get_local 0
|
||
|
get_local 1
|
||
|
f64.promote/f32
|
||
|
f64.sub
|
||
|
f32.demote/f64)
|
||
|
(export \"no_demote_mixed_sub\" (func 0)))
|
||
|
";
|
||
|
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_39(instance: &mut Instance) {
|
||
|
// TODO Review is explicit start needed? Start now called in runtime::Instance::new()
|
||
|
//instance.start();
|
||
|
}
|
||
|
|
||
|
// Line 680
|
||
|
fn c320_l680_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c320_l680_action_invoke");
|
||
|
let result = instance.call("no_demote_mixed_sub", &[Value::F64((7869935327202668000000000.0f64).to_bits()), Value::F32((4086347000000000000.0f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((7869931000000000000000000.0f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 681
|
||
|
fn c321_l681_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c321_l681_action_invoke");
|
||
|
let result = instance.call("no_demote_mixed_sub", &[Value::F64((-1535841968.9056544f64).to_bits()), Value::F32((239897.28f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((-1536081900.0f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 682
|
||
|
fn c322_l682_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c322_l682_action_invoke");
|
||
|
let result = instance.call("no_demote_mixed_sub", &[Value::F64((-102.19459272722602f64).to_bits()), Value::F32((0.00039426138f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((-102.194984f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 683
|
||
|
fn c323_l683_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c323_l683_action_invoke");
|
||
|
let result = instance.call("no_demote_mixed_sub", &[Value::F64((0.00000000000000005645470375565188f64).to_bits()), Value::F32((0.0000000000000000000005851077f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((0.00000000000000005645412f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 684
|
||
|
fn c324_l684_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c324_l684_action_invoke");
|
||
|
let result = instance.call("no_demote_mixed_sub", &[Value::F64((27090.388466832894f64).to_bits()), Value::F32((63120.89f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((-36030.504f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 688
|
||
|
|
||
|
#[test]
|
||
|
fn test_module_39() {
|
||
|
let mut instance = create_module_39();
|
||
|
// We group the calls together
|
||
|
start_module_39(&mut instance);
|
||
|
c320_l680_action_invoke(&mut instance);
|
||
|
c321_l681_action_invoke(&mut instance);
|
||
|
c322_l682_action_invoke(&mut instance);
|
||
|
c323_l683_action_invoke(&mut instance);
|
||
|
c324_l684_action_invoke(&mut instance);
|
||
|
}
|
||
|
fn create_module_40() -> Box<Instance> {
|
||
|
let module_str = "(module
|
||
|
(type (;0;) (func (param f32) (result f32)))
|
||
|
(type (;1;) (func (param f64) (result f64)))
|
||
|
(func (;0;) (type 0) (param f32) (result f32)
|
||
|
get_local 0
|
||
|
i32.trunc_s/f32
|
||
|
f32.convert_s/i32)
|
||
|
(func (;1;) (type 0) (param f32) (result f32)
|
||
|
get_local 0
|
||
|
i32.trunc_u/f32
|
||
|
f32.convert_s/i32)
|
||
|
(func (;2;) (type 0) (param f32) (result f32)
|
||
|
get_local 0
|
||
|
i32.trunc_s/f32
|
||
|
f32.convert_u/i32)
|
||
|
(func (;3;) (type 0) (param f32) (result f32)
|
||
|
get_local 0
|
||
|
i32.trunc_u/f32
|
||
|
f32.convert_u/i32)
|
||
|
(func (;4;) (type 1) (param f64) (result f64)
|
||
|
get_local 0
|
||
|
i32.trunc_s/f64
|
||
|
f64.convert_s/i32)
|
||
|
(func (;5;) (type 1) (param f64) (result f64)
|
||
|
get_local 0
|
||
|
i32.trunc_u/f64
|
||
|
f64.convert_s/i32)
|
||
|
(func (;6;) (type 1) (param f64) (result f64)
|
||
|
get_local 0
|
||
|
i32.trunc_s/f64
|
||
|
f64.convert_u/i32)
|
||
|
(func (;7;) (type 1) (param f64) (result f64)
|
||
|
get_local 0
|
||
|
i32.trunc_u/f64
|
||
|
f64.convert_u/i32)
|
||
|
(func (;8;) (type 0) (param f32) (result f32)
|
||
|
get_local 0
|
||
|
i64.trunc_s/f32
|
||
|
f32.convert_s/i64)
|
||
|
(func (;9;) (type 0) (param f32) (result f32)
|
||
|
get_local 0
|
||
|
i64.trunc_u/f32
|
||
|
f32.convert_s/i64)
|
||
|
(func (;10;) (type 0) (param f32) (result f32)
|
||
|
get_local 0
|
||
|
i64.trunc_s/f32
|
||
|
f32.convert_u/i64)
|
||
|
(func (;11;) (type 0) (param f32) (result f32)
|
||
|
get_local 0
|
||
|
i64.trunc_u/f32
|
||
|
f32.convert_u/i64)
|
||
|
(func (;12;) (type 1) (param f64) (result f64)
|
||
|
get_local 0
|
||
|
i64.trunc_s/f64
|
||
|
f64.convert_s/i64)
|
||
|
(func (;13;) (type 1) (param f64) (result f64)
|
||
|
get_local 0
|
||
|
i64.trunc_u/f64
|
||
|
f64.convert_s/i64)
|
||
|
(func (;14;) (type 1) (param f64) (result f64)
|
||
|
get_local 0
|
||
|
i64.trunc_s/f64
|
||
|
f64.convert_u/i64)
|
||
|
(func (;15;) (type 1) (param f64) (result f64)
|
||
|
get_local 0
|
||
|
i64.trunc_u/f64
|
||
|
f64.convert_u/i64)
|
||
|
(export \"f32.i32.no_fold_trunc_s_convert_s\" (func 0))
|
||
|
(export \"f32.i32.no_fold_trunc_u_convert_s\" (func 1))
|
||
|
(export \"f32.i32.no_fold_trunc_s_convert_u\" (func 2))
|
||
|
(export \"f32.i32.no_fold_trunc_u_convert_u\" (func 3))
|
||
|
(export \"f64.i32.no_fold_trunc_s_convert_s\" (func 4))
|
||
|
(export \"f64.i32.no_fold_trunc_u_convert_s\" (func 5))
|
||
|
(export \"f64.i32.no_fold_trunc_s_convert_u\" (func 6))
|
||
|
(export \"f64.i32.no_fold_trunc_u_convert_u\" (func 7))
|
||
|
(export \"f32.i64.no_fold_trunc_s_convert_s\" (func 8))
|
||
|
(export \"f32.i64.no_fold_trunc_u_convert_s\" (func 9))
|
||
|
(export \"f32.i64.no_fold_trunc_s_convert_u\" (func 10))
|
||
|
(export \"f32.i64.no_fold_trunc_u_convert_u\" (func 11))
|
||
|
(export \"f64.i64.no_fold_trunc_s_convert_s\" (func 12))
|
||
|
(export \"f64.i64.no_fold_trunc_u_convert_s\" (func 13))
|
||
|
(export \"f64.i64.no_fold_trunc_s_convert_u\" (func 14))
|
||
|
(export \"f64.i64.no_fold_trunc_u_convert_u\" (func 15)))
|
||
|
";
|
||
|
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_40(instance: &mut Instance) {
|
||
|
// TODO Review is explicit start needed? Start now called in runtime::Instance::new()
|
||
|
//instance.start();
|
||
|
}
|
||
|
|
||
|
// Line 723
|
||
|
fn c326_l723_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c326_l723_action_invoke");
|
||
|
let result = instance.call("f32.i32.no_fold_trunc_s_convert_s", &[Value::F32((1.5f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((1.0f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 724
|
||
|
fn c327_l724_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c327_l724_action_invoke");
|
||
|
let result = instance.call("f32.i32.no_fold_trunc_s_convert_s", &[Value::F32((-1.5f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((-1.0f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 725
|
||
|
fn c328_l725_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c328_l725_action_invoke");
|
||
|
let result = instance.call("f32.i32.no_fold_trunc_u_convert_s", &[Value::F32((1.5f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((1.0f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 726
|
||
|
fn c329_l726_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c329_l726_action_invoke");
|
||
|
let result = instance.call("f32.i32.no_fold_trunc_u_convert_s", &[Value::F32((-0.5f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((0.0f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 727
|
||
|
fn c330_l727_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c330_l727_action_invoke");
|
||
|
let result = instance.call("f32.i32.no_fold_trunc_s_convert_u", &[Value::F32((1.5f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((1.0f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 728
|
||
|
fn c331_l728_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c331_l728_action_invoke");
|
||
|
let result = instance.call("f32.i32.no_fold_trunc_s_convert_u", &[Value::F32((-1.5f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((4294967300.0f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 729
|
||
|
fn c332_l729_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c332_l729_action_invoke");
|
||
|
let result = instance.call("f32.i32.no_fold_trunc_u_convert_u", &[Value::F32((1.5f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((1.0f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 730
|
||
|
fn c333_l730_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c333_l730_action_invoke");
|
||
|
let result = instance.call("f32.i32.no_fold_trunc_u_convert_u", &[Value::F32((-0.5f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((0.0f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 732
|
||
|
fn c334_l732_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c334_l732_action_invoke");
|
||
|
let result = instance.call("f64.i32.no_fold_trunc_s_convert_s", &[Value::F64((1.5f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((1.0f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 733
|
||
|
fn c335_l733_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c335_l733_action_invoke");
|
||
|
let result = instance.call("f64.i32.no_fold_trunc_s_convert_s", &[Value::F64((-1.5f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((-1.0f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 734
|
||
|
fn c336_l734_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c336_l734_action_invoke");
|
||
|
let result = instance.call("f64.i32.no_fold_trunc_u_convert_s", &[Value::F64((1.5f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((1.0f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 735
|
||
|
fn c337_l735_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c337_l735_action_invoke");
|
||
|
let result = instance.call("f64.i32.no_fold_trunc_u_convert_s", &[Value::F64((-0.5f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((0.0f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 736
|
||
|
fn c338_l736_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c338_l736_action_invoke");
|
||
|
let result = instance.call("f64.i32.no_fold_trunc_s_convert_u", &[Value::F64((1.5f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((1.0f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 737
|
||
|
fn c339_l737_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c339_l737_action_invoke");
|
||
|
let result = instance.call("f64.i32.no_fold_trunc_s_convert_u", &[Value::F64((-1.5f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((4294967295.0f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 738
|
||
|
fn c340_l738_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c340_l738_action_invoke");
|
||
|
let result = instance.call("f64.i32.no_fold_trunc_u_convert_u", &[Value::F64((1.5f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((1.0f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 739
|
||
|
fn c341_l739_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c341_l739_action_invoke");
|
||
|
let result = instance.call("f64.i32.no_fold_trunc_u_convert_u", &[Value::F64((-0.5f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((0.0f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 741
|
||
|
fn c342_l741_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c342_l741_action_invoke");
|
||
|
let result = instance.call("f32.i64.no_fold_trunc_s_convert_s", &[Value::F32((1.5f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((1.0f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 742
|
||
|
fn c343_l742_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c343_l742_action_invoke");
|
||
|
let result = instance.call("f32.i64.no_fold_trunc_s_convert_s", &[Value::F32((-1.5f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((-1.0f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 743
|
||
|
fn c344_l743_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c344_l743_action_invoke");
|
||
|
let result = instance.call("f32.i64.no_fold_trunc_u_convert_s", &[Value::F32((1.5f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((1.0f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 744
|
||
|
fn c345_l744_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c345_l744_action_invoke");
|
||
|
let result = instance.call("f32.i64.no_fold_trunc_u_convert_s", &[Value::F32((-0.5f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((0.0f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 745
|
||
|
fn c346_l745_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c346_l745_action_invoke");
|
||
|
let result = instance.call("f32.i64.no_fold_trunc_s_convert_u", &[Value::F32((1.5f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((1.0f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 746
|
||
|
fn c347_l746_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c347_l746_action_invoke");
|
||
|
let result = instance.call("f32.i64.no_fold_trunc_s_convert_u", &[Value::F32((-1.5f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((18446744000000000000.0f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 747
|
||
|
fn c348_l747_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c348_l747_action_invoke");
|
||
|
let result = instance.call("f32.i64.no_fold_trunc_u_convert_u", &[Value::F32((1.5f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((1.0f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 748
|
||
|
fn c349_l748_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c349_l748_action_invoke");
|
||
|
let result = instance.call("f32.i64.no_fold_trunc_u_convert_u", &[Value::F32((-0.5f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((0.0f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 750
|
||
|
fn c350_l750_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c350_l750_action_invoke");
|
||
|
let result = instance.call("f64.i64.no_fold_trunc_s_convert_s", &[Value::F64((1.5f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((1.0f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 751
|
||
|
fn c351_l751_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c351_l751_action_invoke");
|
||
|
let result = instance.call("f64.i64.no_fold_trunc_s_convert_s", &[Value::F64((-1.5f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((-1.0f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 752
|
||
|
fn c352_l752_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c352_l752_action_invoke");
|
||
|
let result = instance.call("f64.i64.no_fold_trunc_u_convert_s", &[Value::F64((1.5f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((1.0f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 753
|
||
|
fn c353_l753_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c353_l753_action_invoke");
|
||
|
let result = instance.call("f64.i64.no_fold_trunc_u_convert_s", &[Value::F64((-0.5f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((0.0f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 754
|
||
|
fn c354_l754_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c354_l754_action_invoke");
|
||
|
let result = instance.call("f64.i64.no_fold_trunc_s_convert_u", &[Value::F64((1.5f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((1.0f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 755
|
||
|
fn c355_l755_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c355_l755_action_invoke");
|
||
|
let result = instance.call("f64.i64.no_fold_trunc_s_convert_u", &[Value::F64((-1.5f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((18446744073709552000.0f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 756
|
||
|
fn c356_l756_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c356_l756_action_invoke");
|
||
|
let result = instance.call("f64.i64.no_fold_trunc_u_convert_u", &[Value::F64((1.5f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((1.0f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 757
|
||
|
fn c357_l757_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c357_l757_action_invoke");
|
||
|
let result = instance.call("f64.i64.no_fold_trunc_u_convert_u", &[Value::F64((-0.5f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((0.0f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 763
|
||
|
|
||
|
#[test]
|
||
|
fn test_module_40() {
|
||
|
let mut instance = create_module_40();
|
||
|
// We group the calls together
|
||
|
start_module_40(&mut instance);
|
||
|
c326_l723_action_invoke(&mut instance);
|
||
|
c327_l724_action_invoke(&mut instance);
|
||
|
c328_l725_action_invoke(&mut instance);
|
||
|
c329_l726_action_invoke(&mut instance);
|
||
|
c330_l727_action_invoke(&mut instance);
|
||
|
c331_l728_action_invoke(&mut instance);
|
||
|
c332_l729_action_invoke(&mut instance);
|
||
|
c333_l730_action_invoke(&mut instance);
|
||
|
c334_l732_action_invoke(&mut instance);
|
||
|
c335_l733_action_invoke(&mut instance);
|
||
|
c336_l734_action_invoke(&mut instance);
|
||
|
c337_l735_action_invoke(&mut instance);
|
||
|
c338_l736_action_invoke(&mut instance);
|
||
|
c339_l737_action_invoke(&mut instance);
|
||
|
c340_l738_action_invoke(&mut instance);
|
||
|
c341_l739_action_invoke(&mut instance);
|
||
|
c342_l741_action_invoke(&mut instance);
|
||
|
c343_l742_action_invoke(&mut instance);
|
||
|
c344_l743_action_invoke(&mut instance);
|
||
|
c345_l744_action_invoke(&mut instance);
|
||
|
c346_l745_action_invoke(&mut instance);
|
||
|
c347_l746_action_invoke(&mut instance);
|
||
|
c348_l747_action_invoke(&mut instance);
|
||
|
c349_l748_action_invoke(&mut instance);
|
||
|
c350_l750_action_invoke(&mut instance);
|
||
|
c351_l751_action_invoke(&mut instance);
|
||
|
c352_l752_action_invoke(&mut instance);
|
||
|
c353_l753_action_invoke(&mut instance);
|
||
|
c354_l754_action_invoke(&mut instance);
|
||
|
c355_l755_action_invoke(&mut instance);
|
||
|
c356_l756_action_invoke(&mut instance);
|
||
|
c357_l757_action_invoke(&mut instance);
|
||
|
}
|
||
|
fn create_module_41() -> Box<Instance> {
|
||
|
let module_str = "(module
|
||
|
(type (;0;) (func (param i32 f32)))
|
||
|
(type (;1;) (func (param i32) (result f32)))
|
||
|
(func (;0;) (type 0) (param i32 f32)
|
||
|
get_local 0
|
||
|
get_local 1
|
||
|
f32.store)
|
||
|
(func (;1;) (type 0) (param i32 f32)
|
||
|
(local i32)
|
||
|
block ;; label = @1
|
||
|
loop ;; label = @2
|
||
|
get_local 2
|
||
|
get_local 2
|
||
|
f32.load
|
||
|
get_local 1
|
||
|
f32.div
|
||
|
f32.store
|
||
|
get_local 2
|
||
|
i32.const 4
|
||
|
i32.add
|
||
|
set_local 2
|
||
|
get_local 2
|
||
|
get_local 0
|
||
|
i32.lt_u
|
||
|
br_if 0 (;@2;)
|
||
|
end
|
||
|
end)
|
||
|
(func (;2;) (type 1) (param i32) (result f32)
|
||
|
get_local 0
|
||
|
f32.load)
|
||
|
(memory (;0;) 1 1)
|
||
|
(export \"init\" (func 0))
|
||
|
(export \"run\" (func 1))
|
||
|
(export \"check\" (func 2)))
|
||
|
";
|
||
|
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_41(instance: &mut Instance) {
|
||
|
// TODO Review is explicit start needed? Start now called in runtime::Instance::new()
|
||
|
//instance.start();
|
||
|
}
|
||
|
|
||
|
// Line 784
|
||
|
fn c359_l784_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c359_l784_action_invoke");
|
||
|
let result = instance.call("init", &[Value::I32(0 as i32), Value::F32((15.1f32).to_bits())]);
|
||
|
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 785
|
||
|
fn c360_l785_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c360_l785_action_invoke");
|
||
|
let result = instance.call("init", &[Value::I32(4 as i32), Value::F32((15.2f32).to_bits())]);
|
||
|
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 786
|
||
|
fn c361_l786_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c361_l786_action_invoke");
|
||
|
let result = instance.call("init", &[Value::I32(8 as i32), Value::F32((15.3f32).to_bits())]);
|
||
|
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 787
|
||
|
fn c362_l787_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c362_l787_action_invoke");
|
||
|
let result = instance.call("init", &[Value::I32(12 as i32), Value::F32((15.4f32).to_bits())]);
|
||
|
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 788
|
||
|
fn c363_l788_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c363_l788_action_invoke");
|
||
|
let result = instance.call("check", &[Value::I32(0 as i32)]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((15.1f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 789
|
||
|
fn c364_l789_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c364_l789_action_invoke");
|
||
|
let result = instance.call("check", &[Value::I32(4 as i32)]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((15.2f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 790
|
||
|
fn c365_l790_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c365_l790_action_invoke");
|
||
|
let result = instance.call("check", &[Value::I32(8 as i32)]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((15.3f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 791
|
||
|
fn c366_l791_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c366_l791_action_invoke");
|
||
|
let result = instance.call("check", &[Value::I32(12 as i32)]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((15.4f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 792
|
||
|
fn c367_l792_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c367_l792_action_invoke");
|
||
|
let result = instance.call("run", &[Value::I32(16 as i32), Value::F32((3.0f32).to_bits())]);
|
||
|
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 793
|
||
|
fn c368_l793_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c368_l793_action_invoke");
|
||
|
let result = instance.call("check", &[Value::I32(0 as i32)]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((5.0333333f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 794
|
||
|
fn c369_l794_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c369_l794_action_invoke");
|
||
|
let result = instance.call("check", &[Value::I32(4 as i32)]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((5.0666666f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 795
|
||
|
fn c370_l795_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c370_l795_action_invoke");
|
||
|
let result = instance.call("check", &[Value::I32(8 as i32)]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((5.1f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 796
|
||
|
fn c371_l796_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c371_l796_action_invoke");
|
||
|
let result = instance.call("check", &[Value::I32(12 as i32)]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((5.133333f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 798
|
||
|
|
||
|
#[test]
|
||
|
fn test_module_41() {
|
||
|
let mut instance = create_module_41();
|
||
|
// We group the calls together
|
||
|
start_module_41(&mut instance);
|
||
|
c359_l784_action_invoke(&mut instance);
|
||
|
c360_l785_action_invoke(&mut instance);
|
||
|
c361_l786_action_invoke(&mut instance);
|
||
|
c362_l787_action_invoke(&mut instance);
|
||
|
c363_l788_action_invoke(&mut instance);
|
||
|
c364_l789_action_invoke(&mut instance);
|
||
|
c365_l790_action_invoke(&mut instance);
|
||
|
c366_l791_action_invoke(&mut instance);
|
||
|
c367_l792_action_invoke(&mut instance);
|
||
|
c368_l793_action_invoke(&mut instance);
|
||
|
c369_l794_action_invoke(&mut instance);
|
||
|
c370_l795_action_invoke(&mut instance);
|
||
|
c371_l796_action_invoke(&mut instance);
|
||
|
}
|
||
|
fn create_module_42() -> Box<Instance> {
|
||
|
let module_str = "(module
|
||
|
(type (;0;) (func (param i32 f64)))
|
||
|
(type (;1;) (func (param i32) (result f64)))
|
||
|
(func (;0;) (type 0) (param i32 f64)
|
||
|
get_local 0
|
||
|
get_local 1
|
||
|
f64.store)
|
||
|
(func (;1;) (type 0) (param i32 f64)
|
||
|
(local i32)
|
||
|
block ;; label = @1
|
||
|
loop ;; label = @2
|
||
|
get_local 2
|
||
|
get_local 2
|
||
|
f64.load
|
||
|
get_local 1
|
||
|
f64.div
|
||
|
f64.store
|
||
|
get_local 2
|
||
|
i32.const 8
|
||
|
i32.add
|
||
|
set_local 2
|
||
|
get_local 2
|
||
|
get_local 0
|
||
|
i32.lt_u
|
||
|
br_if 0 (;@2;)
|
||
|
end
|
||
|
end)
|
||
|
(func (;2;) (type 1) (param i32) (result f64)
|
||
|
get_local 0
|
||
|
f64.load)
|
||
|
(memory (;0;) 1 1)
|
||
|
(export \"init\" (func 0))
|
||
|
(export \"run\" (func 1))
|
||
|
(export \"check\" (func 2)))
|
||
|
";
|
||
|
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_42(instance: &mut Instance) {
|
||
|
// TODO Review is explicit start needed? Start now called in runtime::Instance::new()
|
||
|
//instance.start();
|
||
|
}
|
||
|
|
||
|
// Line 819
|
||
|
fn c373_l819_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c373_l819_action_invoke");
|
||
|
let result = instance.call("init", &[Value::I32(0 as i32), Value::F64((15.1f64).to_bits())]);
|
||
|
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 820
|
||
|
fn c374_l820_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c374_l820_action_invoke");
|
||
|
let result = instance.call("init", &[Value::I32(8 as i32), Value::F64((15.2f64).to_bits())]);
|
||
|
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 821
|
||
|
fn c375_l821_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c375_l821_action_invoke");
|
||
|
let result = instance.call("init", &[Value::I32(16 as i32), Value::F64((15.3f64).to_bits())]);
|
||
|
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 822
|
||
|
fn c376_l822_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c376_l822_action_invoke");
|
||
|
let result = instance.call("init", &[Value::I32(24 as i32), Value::F64((15.4f64).to_bits())]);
|
||
|
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 823
|
||
|
fn c377_l823_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c377_l823_action_invoke");
|
||
|
let result = instance.call("check", &[Value::I32(0 as i32)]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((15.1f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 824
|
||
|
fn c378_l824_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c378_l824_action_invoke");
|
||
|
let result = instance.call("check", &[Value::I32(8 as i32)]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((15.2f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 825
|
||
|
fn c379_l825_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c379_l825_action_invoke");
|
||
|
let result = instance.call("check", &[Value::I32(16 as i32)]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((15.3f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 826
|
||
|
fn c380_l826_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c380_l826_action_invoke");
|
||
|
let result = instance.call("check", &[Value::I32(24 as i32)]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((15.4f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 827
|
||
|
fn c381_l827_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c381_l827_action_invoke");
|
||
|
let result = instance.call("run", &[Value::I32(32 as i32), Value::F64((3.0f64).to_bits())]);
|
||
|
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 828
|
||
|
fn c382_l828_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c382_l828_action_invoke");
|
||
|
let result = instance.call("check", &[Value::I32(0 as i32)]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((5.033333333333333f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 829
|
||
|
fn c383_l829_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c383_l829_action_invoke");
|
||
|
let result = instance.call("check", &[Value::I32(8 as i32)]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((5.066666666666666f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 830
|
||
|
fn c384_l830_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c384_l830_action_invoke");
|
||
|
let result = instance.call("check", &[Value::I32(16 as i32)]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((5.1000000000000005f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 831
|
||
|
fn c385_l831_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c385_l831_action_invoke");
|
||
|
let result = instance.call("check", &[Value::I32(24 as i32)]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((5.133333333333334f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 835
|
||
|
|
||
|
#[test]
|
||
|
fn test_module_42() {
|
||
|
let mut instance = create_module_42();
|
||
|
// We group the calls together
|
||
|
start_module_42(&mut instance);
|
||
|
c373_l819_action_invoke(&mut instance);
|
||
|
c374_l820_action_invoke(&mut instance);
|
||
|
c375_l821_action_invoke(&mut instance);
|
||
|
c376_l822_action_invoke(&mut instance);
|
||
|
c377_l823_action_invoke(&mut instance);
|
||
|
c378_l824_action_invoke(&mut instance);
|
||
|
c379_l825_action_invoke(&mut instance);
|
||
|
c380_l826_action_invoke(&mut instance);
|
||
|
c381_l827_action_invoke(&mut instance);
|
||
|
c382_l828_action_invoke(&mut instance);
|
||
|
c383_l829_action_invoke(&mut instance);
|
||
|
c384_l830_action_invoke(&mut instance);
|
||
|
c385_l831_action_invoke(&mut instance);
|
||
|
}
|
||
|
fn create_module_43() -> Box<Instance> {
|
||
|
let module_str = "(module
|
||
|
(type (;0;) (func (param f32 f32) (result i32)))
|
||
|
(type (;1;) (func (param f64 f64) (result i32)))
|
||
|
(func (;0;) (type 0) (param f32 f32) (result i32)
|
||
|
get_local 0
|
||
|
get_local 1
|
||
|
f32.ge
|
||
|
i32.eqz)
|
||
|
(func (;1;) (type 0) (param f32 f32) (result i32)
|
||
|
get_local 0
|
||
|
get_local 1
|
||
|
f32.gt
|
||
|
i32.eqz)
|
||
|
(func (;2;) (type 0) (param f32 f32) (result i32)
|
||
|
get_local 0
|
||
|
get_local 1
|
||
|
f32.le
|
||
|
i32.eqz)
|
||
|
(func (;3;) (type 0) (param f32 f32) (result i32)
|
||
|
get_local 0
|
||
|
get_local 1
|
||
|
f32.lt
|
||
|
i32.eqz)
|
||
|
(func (;4;) (type 1) (param f64 f64) (result i32)
|
||
|
get_local 0
|
||
|
get_local 1
|
||
|
f64.ge
|
||
|
i32.eqz)
|
||
|
(func (;5;) (type 1) (param f64 f64) (result i32)
|
||
|
get_local 0
|
||
|
get_local 1
|
||
|
f64.gt
|
||
|
i32.eqz)
|
||
|
(func (;6;) (type 1) (param f64 f64) (result i32)
|
||
|
get_local 0
|
||
|
get_local 1
|
||
|
f64.le
|
||
|
i32.eqz)
|
||
|
(func (;7;) (type 1) (param f64 f64) (result i32)
|
||
|
get_local 0
|
||
|
get_local 1
|
||
|
f64.lt
|
||
|
i32.eqz)
|
||
|
(export \"f32.ult\" (func 0))
|
||
|
(export \"f32.ule\" (func 1))
|
||
|
(export \"f32.ugt\" (func 2))
|
||
|
(export \"f32.uge\" (func 3))
|
||
|
(export \"f64.ult\" (func 4))
|
||
|
(export \"f64.ule\" (func 5))
|
||
|
(export \"f64.ugt\" (func 6))
|
||
|
(export \"f64.uge\" (func 7)))
|
||
|
";
|
||
|
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_43(instance: &mut Instance) {
|
||
|
// TODO Review is explicit start needed? Start now called in runtime::Instance::new()
|
||
|
//instance.start();
|
||
|
}
|
||
|
|
||
|
// Line 847
|
||
|
fn c387_l847_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c387_l847_action_invoke");
|
||
|
let result = instance.call("f32.ult", &[Value::F32((3.0f32).to_bits()), Value::F32((2.0f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::I32(0 as i32))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 848
|
||
|
fn c388_l848_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c388_l848_action_invoke");
|
||
|
let result = instance.call("f32.ult", &[Value::F32((2.0f32).to_bits()), Value::F32((2.0f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::I32(0 as i32))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 849
|
||
|
fn c389_l849_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c389_l849_action_invoke");
|
||
|
let result = instance.call("f32.ult", &[Value::F32((2.0f32).to_bits()), Value::F32((3.0f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::I32(1 as i32))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 850
|
||
|
fn c390_l850_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c390_l850_action_invoke");
|
||
|
let result = instance.call("f32.ult", &[Value::F32((2.0f32).to_bits()), Value::F32(f32::from_bits(2143289344) as u32)]);
|
||
|
assert_eq!(result, Ok(Some(Value::I32(1 as i32))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 851
|
||
|
fn c391_l851_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c391_l851_action_invoke");
|
||
|
let result = instance.call("f32.ule", &[Value::F32((3.0f32).to_bits()), Value::F32((2.0f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::I32(0 as i32))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 852
|
||
|
fn c392_l852_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c392_l852_action_invoke");
|
||
|
let result = instance.call("f32.ule", &[Value::F32((2.0f32).to_bits()), Value::F32((2.0f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::I32(1 as i32))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 853
|
||
|
fn c393_l853_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c393_l853_action_invoke");
|
||
|
let result = instance.call("f32.ule", &[Value::F32((2.0f32).to_bits()), Value::F32((3.0f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::I32(1 as i32))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 854
|
||
|
fn c394_l854_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c394_l854_action_invoke");
|
||
|
let result = instance.call("f32.ule", &[Value::F32((2.0f32).to_bits()), Value::F32(f32::from_bits(2143289344) as u32)]);
|
||
|
assert_eq!(result, Ok(Some(Value::I32(1 as i32))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 855
|
||
|
fn c395_l855_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c395_l855_action_invoke");
|
||
|
let result = instance.call("f32.ugt", &[Value::F32((3.0f32).to_bits()), Value::F32((2.0f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::I32(1 as i32))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 856
|
||
|
fn c396_l856_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c396_l856_action_invoke");
|
||
|
let result = instance.call("f32.ugt", &[Value::F32((2.0f32).to_bits()), Value::F32((2.0f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::I32(0 as i32))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 857
|
||
|
fn c397_l857_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c397_l857_action_invoke");
|
||
|
let result = instance.call("f32.ugt", &[Value::F32((2.0f32).to_bits()), Value::F32((3.0f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::I32(0 as i32))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 858
|
||
|
fn c398_l858_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c398_l858_action_invoke");
|
||
|
let result = instance.call("f32.ugt", &[Value::F32((2.0f32).to_bits()), Value::F32(f32::from_bits(2143289344) as u32)]);
|
||
|
assert_eq!(result, Ok(Some(Value::I32(1 as i32))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 859
|
||
|
fn c399_l859_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c399_l859_action_invoke");
|
||
|
let result = instance.call("f32.uge", &[Value::F32((3.0f32).to_bits()), Value::F32((2.0f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::I32(1 as i32))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 860
|
||
|
fn c400_l860_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c400_l860_action_invoke");
|
||
|
let result = instance.call("f32.uge", &[Value::F32((2.0f32).to_bits()), Value::F32((2.0f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::I32(1 as i32))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 861
|
||
|
fn c401_l861_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c401_l861_action_invoke");
|
||
|
let result = instance.call("f32.uge", &[Value::F32((2.0f32).to_bits()), Value::F32((3.0f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::I32(0 as i32))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 862
|
||
|
fn c402_l862_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c402_l862_action_invoke");
|
||
|
let result = instance.call("f32.uge", &[Value::F32((2.0f32).to_bits()), Value::F32(f32::from_bits(2143289344) as u32)]);
|
||
|
assert_eq!(result, Ok(Some(Value::I32(1 as i32))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 863
|
||
|
fn c403_l863_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c403_l863_action_invoke");
|
||
|
let result = instance.call("f64.ult", &[Value::F64((3.0f64).to_bits()), Value::F64((2.0f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::I32(0 as i32))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 864
|
||
|
fn c404_l864_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c404_l864_action_invoke");
|
||
|
let result = instance.call("f64.ult", &[Value::F64((2.0f64).to_bits()), Value::F64((2.0f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::I32(0 as i32))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 865
|
||
|
fn c405_l865_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c405_l865_action_invoke");
|
||
|
let result = instance.call("f64.ult", &[Value::F64((2.0f64).to_bits()), Value::F64((3.0f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::I32(1 as i32))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 866
|
||
|
fn c406_l866_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c406_l866_action_invoke");
|
||
|
let result = instance.call("f64.ult", &[Value::F64((2.0f64).to_bits()), Value::F64(f64::from_bits(9221120237041090560) as u64)]);
|
||
|
assert_eq!(result, Ok(Some(Value::I32(1 as i32))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 867
|
||
|
fn c407_l867_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c407_l867_action_invoke");
|
||
|
let result = instance.call("f64.ule", &[Value::F64((3.0f64).to_bits()), Value::F64((2.0f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::I32(0 as i32))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 868
|
||
|
fn c408_l868_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c408_l868_action_invoke");
|
||
|
let result = instance.call("f64.ule", &[Value::F64((2.0f64).to_bits()), Value::F64((2.0f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::I32(1 as i32))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 869
|
||
|
fn c409_l869_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c409_l869_action_invoke");
|
||
|
let result = instance.call("f64.ule", &[Value::F64((2.0f64).to_bits()), Value::F64((3.0f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::I32(1 as i32))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 870
|
||
|
fn c410_l870_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c410_l870_action_invoke");
|
||
|
let result = instance.call("f64.ule", &[Value::F64((2.0f64).to_bits()), Value::F64(f64::from_bits(9221120237041090560) as u64)]);
|
||
|
assert_eq!(result, Ok(Some(Value::I32(1 as i32))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 871
|
||
|
fn c411_l871_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c411_l871_action_invoke");
|
||
|
let result = instance.call("f64.ugt", &[Value::F64((3.0f64).to_bits()), Value::F64((2.0f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::I32(1 as i32))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 872
|
||
|
fn c412_l872_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c412_l872_action_invoke");
|
||
|
let result = instance.call("f64.ugt", &[Value::F64((2.0f64).to_bits()), Value::F64((2.0f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::I32(0 as i32))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 873
|
||
|
fn c413_l873_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c413_l873_action_invoke");
|
||
|
let result = instance.call("f64.ugt", &[Value::F64((2.0f64).to_bits()), Value::F64((3.0f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::I32(0 as i32))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 874
|
||
|
fn c414_l874_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c414_l874_action_invoke");
|
||
|
let result = instance.call("f64.ugt", &[Value::F64((2.0f64).to_bits()), Value::F64(f64::from_bits(9221120237041090560) as u64)]);
|
||
|
assert_eq!(result, Ok(Some(Value::I32(1 as i32))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 875
|
||
|
fn c415_l875_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c415_l875_action_invoke");
|
||
|
let result = instance.call("f64.uge", &[Value::F64((3.0f64).to_bits()), Value::F64((2.0f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::I32(1 as i32))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 876
|
||
|
fn c416_l876_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c416_l876_action_invoke");
|
||
|
let result = instance.call("f64.uge", &[Value::F64((2.0f64).to_bits()), Value::F64((2.0f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::I32(1 as i32))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 877
|
||
|
fn c417_l877_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c417_l877_action_invoke");
|
||
|
let result = instance.call("f64.uge", &[Value::F64((2.0f64).to_bits()), Value::F64((3.0f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::I32(0 as i32))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 878
|
||
|
fn c418_l878_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c418_l878_action_invoke");
|
||
|
let result = instance.call("f64.uge", &[Value::F64((2.0f64).to_bits()), Value::F64(f64::from_bits(9221120237041090560) as u64)]);
|
||
|
assert_eq!(result, Ok(Some(Value::I32(1 as i32))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 882
|
||
|
|
||
|
#[test]
|
||
|
fn test_module_43() {
|
||
|
let mut instance = create_module_43();
|
||
|
// We group the calls together
|
||
|
start_module_43(&mut instance);
|
||
|
c387_l847_action_invoke(&mut instance);
|
||
|
c388_l848_action_invoke(&mut instance);
|
||
|
c389_l849_action_invoke(&mut instance);
|
||
|
c390_l850_action_invoke(&mut instance);
|
||
|
c391_l851_action_invoke(&mut instance);
|
||
|
c392_l852_action_invoke(&mut instance);
|
||
|
c393_l853_action_invoke(&mut instance);
|
||
|
c394_l854_action_invoke(&mut instance);
|
||
|
c395_l855_action_invoke(&mut instance);
|
||
|
c396_l856_action_invoke(&mut instance);
|
||
|
c397_l857_action_invoke(&mut instance);
|
||
|
c398_l858_action_invoke(&mut instance);
|
||
|
c399_l859_action_invoke(&mut instance);
|
||
|
c400_l860_action_invoke(&mut instance);
|
||
|
c401_l861_action_invoke(&mut instance);
|
||
|
c402_l862_action_invoke(&mut instance);
|
||
|
c403_l863_action_invoke(&mut instance);
|
||
|
c404_l864_action_invoke(&mut instance);
|
||
|
c405_l865_action_invoke(&mut instance);
|
||
|
c406_l866_action_invoke(&mut instance);
|
||
|
c407_l867_action_invoke(&mut instance);
|
||
|
c408_l868_action_invoke(&mut instance);
|
||
|
c409_l869_action_invoke(&mut instance);
|
||
|
c410_l870_action_invoke(&mut instance);
|
||
|
c411_l871_action_invoke(&mut instance);
|
||
|
c412_l872_action_invoke(&mut instance);
|
||
|
c413_l873_action_invoke(&mut instance);
|
||
|
c414_l874_action_invoke(&mut instance);
|
||
|
c415_l875_action_invoke(&mut instance);
|
||
|
c416_l876_action_invoke(&mut instance);
|
||
|
c417_l877_action_invoke(&mut instance);
|
||
|
c418_l878_action_invoke(&mut instance);
|
||
|
}
|
||
|
fn create_module_44() -> Box<Instance> {
|
||
|
let module_str = "(module
|
||
|
(type (;0;) (func (param f32 f32) (result f32)))
|
||
|
(type (;1;) (func (param f64 f64) (result f64)))
|
||
|
(func (;0;) (type 0) (param f32 f32) (result f32)
|
||
|
get_local 0
|
||
|
get_local 1
|
||
|
get_local 0
|
||
|
get_local 1
|
||
|
f32.lt
|
||
|
select)
|
||
|
(func (;1;) (type 0) (param f32 f32) (result f32)
|
||
|
get_local 0
|
||
|
get_local 1
|
||
|
get_local 0
|
||
|
get_local 1
|
||
|
f32.le
|
||
|
select)
|
||
|
(func (;2;) (type 0) (param f32 f32) (result f32)
|
||
|
get_local 0
|
||
|
get_local 1
|
||
|
get_local 0
|
||
|
get_local 1
|
||
|
f32.gt
|
||
|
select)
|
||
|
(func (;3;) (type 0) (param f32 f32) (result f32)
|
||
|
get_local 0
|
||
|
get_local 1
|
||
|
get_local 0
|
||
|
get_local 1
|
||
|
f32.ge
|
||
|
select)
|
||
|
(func (;4;) (type 1) (param f64 f64) (result f64)
|
||
|
get_local 0
|
||
|
get_local 1
|
||
|
get_local 0
|
||
|
get_local 1
|
||
|
f64.lt
|
||
|
select)
|
||
|
(func (;5;) (type 1) (param f64 f64) (result f64)
|
||
|
get_local 0
|
||
|
get_local 1
|
||
|
get_local 0
|
||
|
get_local 1
|
||
|
f64.le
|
||
|
select)
|
||
|
(func (;6;) (type 1) (param f64 f64) (result f64)
|
||
|
get_local 0
|
||
|
get_local 1
|
||
|
get_local 0
|
||
|
get_local 1
|
||
|
f64.gt
|
||
|
select)
|
||
|
(func (;7;) (type 1) (param f64 f64) (result f64)
|
||
|
get_local 0
|
||
|
get_local 1
|
||
|
get_local 0
|
||
|
get_local 1
|
||
|
f64.ge
|
||
|
select)
|
||
|
(export \"f32.no_fold_lt_select\" (func 0))
|
||
|
(export \"f32.no_fold_le_select\" (func 1))
|
||
|
(export \"f32.no_fold_gt_select\" (func 2))
|
||
|
(export \"f32.no_fold_ge_select\" (func 3))
|
||
|
(export \"f64.no_fold_lt_select\" (func 4))
|
||
|
(export \"f64.no_fold_le_select\" (func 5))
|
||
|
(export \"f64.no_fold_gt_select\" (func 6))
|
||
|
(export \"f64.no_fold_ge_select\" (func 7)))
|
||
|
";
|
||
|
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_44(instance: &mut Instance) {
|
||
|
// TODO Review is explicit start needed? Start now called in runtime::Instance::new()
|
||
|
//instance.start();
|
||
|
}
|
||
|
|
||
|
// Line 894
|
||
|
fn c420_l894_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c420_l894_action_invoke");
|
||
|
let result = instance.call("f32.no_fold_lt_select", &[Value::F32((0.0f32).to_bits()), Value::F32(f32::from_bits(2143289344) as u32)]);
|
||
|
let expected = f32::from_bits(2143289344);
|
||
|
if let Value::F32(result) = result.clone().unwrap().unwrap() {
|
||
|
assert!((result as f32).is_nan());
|
||
|
assert_eq!((result as f32).is_sign_positive(), (expected as f32).is_sign_positive());
|
||
|
} else {
|
||
|
panic!("Unexpected result type {:?}", result);
|
||
|
}
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 895
|
||
|
fn c421_l895_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c421_l895_action_invoke");
|
||
|
let result = instance.call("f32.no_fold_lt_select", &[Value::F32(f32::from_bits(2143289344) as u32), Value::F32((0.0f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((0.0f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 896
|
||
|
fn c422_l896_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c422_l896_action_invoke");
|
||
|
let result = instance.call("f32.no_fold_lt_select", &[Value::F32((0.0f32).to_bits()), Value::F32((-0.0f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((-0.0f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 897
|
||
|
fn c423_l897_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c423_l897_action_invoke");
|
||
|
let result = instance.call("f32.no_fold_lt_select", &[Value::F32((-0.0f32).to_bits()), Value::F32((0.0f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((0.0f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 898
|
||
|
fn c424_l898_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c424_l898_action_invoke");
|
||
|
let result = instance.call("f32.no_fold_le_select", &[Value::F32((0.0f32).to_bits()), Value::F32(f32::from_bits(2143289344) as u32)]);
|
||
|
let expected = f32::from_bits(2143289344);
|
||
|
if let Value::F32(result) = result.clone().unwrap().unwrap() {
|
||
|
assert!((result as f32).is_nan());
|
||
|
assert_eq!((result as f32).is_sign_positive(), (expected as f32).is_sign_positive());
|
||
|
} else {
|
||
|
panic!("Unexpected result type {:?}", result);
|
||
|
}
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 899
|
||
|
fn c425_l899_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c425_l899_action_invoke");
|
||
|
let result = instance.call("f32.no_fold_le_select", &[Value::F32(f32::from_bits(2143289344) as u32), Value::F32((0.0f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((0.0f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 900
|
||
|
fn c426_l900_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c426_l900_action_invoke");
|
||
|
let result = instance.call("f32.no_fold_le_select", &[Value::F32((0.0f32).to_bits()), Value::F32((-0.0f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((0.0f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 901
|
||
|
fn c427_l901_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c427_l901_action_invoke");
|
||
|
let result = instance.call("f32.no_fold_le_select", &[Value::F32((-0.0f32).to_bits()), Value::F32((0.0f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((-0.0f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 902
|
||
|
fn c428_l902_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c428_l902_action_invoke");
|
||
|
let result = instance.call("f32.no_fold_gt_select", &[Value::F32((0.0f32).to_bits()), Value::F32(f32::from_bits(2143289344) as u32)]);
|
||
|
let expected = f32::from_bits(2143289344);
|
||
|
if let Value::F32(result) = result.clone().unwrap().unwrap() {
|
||
|
assert!((result as f32).is_nan());
|
||
|
assert_eq!((result as f32).is_sign_positive(), (expected as f32).is_sign_positive());
|
||
|
} else {
|
||
|
panic!("Unexpected result type {:?}", result);
|
||
|
}
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 903
|
||
|
fn c429_l903_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c429_l903_action_invoke");
|
||
|
let result = instance.call("f32.no_fold_gt_select", &[Value::F32(f32::from_bits(2143289344) as u32), Value::F32((0.0f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((0.0f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 904
|
||
|
fn c430_l904_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c430_l904_action_invoke");
|
||
|
let result = instance.call("f32.no_fold_gt_select", &[Value::F32((0.0f32).to_bits()), Value::F32((-0.0f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((-0.0f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 905
|
||
|
fn c431_l905_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c431_l905_action_invoke");
|
||
|
let result = instance.call("f32.no_fold_gt_select", &[Value::F32((-0.0f32).to_bits()), Value::F32((0.0f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((0.0f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 906
|
||
|
fn c432_l906_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c432_l906_action_invoke");
|
||
|
let result = instance.call("f32.no_fold_ge_select", &[Value::F32((0.0f32).to_bits()), Value::F32(f32::from_bits(2143289344) as u32)]);
|
||
|
let expected = f32::from_bits(2143289344);
|
||
|
if let Value::F32(result) = result.clone().unwrap().unwrap() {
|
||
|
assert!((result as f32).is_nan());
|
||
|
assert_eq!((result as f32).is_sign_positive(), (expected as f32).is_sign_positive());
|
||
|
} else {
|
||
|
panic!("Unexpected result type {:?}", result);
|
||
|
}
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 907
|
||
|
fn c433_l907_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c433_l907_action_invoke");
|
||
|
let result = instance.call("f32.no_fold_ge_select", &[Value::F32(f32::from_bits(2143289344) as u32), Value::F32((0.0f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((0.0f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 908
|
||
|
fn c434_l908_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c434_l908_action_invoke");
|
||
|
let result = instance.call("f32.no_fold_ge_select", &[Value::F32((0.0f32).to_bits()), Value::F32((-0.0f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((0.0f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 909
|
||
|
fn c435_l909_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c435_l909_action_invoke");
|
||
|
let result = instance.call("f32.no_fold_ge_select", &[Value::F32((-0.0f32).to_bits()), Value::F32((0.0f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((-0.0f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 910
|
||
|
fn c436_l910_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c436_l910_action_invoke");
|
||
|
let result = instance.call("f64.no_fold_lt_select", &[Value::F64((0.0f64).to_bits()), Value::F64(f64::from_bits(9221120237041090560) as u64)]);
|
||
|
let expected = f64::from_bits(9221120237041090560);
|
||
|
if let Value::F64(result) = result.clone().unwrap().unwrap() {
|
||
|
assert!((result as f64).is_nan());
|
||
|
assert_eq!((result as f64).is_sign_positive(), (expected as f64).is_sign_positive());
|
||
|
} else {
|
||
|
panic!("Unexpected result type {:?}", result);
|
||
|
}
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 911
|
||
|
fn c437_l911_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c437_l911_action_invoke");
|
||
|
let result = instance.call("f64.no_fold_lt_select", &[Value::F64(f64::from_bits(9221120237041090560) as u64), Value::F64((0.0f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((0.0f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 912
|
||
|
fn c438_l912_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c438_l912_action_invoke");
|
||
|
let result = instance.call("f64.no_fold_lt_select", &[Value::F64((0.0f64).to_bits()), Value::F64((-0.0f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((-0.0f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 913
|
||
|
fn c439_l913_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c439_l913_action_invoke");
|
||
|
let result = instance.call("f64.no_fold_lt_select", &[Value::F64((-0.0f64).to_bits()), Value::F64((0.0f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((0.0f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 914
|
||
|
fn c440_l914_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c440_l914_action_invoke");
|
||
|
let result = instance.call("f64.no_fold_le_select", &[Value::F64((0.0f64).to_bits()), Value::F64(f64::from_bits(9221120237041090560) as u64)]);
|
||
|
let expected = f64::from_bits(9221120237041090560);
|
||
|
if let Value::F64(result) = result.clone().unwrap().unwrap() {
|
||
|
assert!((result as f64).is_nan());
|
||
|
assert_eq!((result as f64).is_sign_positive(), (expected as f64).is_sign_positive());
|
||
|
} else {
|
||
|
panic!("Unexpected result type {:?}", result);
|
||
|
}
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 915
|
||
|
fn c441_l915_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c441_l915_action_invoke");
|
||
|
let result = instance.call("f64.no_fold_le_select", &[Value::F64(f64::from_bits(9221120237041090560) as u64), Value::F64((0.0f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((0.0f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 916
|
||
|
fn c442_l916_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c442_l916_action_invoke");
|
||
|
let result = instance.call("f64.no_fold_le_select", &[Value::F64((0.0f64).to_bits()), Value::F64((-0.0f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((0.0f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 917
|
||
|
fn c443_l917_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c443_l917_action_invoke");
|
||
|
let result = instance.call("f64.no_fold_le_select", &[Value::F64((-0.0f64).to_bits()), Value::F64((0.0f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((-0.0f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 918
|
||
|
fn c444_l918_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c444_l918_action_invoke");
|
||
|
let result = instance.call("f64.no_fold_gt_select", &[Value::F64((0.0f64).to_bits()), Value::F64(f64::from_bits(9221120237041090560) as u64)]);
|
||
|
let expected = f64::from_bits(9221120237041090560);
|
||
|
if let Value::F64(result) = result.clone().unwrap().unwrap() {
|
||
|
assert!((result as f64).is_nan());
|
||
|
assert_eq!((result as f64).is_sign_positive(), (expected as f64).is_sign_positive());
|
||
|
} else {
|
||
|
panic!("Unexpected result type {:?}", result);
|
||
|
}
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 919
|
||
|
fn c445_l919_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c445_l919_action_invoke");
|
||
|
let result = instance.call("f64.no_fold_gt_select", &[Value::F64(f64::from_bits(9221120237041090560) as u64), Value::F64((0.0f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((0.0f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 920
|
||
|
fn c446_l920_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c446_l920_action_invoke");
|
||
|
let result = instance.call("f64.no_fold_gt_select", &[Value::F64((0.0f64).to_bits()), Value::F64((-0.0f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((-0.0f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 921
|
||
|
fn c447_l921_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c447_l921_action_invoke");
|
||
|
let result = instance.call("f64.no_fold_gt_select", &[Value::F64((-0.0f64).to_bits()), Value::F64((0.0f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((0.0f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 922
|
||
|
fn c448_l922_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c448_l922_action_invoke");
|
||
|
let result = instance.call("f64.no_fold_ge_select", &[Value::F64((0.0f64).to_bits()), Value::F64(f64::from_bits(9221120237041090560) as u64)]);
|
||
|
let expected = f64::from_bits(9221120237041090560);
|
||
|
if let Value::F64(result) = result.clone().unwrap().unwrap() {
|
||
|
assert!((result as f64).is_nan());
|
||
|
assert_eq!((result as f64).is_sign_positive(), (expected as f64).is_sign_positive());
|
||
|
} else {
|
||
|
panic!("Unexpected result type {:?}", result);
|
||
|
}
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 923
|
||
|
fn c449_l923_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c449_l923_action_invoke");
|
||
|
let result = instance.call("f64.no_fold_ge_select", &[Value::F64(f64::from_bits(9221120237041090560) as u64), Value::F64((0.0f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((0.0f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 924
|
||
|
fn c450_l924_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c450_l924_action_invoke");
|
||
|
let result = instance.call("f64.no_fold_ge_select", &[Value::F64((0.0f64).to_bits()), Value::F64((-0.0f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((0.0f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 925
|
||
|
fn c451_l925_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c451_l925_action_invoke");
|
||
|
let result = instance.call("f64.no_fold_ge_select", &[Value::F64((-0.0f64).to_bits()), Value::F64((0.0f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((-0.0f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 929
|
||
|
|
||
|
#[test]
|
||
|
fn test_module_44() {
|
||
|
let mut instance = create_module_44();
|
||
|
// We group the calls together
|
||
|
start_module_44(&mut instance);
|
||
|
c420_l894_action_invoke(&mut instance);
|
||
|
c421_l895_action_invoke(&mut instance);
|
||
|
c422_l896_action_invoke(&mut instance);
|
||
|
c423_l897_action_invoke(&mut instance);
|
||
|
c424_l898_action_invoke(&mut instance);
|
||
|
c425_l899_action_invoke(&mut instance);
|
||
|
c426_l900_action_invoke(&mut instance);
|
||
|
c427_l901_action_invoke(&mut instance);
|
||
|
c428_l902_action_invoke(&mut instance);
|
||
|
c429_l903_action_invoke(&mut instance);
|
||
|
c430_l904_action_invoke(&mut instance);
|
||
|
c431_l905_action_invoke(&mut instance);
|
||
|
c432_l906_action_invoke(&mut instance);
|
||
|
c433_l907_action_invoke(&mut instance);
|
||
|
c434_l908_action_invoke(&mut instance);
|
||
|
c435_l909_action_invoke(&mut instance);
|
||
|
c436_l910_action_invoke(&mut instance);
|
||
|
c437_l911_action_invoke(&mut instance);
|
||
|
c438_l912_action_invoke(&mut instance);
|
||
|
c439_l913_action_invoke(&mut instance);
|
||
|
c440_l914_action_invoke(&mut instance);
|
||
|
c441_l915_action_invoke(&mut instance);
|
||
|
c442_l916_action_invoke(&mut instance);
|
||
|
c443_l917_action_invoke(&mut instance);
|
||
|
c444_l918_action_invoke(&mut instance);
|
||
|
c445_l919_action_invoke(&mut instance);
|
||
|
c446_l920_action_invoke(&mut instance);
|
||
|
c447_l921_action_invoke(&mut instance);
|
||
|
c448_l922_action_invoke(&mut instance);
|
||
|
c449_l923_action_invoke(&mut instance);
|
||
|
c450_l924_action_invoke(&mut instance);
|
||
|
c451_l925_action_invoke(&mut instance);
|
||
|
}
|
||
|
fn create_module_45() -> Box<Instance> {
|
||
|
let module_str = "(module
|
||
|
(type (;0;) (func (param f32 f32) (result f32)))
|
||
|
(type (;1;) (func (param f64 f64) (result f64)))
|
||
|
(func (;0;) (type 0) (param f32 f32) (result f32)
|
||
|
get_local 0
|
||
|
get_local 1
|
||
|
f32.lt
|
||
|
if (result f32) ;; label = @1
|
||
|
get_local 0
|
||
|
else
|
||
|
get_local 1
|
||
|
end)
|
||
|
(func (;1;) (type 0) (param f32 f32) (result f32)
|
||
|
get_local 0
|
||
|
get_local 1
|
||
|
f32.le
|
||
|
if (result f32) ;; label = @1
|
||
|
get_local 0
|
||
|
else
|
||
|
get_local 1
|
||
|
end)
|
||
|
(func (;2;) (type 0) (param f32 f32) (result f32)
|
||
|
get_local 0
|
||
|
get_local 1
|
||
|
f32.gt
|
||
|
if (result f32) ;; label = @1
|
||
|
get_local 0
|
||
|
else
|
||
|
get_local 1
|
||
|
end)
|
||
|
(func (;3;) (type 0) (param f32 f32) (result f32)
|
||
|
get_local 0
|
||
|
get_local 1
|
||
|
f32.ge
|
||
|
if (result f32) ;; label = @1
|
||
|
get_local 0
|
||
|
else
|
||
|
get_local 1
|
||
|
end)
|
||
|
(func (;4;) (type 1) (param f64 f64) (result f64)
|
||
|
get_local 0
|
||
|
get_local 1
|
||
|
f64.lt
|
||
|
if (result f64) ;; label = @1
|
||
|
get_local 0
|
||
|
else
|
||
|
get_local 1
|
||
|
end)
|
||
|
(func (;5;) (type 1) (param f64 f64) (result f64)
|
||
|
get_local 0
|
||
|
get_local 1
|
||
|
f64.le
|
||
|
if (result f64) ;; label = @1
|
||
|
get_local 0
|
||
|
else
|
||
|
get_local 1
|
||
|
end)
|
||
|
(func (;6;) (type 1) (param f64 f64) (result f64)
|
||
|
get_local 0
|
||
|
get_local 1
|
||
|
f64.gt
|
||
|
if (result f64) ;; label = @1
|
||
|
get_local 0
|
||
|
else
|
||
|
get_local 1
|
||
|
end)
|
||
|
(func (;7;) (type 1) (param f64 f64) (result f64)
|
||
|
get_local 0
|
||
|
get_local 1
|
||
|
f64.ge
|
||
|
if (result f64) ;; label = @1
|
||
|
get_local 0
|
||
|
else
|
||
|
get_local 1
|
||
|
end)
|
||
|
(export \"f32.no_fold_lt_if\" (func 0))
|
||
|
(export \"f32.no_fold_le_if\" (func 1))
|
||
|
(export \"f32.no_fold_gt_if\" (func 2))
|
||
|
(export \"f32.no_fold_ge_if\" (func 3))
|
||
|
(export \"f64.no_fold_lt_if\" (func 4))
|
||
|
(export \"f64.no_fold_le_if\" (func 5))
|
||
|
(export \"f64.no_fold_gt_if\" (func 6))
|
||
|
(export \"f64.no_fold_ge_if\" (func 7)))
|
||
|
";
|
||
|
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_45(instance: &mut Instance) {
|
||
|
// TODO Review is explicit start needed? Start now called in runtime::Instance::new()
|
||
|
//instance.start();
|
||
|
}
|
||
|
|
||
|
// Line 973
|
||
|
fn c453_l973_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c453_l973_action_invoke");
|
||
|
let result = instance.call("f32.no_fold_lt_if", &[Value::F32((0.0f32).to_bits()), Value::F32(f32::from_bits(2143289344) as u32)]);
|
||
|
let expected = f32::from_bits(2143289344);
|
||
|
if let Value::F32(result) = result.clone().unwrap().unwrap() {
|
||
|
assert!((result as f32).is_nan());
|
||
|
assert_eq!((result as f32).is_sign_positive(), (expected as f32).is_sign_positive());
|
||
|
} else {
|
||
|
panic!("Unexpected result type {:?}", result);
|
||
|
}
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 974
|
||
|
fn c454_l974_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c454_l974_action_invoke");
|
||
|
let result = instance.call("f32.no_fold_lt_if", &[Value::F32(f32::from_bits(2143289344) as u32), Value::F32((0.0f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((0.0f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 975
|
||
|
fn c455_l975_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c455_l975_action_invoke");
|
||
|
let result = instance.call("f32.no_fold_lt_if", &[Value::F32((0.0f32).to_bits()), Value::F32((-0.0f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((-0.0f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 976
|
||
|
fn c456_l976_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c456_l976_action_invoke");
|
||
|
let result = instance.call("f32.no_fold_lt_if", &[Value::F32((-0.0f32).to_bits()), Value::F32((0.0f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((0.0f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 977
|
||
|
fn c457_l977_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c457_l977_action_invoke");
|
||
|
let result = instance.call("f32.no_fold_le_if", &[Value::F32((0.0f32).to_bits()), Value::F32(f32::from_bits(2143289344) as u32)]);
|
||
|
let expected = f32::from_bits(2143289344);
|
||
|
if let Value::F32(result) = result.clone().unwrap().unwrap() {
|
||
|
assert!((result as f32).is_nan());
|
||
|
assert_eq!((result as f32).is_sign_positive(), (expected as f32).is_sign_positive());
|
||
|
} else {
|
||
|
panic!("Unexpected result type {:?}", result);
|
||
|
}
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 978
|
||
|
fn c458_l978_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c458_l978_action_invoke");
|
||
|
let result = instance.call("f32.no_fold_le_if", &[Value::F32(f32::from_bits(2143289344) as u32), Value::F32((0.0f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((0.0f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 979
|
||
|
fn c459_l979_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c459_l979_action_invoke");
|
||
|
let result = instance.call("f32.no_fold_le_if", &[Value::F32((0.0f32).to_bits()), Value::F32((-0.0f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((0.0f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 980
|
||
|
fn c460_l980_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c460_l980_action_invoke");
|
||
|
let result = instance.call("f32.no_fold_le_if", &[Value::F32((-0.0f32).to_bits()), Value::F32((0.0f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((-0.0f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 981
|
||
|
fn c461_l981_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c461_l981_action_invoke");
|
||
|
let result = instance.call("f32.no_fold_gt_if", &[Value::F32((0.0f32).to_bits()), Value::F32(f32::from_bits(2143289344) as u32)]);
|
||
|
let expected = f32::from_bits(2143289344);
|
||
|
if let Value::F32(result) = result.clone().unwrap().unwrap() {
|
||
|
assert!((result as f32).is_nan());
|
||
|
assert_eq!((result as f32).is_sign_positive(), (expected as f32).is_sign_positive());
|
||
|
} else {
|
||
|
panic!("Unexpected result type {:?}", result);
|
||
|
}
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 982
|
||
|
fn c462_l982_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c462_l982_action_invoke");
|
||
|
let result = instance.call("f32.no_fold_gt_if", &[Value::F32(f32::from_bits(2143289344) as u32), Value::F32((0.0f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((0.0f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 983
|
||
|
fn c463_l983_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c463_l983_action_invoke");
|
||
|
let result = instance.call("f32.no_fold_gt_if", &[Value::F32((0.0f32).to_bits()), Value::F32((-0.0f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((-0.0f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 984
|
||
|
fn c464_l984_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c464_l984_action_invoke");
|
||
|
let result = instance.call("f32.no_fold_gt_if", &[Value::F32((-0.0f32).to_bits()), Value::F32((0.0f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((0.0f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 985
|
||
|
fn c465_l985_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c465_l985_action_invoke");
|
||
|
let result = instance.call("f32.no_fold_ge_if", &[Value::F32((0.0f32).to_bits()), Value::F32(f32::from_bits(2143289344) as u32)]);
|
||
|
let expected = f32::from_bits(2143289344);
|
||
|
if let Value::F32(result) = result.clone().unwrap().unwrap() {
|
||
|
assert!((result as f32).is_nan());
|
||
|
assert_eq!((result as f32).is_sign_positive(), (expected as f32).is_sign_positive());
|
||
|
} else {
|
||
|
panic!("Unexpected result type {:?}", result);
|
||
|
}
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 986
|
||
|
fn c466_l986_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c466_l986_action_invoke");
|
||
|
let result = instance.call("f32.no_fold_ge_if", &[Value::F32(f32::from_bits(2143289344) as u32), Value::F32((0.0f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((0.0f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 987
|
||
|
fn c467_l987_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c467_l987_action_invoke");
|
||
|
let result = instance.call("f32.no_fold_ge_if", &[Value::F32((0.0f32).to_bits()), Value::F32((-0.0f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((0.0f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 988
|
||
|
fn c468_l988_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c468_l988_action_invoke");
|
||
|
let result = instance.call("f32.no_fold_ge_if", &[Value::F32((-0.0f32).to_bits()), Value::F32((0.0f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((-0.0f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 989
|
||
|
fn c469_l989_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c469_l989_action_invoke");
|
||
|
let result = instance.call("f64.no_fold_lt_if", &[Value::F64((0.0f64).to_bits()), Value::F64(f64::from_bits(9221120237041090560) as u64)]);
|
||
|
let expected = f64::from_bits(9221120237041090560);
|
||
|
if let Value::F64(result) = result.clone().unwrap().unwrap() {
|
||
|
assert!((result as f64).is_nan());
|
||
|
assert_eq!((result as f64).is_sign_positive(), (expected as f64).is_sign_positive());
|
||
|
} else {
|
||
|
panic!("Unexpected result type {:?}", result);
|
||
|
}
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 990
|
||
|
fn c470_l990_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c470_l990_action_invoke");
|
||
|
let result = instance.call("f64.no_fold_lt_if", &[Value::F64(f64::from_bits(9221120237041090560) as u64), Value::F64((0.0f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((0.0f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 991
|
||
|
fn c471_l991_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c471_l991_action_invoke");
|
||
|
let result = instance.call("f64.no_fold_lt_if", &[Value::F64((0.0f64).to_bits()), Value::F64((-0.0f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((-0.0f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 992
|
||
|
fn c472_l992_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c472_l992_action_invoke");
|
||
|
let result = instance.call("f64.no_fold_lt_if", &[Value::F64((-0.0f64).to_bits()), Value::F64((0.0f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((0.0f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 993
|
||
|
fn c473_l993_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c473_l993_action_invoke");
|
||
|
let result = instance.call("f64.no_fold_le_if", &[Value::F64((0.0f64).to_bits()), Value::F64(f64::from_bits(9221120237041090560) as u64)]);
|
||
|
let expected = f64::from_bits(9221120237041090560);
|
||
|
if let Value::F64(result) = result.clone().unwrap().unwrap() {
|
||
|
assert!((result as f64).is_nan());
|
||
|
assert_eq!((result as f64).is_sign_positive(), (expected as f64).is_sign_positive());
|
||
|
} else {
|
||
|
panic!("Unexpected result type {:?}", result);
|
||
|
}
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 994
|
||
|
fn c474_l994_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c474_l994_action_invoke");
|
||
|
let result = instance.call("f64.no_fold_le_if", &[Value::F64(f64::from_bits(9221120237041090560) as u64), Value::F64((0.0f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((0.0f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 995
|
||
|
fn c475_l995_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c475_l995_action_invoke");
|
||
|
let result = instance.call("f64.no_fold_le_if", &[Value::F64((0.0f64).to_bits()), Value::F64((-0.0f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((0.0f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 996
|
||
|
fn c476_l996_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c476_l996_action_invoke");
|
||
|
let result = instance.call("f64.no_fold_le_if", &[Value::F64((-0.0f64).to_bits()), Value::F64((0.0f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((-0.0f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 997
|
||
|
fn c477_l997_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c477_l997_action_invoke");
|
||
|
let result = instance.call("f64.no_fold_gt_if", &[Value::F64((0.0f64).to_bits()), Value::F64(f64::from_bits(9221120237041090560) as u64)]);
|
||
|
let expected = f64::from_bits(9221120237041090560);
|
||
|
if let Value::F64(result) = result.clone().unwrap().unwrap() {
|
||
|
assert!((result as f64).is_nan());
|
||
|
assert_eq!((result as f64).is_sign_positive(), (expected as f64).is_sign_positive());
|
||
|
} else {
|
||
|
panic!("Unexpected result type {:?}", result);
|
||
|
}
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 998
|
||
|
fn c478_l998_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c478_l998_action_invoke");
|
||
|
let result = instance.call("f64.no_fold_gt_if", &[Value::F64(f64::from_bits(9221120237041090560) as u64), Value::F64((0.0f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((0.0f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 999
|
||
|
fn c479_l999_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c479_l999_action_invoke");
|
||
|
let result = instance.call("f64.no_fold_gt_if", &[Value::F64((0.0f64).to_bits()), Value::F64((-0.0f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((-0.0f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1000
|
||
|
fn c480_l1000_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c480_l1000_action_invoke");
|
||
|
let result = instance.call("f64.no_fold_gt_if", &[Value::F64((-0.0f64).to_bits()), Value::F64((0.0f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((0.0f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1001
|
||
|
fn c481_l1001_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c481_l1001_action_invoke");
|
||
|
let result = instance.call("f64.no_fold_ge_if", &[Value::F64((0.0f64).to_bits()), Value::F64(f64::from_bits(9221120237041090560) as u64)]);
|
||
|
let expected = f64::from_bits(9221120237041090560);
|
||
|
if let Value::F64(result) = result.clone().unwrap().unwrap() {
|
||
|
assert!((result as f64).is_nan());
|
||
|
assert_eq!((result as f64).is_sign_positive(), (expected as f64).is_sign_positive());
|
||
|
} else {
|
||
|
panic!("Unexpected result type {:?}", result);
|
||
|
}
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1002
|
||
|
fn c482_l1002_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c482_l1002_action_invoke");
|
||
|
let result = instance.call("f64.no_fold_ge_if", &[Value::F64(f64::from_bits(9221120237041090560) as u64), Value::F64((0.0f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((0.0f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1003
|
||
|
fn c483_l1003_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c483_l1003_action_invoke");
|
||
|
let result = instance.call("f64.no_fold_ge_if", &[Value::F64((0.0f64).to_bits()), Value::F64((-0.0f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((0.0f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1004
|
||
|
fn c484_l1004_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c484_l1004_action_invoke");
|
||
|
let result = instance.call("f64.no_fold_ge_if", &[Value::F64((-0.0f64).to_bits()), Value::F64((0.0f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((-0.0f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1008
|
||
|
|
||
|
#[test]
|
||
|
fn test_module_45() {
|
||
|
let mut instance = create_module_45();
|
||
|
// We group the calls together
|
||
|
start_module_45(&mut instance);
|
||
|
c453_l973_action_invoke(&mut instance);
|
||
|
c454_l974_action_invoke(&mut instance);
|
||
|
c455_l975_action_invoke(&mut instance);
|
||
|
c456_l976_action_invoke(&mut instance);
|
||
|
c457_l977_action_invoke(&mut instance);
|
||
|
c458_l978_action_invoke(&mut instance);
|
||
|
c459_l979_action_invoke(&mut instance);
|
||
|
c460_l980_action_invoke(&mut instance);
|
||
|
c461_l981_action_invoke(&mut instance);
|
||
|
c462_l982_action_invoke(&mut instance);
|
||
|
c463_l983_action_invoke(&mut instance);
|
||
|
c464_l984_action_invoke(&mut instance);
|
||
|
c465_l985_action_invoke(&mut instance);
|
||
|
c466_l986_action_invoke(&mut instance);
|
||
|
c467_l987_action_invoke(&mut instance);
|
||
|
c468_l988_action_invoke(&mut instance);
|
||
|
c469_l989_action_invoke(&mut instance);
|
||
|
c470_l990_action_invoke(&mut instance);
|
||
|
c471_l991_action_invoke(&mut instance);
|
||
|
c472_l992_action_invoke(&mut instance);
|
||
|
c473_l993_action_invoke(&mut instance);
|
||
|
c474_l994_action_invoke(&mut instance);
|
||
|
c475_l995_action_invoke(&mut instance);
|
||
|
c476_l996_action_invoke(&mut instance);
|
||
|
c477_l997_action_invoke(&mut instance);
|
||
|
c478_l998_action_invoke(&mut instance);
|
||
|
c479_l999_action_invoke(&mut instance);
|
||
|
c480_l1000_action_invoke(&mut instance);
|
||
|
c481_l1001_action_invoke(&mut instance);
|
||
|
c482_l1002_action_invoke(&mut instance);
|
||
|
c483_l1003_action_invoke(&mut instance);
|
||
|
c484_l1004_action_invoke(&mut instance);
|
||
|
}
|
||
|
fn create_module_46() -> Box<Instance> {
|
||
|
let module_str = "(module
|
||
|
(type (;0;) (func (param f32) (result f32)))
|
||
|
(type (;1;) (func (param f64) (result f64)))
|
||
|
(func (;0;) (type 0) (param f32) (result f32)
|
||
|
get_local 0
|
||
|
f32.neg
|
||
|
get_local 0
|
||
|
get_local 0
|
||
|
f32.const 0x0p+0 (;=0;)
|
||
|
f32.lt
|
||
|
select)
|
||
|
(func (;1;) (type 0) (param f32) (result f32)
|
||
|
get_local 0
|
||
|
f32.neg
|
||
|
get_local 0
|
||
|
get_local 0
|
||
|
f32.const -0x0p+0 (;=-0;)
|
||
|
f32.le
|
||
|
select)
|
||
|
(func (;2;) (type 0) (param f32) (result f32)
|
||
|
get_local 0
|
||
|
get_local 0
|
||
|
f32.neg
|
||
|
get_local 0
|
||
|
f32.const -0x0p+0 (;=-0;)
|
||
|
f32.gt
|
||
|
select)
|
||
|
(func (;3;) (type 0) (param f32) (result f32)
|
||
|
get_local 0
|
||
|
get_local 0
|
||
|
f32.neg
|
||
|
get_local 0
|
||
|
f32.const 0x0p+0 (;=0;)
|
||
|
f32.ge
|
||
|
select)
|
||
|
(func (;4;) (type 1) (param f64) (result f64)
|
||
|
get_local 0
|
||
|
f64.neg
|
||
|
get_local 0
|
||
|
get_local 0
|
||
|
f64.const 0x0p+0 (;=0;)
|
||
|
f64.lt
|
||
|
select)
|
||
|
(func (;5;) (type 1) (param f64) (result f64)
|
||
|
get_local 0
|
||
|
f64.neg
|
||
|
get_local 0
|
||
|
get_local 0
|
||
|
f64.const -0x0p+0 (;=-0;)
|
||
|
f64.le
|
||
|
select)
|
||
|
(func (;6;) (type 1) (param f64) (result f64)
|
||
|
get_local 0
|
||
|
get_local 0
|
||
|
f64.neg
|
||
|
get_local 0
|
||
|
f64.const -0x0p+0 (;=-0;)
|
||
|
f64.gt
|
||
|
select)
|
||
|
(func (;7;) (type 1) (param f64) (result f64)
|
||
|
get_local 0
|
||
|
get_local 0
|
||
|
f64.neg
|
||
|
get_local 0
|
||
|
f64.const 0x0p+0 (;=0;)
|
||
|
f64.ge
|
||
|
select)
|
||
|
(export \"f32.no_fold_lt_select_to_abs\" (func 0))
|
||
|
(export \"f32.no_fold_le_select_to_abs\" (func 1))
|
||
|
(export \"f32.no_fold_gt_select_to_abs\" (func 2))
|
||
|
(export \"f32.no_fold_ge_select_to_abs\" (func 3))
|
||
|
(export \"f64.no_fold_lt_select_to_abs\" (func 4))
|
||
|
(export \"f64.no_fold_le_select_to_abs\" (func 5))
|
||
|
(export \"f64.no_fold_gt_select_to_abs\" (func 6))
|
||
|
(export \"f64.no_fold_ge_select_to_abs\" (func 7)))
|
||
|
";
|
||
|
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_46(instance: &mut Instance) {
|
||
|
// TODO Review is explicit start needed? Start now called in runtime::Instance::new()
|
||
|
//instance.start();
|
||
|
}
|
||
|
|
||
|
// Line 1020
|
||
|
fn c486_l1020_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c486_l1020_action_invoke");
|
||
|
let result = instance.call("f32.no_fold_lt_select_to_abs", &[Value::F32(f32::from_bits(2141192192) as u32)]);
|
||
|
let expected = f32::from_bits(2141192192);
|
||
|
if let Value::F32(result) = result.clone().unwrap().unwrap() {
|
||
|
assert!((result as f32).is_nan());
|
||
|
assert_eq!((result as f32).is_sign_positive(), (expected as f32).is_sign_positive());
|
||
|
} else {
|
||
|
panic!("Unexpected result type {:?}", result);
|
||
|
}
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1021
|
||
|
fn c487_l1021_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c487_l1021_action_invoke");
|
||
|
let result = instance.call("f32.no_fold_lt_select_to_abs", &[Value::F32(f32::from_bits(4290772992) as u32)]);
|
||
|
let expected = f32::from_bits(4290772992);
|
||
|
if let Value::F32(result) = result.clone().unwrap().unwrap() {
|
||
|
assert!((result as f32).is_nan());
|
||
|
assert_eq!((result as f32).is_sign_positive(), (expected as f32).is_sign_positive());
|
||
|
} else {
|
||
|
panic!("Unexpected result type {:?}", result);
|
||
|
}
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1022
|
||
|
fn c488_l1022_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c488_l1022_action_invoke");
|
||
|
let result = instance.call("f32.no_fold_lt_select_to_abs", &[Value::F32((0.0f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((0.0f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1023
|
||
|
fn c489_l1023_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c489_l1023_action_invoke");
|
||
|
let result = instance.call("f32.no_fold_lt_select_to_abs", &[Value::F32((-0.0f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((-0.0f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1024
|
||
|
fn c490_l1024_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c490_l1024_action_invoke");
|
||
|
let result = instance.call("f32.no_fold_le_select_to_abs", &[Value::F32(f32::from_bits(2141192192) as u32)]);
|
||
|
let expected = f32::from_bits(2141192192);
|
||
|
if let Value::F32(result) = result.clone().unwrap().unwrap() {
|
||
|
assert!((result as f32).is_nan());
|
||
|
assert_eq!((result as f32).is_sign_positive(), (expected as f32).is_sign_positive());
|
||
|
} else {
|
||
|
panic!("Unexpected result type {:?}", result);
|
||
|
}
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1025
|
||
|
fn c491_l1025_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c491_l1025_action_invoke");
|
||
|
let result = instance.call("f32.no_fold_le_select_to_abs", &[Value::F32(f32::from_bits(4290772992) as u32)]);
|
||
|
let expected = f32::from_bits(4290772992);
|
||
|
if let Value::F32(result) = result.clone().unwrap().unwrap() {
|
||
|
assert!((result as f32).is_nan());
|
||
|
assert_eq!((result as f32).is_sign_positive(), (expected as f32).is_sign_positive());
|
||
|
} else {
|
||
|
panic!("Unexpected result type {:?}", result);
|
||
|
}
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1026
|
||
|
fn c492_l1026_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c492_l1026_action_invoke");
|
||
|
let result = instance.call("f32.no_fold_le_select_to_abs", &[Value::F32((0.0f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((-0.0f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1027
|
||
|
fn c493_l1027_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c493_l1027_action_invoke");
|
||
|
let result = instance.call("f32.no_fold_le_select_to_abs", &[Value::F32((-0.0f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((0.0f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1028
|
||
|
fn c494_l1028_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c494_l1028_action_invoke");
|
||
|
let result = instance.call("f32.no_fold_gt_select_to_abs", &[Value::F32(f32::from_bits(2141192192) as u32)]);
|
||
|
let expected = f32::from_bits(4288675840);
|
||
|
if let Value::F32(result) = result.clone().unwrap().unwrap() {
|
||
|
assert!((result as f32).is_nan());
|
||
|
assert_eq!((result as f32).is_sign_positive(), (expected as f32).is_sign_positive());
|
||
|
} else {
|
||
|
panic!("Unexpected result type {:?}", result);
|
||
|
}
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1029
|
||
|
fn c495_l1029_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c495_l1029_action_invoke");
|
||
|
let result = instance.call("f32.no_fold_gt_select_to_abs", &[Value::F32(f32::from_bits(4290772992) as u32)]);
|
||
|
let expected = f32::from_bits(2143289344);
|
||
|
if let Value::F32(result) = result.clone().unwrap().unwrap() {
|
||
|
assert!((result as f32).is_nan());
|
||
|
assert_eq!((result as f32).is_sign_positive(), (expected as f32).is_sign_positive());
|
||
|
} else {
|
||
|
panic!("Unexpected result type {:?}", result);
|
||
|
}
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1030
|
||
|
fn c496_l1030_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c496_l1030_action_invoke");
|
||
|
let result = instance.call("f32.no_fold_gt_select_to_abs", &[Value::F32((0.0f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((-0.0f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1031
|
||
|
fn c497_l1031_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c497_l1031_action_invoke");
|
||
|
let result = instance.call("f32.no_fold_gt_select_to_abs", &[Value::F32((-0.0f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((0.0f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1032
|
||
|
fn c498_l1032_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c498_l1032_action_invoke");
|
||
|
let result = instance.call("f32.no_fold_ge_select_to_abs", &[Value::F32(f32::from_bits(2141192192) as u32)]);
|
||
|
let expected = f32::from_bits(4288675840);
|
||
|
if let Value::F32(result) = result.clone().unwrap().unwrap() {
|
||
|
assert!((result as f32).is_nan());
|
||
|
assert_eq!((result as f32).is_sign_positive(), (expected as f32).is_sign_positive());
|
||
|
} else {
|
||
|
panic!("Unexpected result type {:?}", result);
|
||
|
}
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1033
|
||
|
fn c499_l1033_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c499_l1033_action_invoke");
|
||
|
let result = instance.call("f32.no_fold_ge_select_to_abs", &[Value::F32(f32::from_bits(4290772992) as u32)]);
|
||
|
let expected = f32::from_bits(2143289344);
|
||
|
if let Value::F32(result) = result.clone().unwrap().unwrap() {
|
||
|
assert!((result as f32).is_nan());
|
||
|
assert_eq!((result as f32).is_sign_positive(), (expected as f32).is_sign_positive());
|
||
|
} else {
|
||
|
panic!("Unexpected result type {:?}", result);
|
||
|
}
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1034
|
||
|
fn c500_l1034_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c500_l1034_action_invoke");
|
||
|
let result = instance.call("f32.no_fold_ge_select_to_abs", &[Value::F32((0.0f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((0.0f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1035
|
||
|
fn c501_l1035_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c501_l1035_action_invoke");
|
||
|
let result = instance.call("f32.no_fold_ge_select_to_abs", &[Value::F32((-0.0f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((-0.0f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1036
|
||
|
fn c502_l1036_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c502_l1036_action_invoke");
|
||
|
let result = instance.call("f64.no_fold_lt_select_to_abs", &[Value::F64(f64::from_bits(9219994337134247936) as u64)]);
|
||
|
let expected = f64::from_bits(9219994337134247936);
|
||
|
if let Value::F64(result) = result.clone().unwrap().unwrap() {
|
||
|
assert!((result as f64).is_nan());
|
||
|
assert_eq!((result as f64).is_sign_positive(), (expected as f64).is_sign_positive());
|
||
|
} else {
|
||
|
panic!("Unexpected result type {:?}", result);
|
||
|
}
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1037
|
||
|
fn c503_l1037_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c503_l1037_action_invoke");
|
||
|
let result = instance.call("f64.no_fold_lt_select_to_abs", &[Value::F64(f64::from_bits(18444492273895866368) as u64)]);
|
||
|
let expected = f64::from_bits(18444492273895866368);
|
||
|
if let Value::F64(result) = result.clone().unwrap().unwrap() {
|
||
|
assert!((result as f64).is_nan());
|
||
|
assert_eq!((result as f64).is_sign_positive(), (expected as f64).is_sign_positive());
|
||
|
} else {
|
||
|
panic!("Unexpected result type {:?}", result);
|
||
|
}
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1038
|
||
|
fn c504_l1038_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c504_l1038_action_invoke");
|
||
|
let result = instance.call("f64.no_fold_lt_select_to_abs", &[Value::F64((0.0f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((0.0f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1039
|
||
|
fn c505_l1039_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c505_l1039_action_invoke");
|
||
|
let result = instance.call("f64.no_fold_lt_select_to_abs", &[Value::F64((-0.0f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((-0.0f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1040
|
||
|
fn c506_l1040_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c506_l1040_action_invoke");
|
||
|
let result = instance.call("f64.no_fold_le_select_to_abs", &[Value::F64(f64::from_bits(9219994337134247936) as u64)]);
|
||
|
let expected = f64::from_bits(9219994337134247936);
|
||
|
if let Value::F64(result) = result.clone().unwrap().unwrap() {
|
||
|
assert!((result as f64).is_nan());
|
||
|
assert_eq!((result as f64).is_sign_positive(), (expected as f64).is_sign_positive());
|
||
|
} else {
|
||
|
panic!("Unexpected result type {:?}", result);
|
||
|
}
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1041
|
||
|
fn c507_l1041_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c507_l1041_action_invoke");
|
||
|
let result = instance.call("f64.no_fold_le_select_to_abs", &[Value::F64(f64::from_bits(18444492273895866368) as u64)]);
|
||
|
let expected = f64::from_bits(18444492273895866368);
|
||
|
if let Value::F64(result) = result.clone().unwrap().unwrap() {
|
||
|
assert!((result as f64).is_nan());
|
||
|
assert_eq!((result as f64).is_sign_positive(), (expected as f64).is_sign_positive());
|
||
|
} else {
|
||
|
panic!("Unexpected result type {:?}", result);
|
||
|
}
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1042
|
||
|
fn c508_l1042_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c508_l1042_action_invoke");
|
||
|
let result = instance.call("f64.no_fold_le_select_to_abs", &[Value::F64((0.0f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((-0.0f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1043
|
||
|
fn c509_l1043_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c509_l1043_action_invoke");
|
||
|
let result = instance.call("f64.no_fold_le_select_to_abs", &[Value::F64((-0.0f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((0.0f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1044
|
||
|
fn c510_l1044_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c510_l1044_action_invoke");
|
||
|
let result = instance.call("f64.no_fold_gt_select_to_abs", &[Value::F64(f64::from_bits(9219994337134247936) as u64)]);
|
||
|
let expected = f64::from_bits(18443366373989023744);
|
||
|
if let Value::F64(result) = result.clone().unwrap().unwrap() {
|
||
|
assert!((result as f64).is_nan());
|
||
|
assert_eq!((result as f64).is_sign_positive(), (expected as f64).is_sign_positive());
|
||
|
} else {
|
||
|
panic!("Unexpected result type {:?}", result);
|
||
|
}
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1045
|
||
|
fn c511_l1045_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c511_l1045_action_invoke");
|
||
|
let result = instance.call("f64.no_fold_gt_select_to_abs", &[Value::F64(f64::from_bits(18444492273895866368) as u64)]);
|
||
|
let expected = f64::from_bits(9221120237041090560);
|
||
|
if let Value::F64(result) = result.clone().unwrap().unwrap() {
|
||
|
assert!((result as f64).is_nan());
|
||
|
assert_eq!((result as f64).is_sign_positive(), (expected as f64).is_sign_positive());
|
||
|
} else {
|
||
|
panic!("Unexpected result type {:?}", result);
|
||
|
}
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1046
|
||
|
fn c512_l1046_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c512_l1046_action_invoke");
|
||
|
let result = instance.call("f64.no_fold_gt_select_to_abs", &[Value::F64((0.0f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((-0.0f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1047
|
||
|
fn c513_l1047_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c513_l1047_action_invoke");
|
||
|
let result = instance.call("f64.no_fold_gt_select_to_abs", &[Value::F64((-0.0f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((0.0f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1048
|
||
|
fn c514_l1048_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c514_l1048_action_invoke");
|
||
|
let result = instance.call("f64.no_fold_ge_select_to_abs", &[Value::F64(f64::from_bits(9219994337134247936) as u64)]);
|
||
|
let expected = f64::from_bits(18443366373989023744);
|
||
|
if let Value::F64(result) = result.clone().unwrap().unwrap() {
|
||
|
assert!((result as f64).is_nan());
|
||
|
assert_eq!((result as f64).is_sign_positive(), (expected as f64).is_sign_positive());
|
||
|
} else {
|
||
|
panic!("Unexpected result type {:?}", result);
|
||
|
}
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1049
|
||
|
fn c515_l1049_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c515_l1049_action_invoke");
|
||
|
let result = instance.call("f64.no_fold_ge_select_to_abs", &[Value::F64(f64::from_bits(18444492273895866368) as u64)]);
|
||
|
let expected = f64::from_bits(9221120237041090560);
|
||
|
if let Value::F64(result) = result.clone().unwrap().unwrap() {
|
||
|
assert!((result as f64).is_nan());
|
||
|
assert_eq!((result as f64).is_sign_positive(), (expected as f64).is_sign_positive());
|
||
|
} else {
|
||
|
panic!("Unexpected result type {:?}", result);
|
||
|
}
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1050
|
||
|
fn c516_l1050_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c516_l1050_action_invoke");
|
||
|
let result = instance.call("f64.no_fold_ge_select_to_abs", &[Value::F64((0.0f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((0.0f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1051
|
||
|
fn c517_l1051_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c517_l1051_action_invoke");
|
||
|
let result = instance.call("f64.no_fold_ge_select_to_abs", &[Value::F64((-0.0f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((-0.0f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1055
|
||
|
|
||
|
#[test]
|
||
|
fn test_module_46() {
|
||
|
let mut instance = create_module_46();
|
||
|
// We group the calls together
|
||
|
start_module_46(&mut instance);
|
||
|
c486_l1020_action_invoke(&mut instance);
|
||
|
c487_l1021_action_invoke(&mut instance);
|
||
|
c488_l1022_action_invoke(&mut instance);
|
||
|
c489_l1023_action_invoke(&mut instance);
|
||
|
c490_l1024_action_invoke(&mut instance);
|
||
|
c491_l1025_action_invoke(&mut instance);
|
||
|
c492_l1026_action_invoke(&mut instance);
|
||
|
c493_l1027_action_invoke(&mut instance);
|
||
|
c494_l1028_action_invoke(&mut instance);
|
||
|
c495_l1029_action_invoke(&mut instance);
|
||
|
c496_l1030_action_invoke(&mut instance);
|
||
|
c497_l1031_action_invoke(&mut instance);
|
||
|
c498_l1032_action_invoke(&mut instance);
|
||
|
c499_l1033_action_invoke(&mut instance);
|
||
|
c500_l1034_action_invoke(&mut instance);
|
||
|
c501_l1035_action_invoke(&mut instance);
|
||
|
c502_l1036_action_invoke(&mut instance);
|
||
|
c503_l1037_action_invoke(&mut instance);
|
||
|
c504_l1038_action_invoke(&mut instance);
|
||
|
c505_l1039_action_invoke(&mut instance);
|
||
|
c506_l1040_action_invoke(&mut instance);
|
||
|
c507_l1041_action_invoke(&mut instance);
|
||
|
c508_l1042_action_invoke(&mut instance);
|
||
|
c509_l1043_action_invoke(&mut instance);
|
||
|
c510_l1044_action_invoke(&mut instance);
|
||
|
c511_l1045_action_invoke(&mut instance);
|
||
|
c512_l1046_action_invoke(&mut instance);
|
||
|
c513_l1047_action_invoke(&mut instance);
|
||
|
c514_l1048_action_invoke(&mut instance);
|
||
|
c515_l1049_action_invoke(&mut instance);
|
||
|
c516_l1050_action_invoke(&mut instance);
|
||
|
c517_l1051_action_invoke(&mut instance);
|
||
|
}
|
||
|
fn create_module_47() -> Box<Instance> {
|
||
|
let module_str = "(module
|
||
|
(type (;0;) (func (param f32) (result f32)))
|
||
|
(type (;1;) (func (param f64) (result f64)))
|
||
|
(func (;0;) (type 0) (param f32) (result f32)
|
||
|
get_local 0
|
||
|
f32.const 0x0p+0 (;=0;)
|
||
|
f32.lt
|
||
|
if (result f32) ;; label = @1
|
||
|
get_local 0
|
||
|
f32.neg
|
||
|
else
|
||
|
get_local 0
|
||
|
end)
|
||
|
(func (;1;) (type 0) (param f32) (result f32)
|
||
|
get_local 0
|
||
|
f32.const -0x0p+0 (;=-0;)
|
||
|
f32.le
|
||
|
if (result f32) ;; label = @1
|
||
|
get_local 0
|
||
|
f32.neg
|
||
|
else
|
||
|
get_local 0
|
||
|
end)
|
||
|
(func (;2;) (type 0) (param f32) (result f32)
|
||
|
get_local 0
|
||
|
f32.const -0x0p+0 (;=-0;)
|
||
|
f32.gt
|
||
|
if (result f32) ;; label = @1
|
||
|
get_local 0
|
||
|
else
|
||
|
get_local 0
|
||
|
f32.neg
|
||
|
end)
|
||
|
(func (;3;) (type 0) (param f32) (result f32)
|
||
|
get_local 0
|
||
|
f32.const 0x0p+0 (;=0;)
|
||
|
f32.ge
|
||
|
if (result f32) ;; label = @1
|
||
|
get_local 0
|
||
|
else
|
||
|
get_local 0
|
||
|
f32.neg
|
||
|
end)
|
||
|
(func (;4;) (type 1) (param f64) (result f64)
|
||
|
get_local 0
|
||
|
f64.const 0x0p+0 (;=0;)
|
||
|
f64.lt
|
||
|
if (result f64) ;; label = @1
|
||
|
get_local 0
|
||
|
f64.neg
|
||
|
else
|
||
|
get_local 0
|
||
|
end)
|
||
|
(func (;5;) (type 1) (param f64) (result f64)
|
||
|
get_local 0
|
||
|
f64.const -0x0p+0 (;=-0;)
|
||
|
f64.le
|
||
|
if (result f64) ;; label = @1
|
||
|
get_local 0
|
||
|
f64.neg
|
||
|
else
|
||
|
get_local 0
|
||
|
end)
|
||
|
(func (;6;) (type 1) (param f64) (result f64)
|
||
|
get_local 0
|
||
|
f64.const -0x0p+0 (;=-0;)
|
||
|
f64.gt
|
||
|
if (result f64) ;; label = @1
|
||
|
get_local 0
|
||
|
else
|
||
|
get_local 0
|
||
|
f64.neg
|
||
|
end)
|
||
|
(func (;7;) (type 1) (param f64) (result f64)
|
||
|
get_local 0
|
||
|
f64.const 0x0p+0 (;=0;)
|
||
|
f64.ge
|
||
|
if (result f64) ;; label = @1
|
||
|
get_local 0
|
||
|
else
|
||
|
get_local 0
|
||
|
f64.neg
|
||
|
end)
|
||
|
(export \"f32.no_fold_lt_if_to_abs\" (func 0))
|
||
|
(export \"f32.no_fold_le_if_to_abs\" (func 1))
|
||
|
(export \"f32.no_fold_gt_if_to_abs\" (func 2))
|
||
|
(export \"f32.no_fold_ge_if_to_abs\" (func 3))
|
||
|
(export \"f64.no_fold_lt_if_to_abs\" (func 4))
|
||
|
(export \"f64.no_fold_le_if_to_abs\" (func 5))
|
||
|
(export \"f64.no_fold_gt_if_to_abs\" (func 6))
|
||
|
(export \"f64.no_fold_ge_if_to_abs\" (func 7)))
|
||
|
";
|
||
|
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_47(instance: &mut Instance) {
|
||
|
// TODO Review is explicit start needed? Start now called in runtime::Instance::new()
|
||
|
//instance.start();
|
||
|
}
|
||
|
|
||
|
// Line 1099
|
||
|
fn c519_l1099_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c519_l1099_action_invoke");
|
||
|
let result = instance.call("f32.no_fold_lt_if_to_abs", &[Value::F32(f32::from_bits(2141192192) as u32)]);
|
||
|
let expected = f32::from_bits(2141192192);
|
||
|
if let Value::F32(result) = result.clone().unwrap().unwrap() {
|
||
|
assert!((result as f32).is_nan());
|
||
|
assert_eq!((result as f32).is_sign_positive(), (expected as f32).is_sign_positive());
|
||
|
} else {
|
||
|
panic!("Unexpected result type {:?}", result);
|
||
|
}
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1100
|
||
|
fn c520_l1100_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c520_l1100_action_invoke");
|
||
|
let result = instance.call("f32.no_fold_lt_if_to_abs", &[Value::F32(f32::from_bits(4290772992) as u32)]);
|
||
|
let expected = f32::from_bits(4290772992);
|
||
|
if let Value::F32(result) = result.clone().unwrap().unwrap() {
|
||
|
assert!((result as f32).is_nan());
|
||
|
assert_eq!((result as f32).is_sign_positive(), (expected as f32).is_sign_positive());
|
||
|
} else {
|
||
|
panic!("Unexpected result type {:?}", result);
|
||
|
}
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1101
|
||
|
fn c521_l1101_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c521_l1101_action_invoke");
|
||
|
let result = instance.call("f32.no_fold_lt_if_to_abs", &[Value::F32((0.0f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((0.0f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1102
|
||
|
fn c522_l1102_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c522_l1102_action_invoke");
|
||
|
let result = instance.call("f32.no_fold_lt_if_to_abs", &[Value::F32((-0.0f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((-0.0f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1103
|
||
|
fn c523_l1103_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c523_l1103_action_invoke");
|
||
|
let result = instance.call("f32.no_fold_le_if_to_abs", &[Value::F32(f32::from_bits(2141192192) as u32)]);
|
||
|
let expected = f32::from_bits(2141192192);
|
||
|
if let Value::F32(result) = result.clone().unwrap().unwrap() {
|
||
|
assert!((result as f32).is_nan());
|
||
|
assert_eq!((result as f32).is_sign_positive(), (expected as f32).is_sign_positive());
|
||
|
} else {
|
||
|
panic!("Unexpected result type {:?}", result);
|
||
|
}
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1104
|
||
|
fn c524_l1104_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c524_l1104_action_invoke");
|
||
|
let result = instance.call("f32.no_fold_le_if_to_abs", &[Value::F32(f32::from_bits(4290772992) as u32)]);
|
||
|
let expected = f32::from_bits(4290772992);
|
||
|
if let Value::F32(result) = result.clone().unwrap().unwrap() {
|
||
|
assert!((result as f32).is_nan());
|
||
|
assert_eq!((result as f32).is_sign_positive(), (expected as f32).is_sign_positive());
|
||
|
} else {
|
||
|
panic!("Unexpected result type {:?}", result);
|
||
|
}
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1105
|
||
|
fn c525_l1105_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c525_l1105_action_invoke");
|
||
|
let result = instance.call("f32.no_fold_le_if_to_abs", &[Value::F32((0.0f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((-0.0f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1106
|
||
|
fn c526_l1106_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c526_l1106_action_invoke");
|
||
|
let result = instance.call("f32.no_fold_le_if_to_abs", &[Value::F32((-0.0f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((0.0f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1107
|
||
|
fn c527_l1107_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c527_l1107_action_invoke");
|
||
|
let result = instance.call("f32.no_fold_gt_if_to_abs", &[Value::F32(f32::from_bits(2141192192) as u32)]);
|
||
|
let expected = f32::from_bits(4288675840);
|
||
|
if let Value::F32(result) = result.clone().unwrap().unwrap() {
|
||
|
assert!((result as f32).is_nan());
|
||
|
assert_eq!((result as f32).is_sign_positive(), (expected as f32).is_sign_positive());
|
||
|
} else {
|
||
|
panic!("Unexpected result type {:?}", result);
|
||
|
}
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1108
|
||
|
fn c528_l1108_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c528_l1108_action_invoke");
|
||
|
let result = instance.call("f32.no_fold_gt_if_to_abs", &[Value::F32(f32::from_bits(4290772992) as u32)]);
|
||
|
let expected = f32::from_bits(2143289344);
|
||
|
if let Value::F32(result) = result.clone().unwrap().unwrap() {
|
||
|
assert!((result as f32).is_nan());
|
||
|
assert_eq!((result as f32).is_sign_positive(), (expected as f32).is_sign_positive());
|
||
|
} else {
|
||
|
panic!("Unexpected result type {:?}", result);
|
||
|
}
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1109
|
||
|
fn c529_l1109_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c529_l1109_action_invoke");
|
||
|
let result = instance.call("f32.no_fold_gt_if_to_abs", &[Value::F32((0.0f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((-0.0f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1110
|
||
|
fn c530_l1110_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c530_l1110_action_invoke");
|
||
|
let result = instance.call("f32.no_fold_gt_if_to_abs", &[Value::F32((-0.0f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((0.0f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1111
|
||
|
fn c531_l1111_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c531_l1111_action_invoke");
|
||
|
let result = instance.call("f32.no_fold_ge_if_to_abs", &[Value::F32(f32::from_bits(2141192192) as u32)]);
|
||
|
let expected = f32::from_bits(4288675840);
|
||
|
if let Value::F32(result) = result.clone().unwrap().unwrap() {
|
||
|
assert!((result as f32).is_nan());
|
||
|
assert_eq!((result as f32).is_sign_positive(), (expected as f32).is_sign_positive());
|
||
|
} else {
|
||
|
panic!("Unexpected result type {:?}", result);
|
||
|
}
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1112
|
||
|
fn c532_l1112_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c532_l1112_action_invoke");
|
||
|
let result = instance.call("f32.no_fold_ge_if_to_abs", &[Value::F32(f32::from_bits(4290772992) as u32)]);
|
||
|
let expected = f32::from_bits(2143289344);
|
||
|
if let Value::F32(result) = result.clone().unwrap().unwrap() {
|
||
|
assert!((result as f32).is_nan());
|
||
|
assert_eq!((result as f32).is_sign_positive(), (expected as f32).is_sign_positive());
|
||
|
} else {
|
||
|
panic!("Unexpected result type {:?}", result);
|
||
|
}
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1113
|
||
|
fn c533_l1113_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c533_l1113_action_invoke");
|
||
|
let result = instance.call("f32.no_fold_ge_if_to_abs", &[Value::F32((0.0f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((0.0f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1114
|
||
|
fn c534_l1114_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c534_l1114_action_invoke");
|
||
|
let result = instance.call("f32.no_fold_ge_if_to_abs", &[Value::F32((-0.0f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((-0.0f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1115
|
||
|
fn c535_l1115_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c535_l1115_action_invoke");
|
||
|
let result = instance.call("f64.no_fold_lt_if_to_abs", &[Value::F64(f64::from_bits(9219994337134247936) as u64)]);
|
||
|
let expected = f64::from_bits(9219994337134247936);
|
||
|
if let Value::F64(result) = result.clone().unwrap().unwrap() {
|
||
|
assert!((result as f64).is_nan());
|
||
|
assert_eq!((result as f64).is_sign_positive(), (expected as f64).is_sign_positive());
|
||
|
} else {
|
||
|
panic!("Unexpected result type {:?}", result);
|
||
|
}
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1116
|
||
|
fn c536_l1116_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c536_l1116_action_invoke");
|
||
|
let result = instance.call("f64.no_fold_lt_if_to_abs", &[Value::F64(f64::from_bits(18444492273895866368) as u64)]);
|
||
|
let expected = f64::from_bits(18444492273895866368);
|
||
|
if let Value::F64(result) = result.clone().unwrap().unwrap() {
|
||
|
assert!((result as f64).is_nan());
|
||
|
assert_eq!((result as f64).is_sign_positive(), (expected as f64).is_sign_positive());
|
||
|
} else {
|
||
|
panic!("Unexpected result type {:?}", result);
|
||
|
}
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1117
|
||
|
fn c537_l1117_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c537_l1117_action_invoke");
|
||
|
let result = instance.call("f64.no_fold_lt_if_to_abs", &[Value::F64((0.0f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((0.0f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1118
|
||
|
fn c538_l1118_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c538_l1118_action_invoke");
|
||
|
let result = instance.call("f64.no_fold_lt_if_to_abs", &[Value::F64((-0.0f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((-0.0f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1119
|
||
|
fn c539_l1119_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c539_l1119_action_invoke");
|
||
|
let result = instance.call("f64.no_fold_le_if_to_abs", &[Value::F64(f64::from_bits(9219994337134247936) as u64)]);
|
||
|
let expected = f64::from_bits(9219994337134247936);
|
||
|
if let Value::F64(result) = result.clone().unwrap().unwrap() {
|
||
|
assert!((result as f64).is_nan());
|
||
|
assert_eq!((result as f64).is_sign_positive(), (expected as f64).is_sign_positive());
|
||
|
} else {
|
||
|
panic!("Unexpected result type {:?}", result);
|
||
|
}
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1120
|
||
|
fn c540_l1120_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c540_l1120_action_invoke");
|
||
|
let result = instance.call("f64.no_fold_le_if_to_abs", &[Value::F64(f64::from_bits(18444492273895866368) as u64)]);
|
||
|
let expected = f64::from_bits(18444492273895866368);
|
||
|
if let Value::F64(result) = result.clone().unwrap().unwrap() {
|
||
|
assert!((result as f64).is_nan());
|
||
|
assert_eq!((result as f64).is_sign_positive(), (expected as f64).is_sign_positive());
|
||
|
} else {
|
||
|
panic!("Unexpected result type {:?}", result);
|
||
|
}
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1121
|
||
|
fn c541_l1121_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c541_l1121_action_invoke");
|
||
|
let result = instance.call("f64.no_fold_le_if_to_abs", &[Value::F64((0.0f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((-0.0f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1122
|
||
|
fn c542_l1122_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c542_l1122_action_invoke");
|
||
|
let result = instance.call("f64.no_fold_le_if_to_abs", &[Value::F64((-0.0f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((0.0f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1123
|
||
|
fn c543_l1123_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c543_l1123_action_invoke");
|
||
|
let result = instance.call("f64.no_fold_gt_if_to_abs", &[Value::F64(f64::from_bits(9219994337134247936) as u64)]);
|
||
|
let expected = f64::from_bits(18443366373989023744);
|
||
|
if let Value::F64(result) = result.clone().unwrap().unwrap() {
|
||
|
assert!((result as f64).is_nan());
|
||
|
assert_eq!((result as f64).is_sign_positive(), (expected as f64).is_sign_positive());
|
||
|
} else {
|
||
|
panic!("Unexpected result type {:?}", result);
|
||
|
}
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1124
|
||
|
fn c544_l1124_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c544_l1124_action_invoke");
|
||
|
let result = instance.call("f64.no_fold_gt_if_to_abs", &[Value::F64(f64::from_bits(18444492273895866368) as u64)]);
|
||
|
let expected = f64::from_bits(9221120237041090560);
|
||
|
if let Value::F64(result) = result.clone().unwrap().unwrap() {
|
||
|
assert!((result as f64).is_nan());
|
||
|
assert_eq!((result as f64).is_sign_positive(), (expected as f64).is_sign_positive());
|
||
|
} else {
|
||
|
panic!("Unexpected result type {:?}", result);
|
||
|
}
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1125
|
||
|
fn c545_l1125_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c545_l1125_action_invoke");
|
||
|
let result = instance.call("f64.no_fold_gt_if_to_abs", &[Value::F64((0.0f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((-0.0f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1126
|
||
|
fn c546_l1126_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c546_l1126_action_invoke");
|
||
|
let result = instance.call("f64.no_fold_gt_if_to_abs", &[Value::F64((-0.0f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((0.0f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1127
|
||
|
fn c547_l1127_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c547_l1127_action_invoke");
|
||
|
let result = instance.call("f64.no_fold_ge_if_to_abs", &[Value::F64(f64::from_bits(9219994337134247936) as u64)]);
|
||
|
let expected = f64::from_bits(18443366373989023744);
|
||
|
if let Value::F64(result) = result.clone().unwrap().unwrap() {
|
||
|
assert!((result as f64).is_nan());
|
||
|
assert_eq!((result as f64).is_sign_positive(), (expected as f64).is_sign_positive());
|
||
|
} else {
|
||
|
panic!("Unexpected result type {:?}", result);
|
||
|
}
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1128
|
||
|
fn c548_l1128_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c548_l1128_action_invoke");
|
||
|
let result = instance.call("f64.no_fold_ge_if_to_abs", &[Value::F64(f64::from_bits(18444492273895866368) as u64)]);
|
||
|
let expected = f64::from_bits(9221120237041090560);
|
||
|
if let Value::F64(result) = result.clone().unwrap().unwrap() {
|
||
|
assert!((result as f64).is_nan());
|
||
|
assert_eq!((result as f64).is_sign_positive(), (expected as f64).is_sign_positive());
|
||
|
} else {
|
||
|
panic!("Unexpected result type {:?}", result);
|
||
|
}
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1129
|
||
|
fn c549_l1129_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c549_l1129_action_invoke");
|
||
|
let result = instance.call("f64.no_fold_ge_if_to_abs", &[Value::F64((0.0f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((0.0f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1130
|
||
|
fn c550_l1130_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c550_l1130_action_invoke");
|
||
|
let result = instance.call("f64.no_fold_ge_if_to_abs", &[Value::F64((-0.0f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((-0.0f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1135
|
||
|
|
||
|
#[test]
|
||
|
fn test_module_47() {
|
||
|
let mut instance = create_module_47();
|
||
|
// We group the calls together
|
||
|
start_module_47(&mut instance);
|
||
|
c519_l1099_action_invoke(&mut instance);
|
||
|
c520_l1100_action_invoke(&mut instance);
|
||
|
c521_l1101_action_invoke(&mut instance);
|
||
|
c522_l1102_action_invoke(&mut instance);
|
||
|
c523_l1103_action_invoke(&mut instance);
|
||
|
c524_l1104_action_invoke(&mut instance);
|
||
|
c525_l1105_action_invoke(&mut instance);
|
||
|
c526_l1106_action_invoke(&mut instance);
|
||
|
c527_l1107_action_invoke(&mut instance);
|
||
|
c528_l1108_action_invoke(&mut instance);
|
||
|
c529_l1109_action_invoke(&mut instance);
|
||
|
c530_l1110_action_invoke(&mut instance);
|
||
|
c531_l1111_action_invoke(&mut instance);
|
||
|
c532_l1112_action_invoke(&mut instance);
|
||
|
c533_l1113_action_invoke(&mut instance);
|
||
|
c534_l1114_action_invoke(&mut instance);
|
||
|
c535_l1115_action_invoke(&mut instance);
|
||
|
c536_l1116_action_invoke(&mut instance);
|
||
|
c537_l1117_action_invoke(&mut instance);
|
||
|
c538_l1118_action_invoke(&mut instance);
|
||
|
c539_l1119_action_invoke(&mut instance);
|
||
|
c540_l1120_action_invoke(&mut instance);
|
||
|
c541_l1121_action_invoke(&mut instance);
|
||
|
c542_l1122_action_invoke(&mut instance);
|
||
|
c543_l1123_action_invoke(&mut instance);
|
||
|
c544_l1124_action_invoke(&mut instance);
|
||
|
c545_l1125_action_invoke(&mut instance);
|
||
|
c546_l1126_action_invoke(&mut instance);
|
||
|
c547_l1127_action_invoke(&mut instance);
|
||
|
c548_l1128_action_invoke(&mut instance);
|
||
|
c549_l1129_action_invoke(&mut instance);
|
||
|
c550_l1130_action_invoke(&mut instance);
|
||
|
}
|
||
|
fn create_module_48() -> Box<Instance> {
|
||
|
let module_str = "(module
|
||
|
(type (;0;) (func (result f32)))
|
||
|
(type (;1;) (func (result f64)))
|
||
|
(func (;0;) (type 0) (result f32)
|
||
|
f32.const 0x1.553f7cp+0 (;=1.333;)
|
||
|
f32.const 0x1.39999ap+0 (;=1.225;)
|
||
|
f32.add
|
||
|
f32.const 0x1.553f7cp+0 (;=1.333;)
|
||
|
f32.sub
|
||
|
f32.const 0x1.39999ap+0 (;=1.225;)
|
||
|
f32.sub)
|
||
|
(func (;1;) (type 1) (result f64)
|
||
|
f64.const 0x1.553f7ced91687p+0 (;=1.333;)
|
||
|
f64.const 0x1.399999999999ap+0 (;=1.225;)
|
||
|
f64.add
|
||
|
f64.const 0x1.553f7ced91687p+0 (;=1.333;)
|
||
|
f64.sub
|
||
|
f64.const 0x1.399999999999ap+0 (;=1.225;)
|
||
|
f64.sub)
|
||
|
(export \"f32.incorrect_correction\" (func 0))
|
||
|
(export \"f64.incorrect_correction\" (func 1)))
|
||
|
";
|
||
|
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_48(instance: &mut Instance) {
|
||
|
// TODO Review is explicit start needed? Start now called in runtime::Instance::new()
|
||
|
//instance.start();
|
||
|
}
|
||
|
|
||
|
// Line 1144
|
||
|
fn c552_l1144_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c552_l1144_action_invoke");
|
||
|
let result = instance.call("f32.incorrect_correction", &[]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((0.00000011920929f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1145
|
||
|
fn c553_l1145_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c553_l1145_action_invoke");
|
||
|
let result = instance.call("f64.incorrect_correction", &[]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((-0.0000000000000002220446049250313f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1150
|
||
|
|
||
|
#[test]
|
||
|
fn test_module_48() {
|
||
|
let mut instance = create_module_48();
|
||
|
// We group the calls together
|
||
|
start_module_48(&mut instance);
|
||
|
c552_l1144_action_invoke(&mut instance);
|
||
|
c553_l1145_action_invoke(&mut instance);
|
||
|
}
|
||
|
fn create_module_49() -> Box<Instance> {
|
||
|
let module_str = "(module
|
||
|
(type (;0;) (func (result f32)))
|
||
|
(func (;0;) (type 0) (result f32)
|
||
|
(local f32 f32 f32 f32 f32)
|
||
|
f32.const 0x1.388p+7 (;=156.25;)
|
||
|
set_local 0
|
||
|
f32.const 0x1.a0aaaap+7 (;=208.333;)
|
||
|
set_local 1
|
||
|
f32.const 0x1.c78e2ap+0 (;=1.77951;)
|
||
|
set_local 2
|
||
|
get_local 1
|
||
|
f32.neg
|
||
|
get_local 0
|
||
|
f32.mul
|
||
|
get_local 0
|
||
|
get_local 2
|
||
|
f32.mul
|
||
|
get_local 1
|
||
|
f32.sub
|
||
|
f32.div
|
||
|
set_local 3
|
||
|
get_local 1
|
||
|
f32.neg
|
||
|
get_local 0
|
||
|
f32.mul
|
||
|
get_local 0
|
||
|
get_local 2
|
||
|
f32.mul
|
||
|
get_local 1
|
||
|
f32.sub
|
||
|
f32.div
|
||
|
set_local 4
|
||
|
block ;; label = @1
|
||
|
get_local 3
|
||
|
get_local 4
|
||
|
f32.eq
|
||
|
br_if 0 (;@1;)
|
||
|
unreachable
|
||
|
end
|
||
|
get_local 4)
|
||
|
(export \"calculate\" (func 0)))
|
||
|
";
|
||
|
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_49(instance: &mut Instance) {
|
||
|
// TODO Review is explicit start needed? Start now called in runtime::Instance::new()
|
||
|
//instance.start();
|
||
|
}
|
||
|
|
||
|
// Line 1167
|
||
|
fn c555_l1167_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c555_l1167_action_invoke");
|
||
|
let result = instance.call("calculate", &[]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((-466.92685f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1169
|
||
|
|
||
|
#[test]
|
||
|
fn test_module_49() {
|
||
|
let mut instance = create_module_49();
|
||
|
// We group the calls together
|
||
|
start_module_49(&mut instance);
|
||
|
c555_l1167_action_invoke(&mut instance);
|
||
|
}
|
||
|
fn create_module_50() -> Box<Instance> {
|
||
|
let module_str = "(module
|
||
|
(type (;0;) (func (result f64)))
|
||
|
(func (;0;) (type 0) (result f64)
|
||
|
(local f64 f64 f64 f64 f64)
|
||
|
f64.const 0x1.388p+7 (;=156.25;)
|
||
|
set_local 0
|
||
|
f64.const 0x1.a0aaaaaab064bp+7 (;=208.333;)
|
||
|
set_local 1
|
||
|
f64.const 0x1.c78e2aae3d096p+0 (;=1.77951;)
|
||
|
set_local 2
|
||
|
get_local 1
|
||
|
f64.neg
|
||
|
get_local 0
|
||
|
f64.mul
|
||
|
get_local 0
|
||
|
get_local 2
|
||
|
f64.mul
|
||
|
get_local 1
|
||
|
f64.sub
|
||
|
f64.div
|
||
|
set_local 3
|
||
|
get_local 1
|
||
|
f64.neg
|
||
|
get_local 0
|
||
|
f64.mul
|
||
|
get_local 0
|
||
|
get_local 2
|
||
|
f64.mul
|
||
|
get_local 1
|
||
|
f64.sub
|
||
|
f64.div
|
||
|
set_local 4
|
||
|
block ;; label = @1
|
||
|
get_local 3
|
||
|
get_local 4
|
||
|
f64.eq
|
||
|
br_if 0 (;@1;)
|
||
|
unreachable
|
||
|
end
|
||
|
get_local 4)
|
||
|
(export \"calculate\" (func 0)))
|
||
|
";
|
||
|
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_50(instance: &mut Instance) {
|
||
|
// TODO Review is explicit start needed? Start now called in runtime::Instance::new()
|
||
|
//instance.start();
|
||
|
}
|
||
|
|
||
|
// Line 1186
|
||
|
fn c557_l1186_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c557_l1186_action_invoke");
|
||
|
let result = instance.call("calculate", &[]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((-466.926956301738f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1191
|
||
|
|
||
|
#[test]
|
||
|
fn test_module_50() {
|
||
|
let mut instance = create_module_50();
|
||
|
// We group the calls together
|
||
|
start_module_50(&mut instance);
|
||
|
c557_l1186_action_invoke(&mut instance);
|
||
|
}
|
||
|
fn create_module_51() -> Box<Instance> {
|
||
|
let module_str = "(module
|
||
|
(type (;0;) (func (param f32) (result f32)))
|
||
|
(func (;0;) (type 0) (param f32) (result f32)
|
||
|
f32.const 0x0p+0 (;=0;)
|
||
|
f32.const -0x0p+0 (;=-0;)
|
||
|
get_local 0
|
||
|
f32.sub
|
||
|
f32.sub)
|
||
|
(export \"llvm_pr26746\" (func 0)))
|
||
|
";
|
||
|
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_51(instance: &mut Instance) {
|
||
|
// TODO Review is explicit start needed? Start now called in runtime::Instance::new()
|
||
|
//instance.start();
|
||
|
}
|
||
|
|
||
|
// Line 1197
|
||
|
fn c559_l1197_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c559_l1197_action_invoke");
|
||
|
let result = instance.call("llvm_pr26746", &[Value::F32((-0.0f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((0.0f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1202
|
||
|
|
||
|
#[test]
|
||
|
fn test_module_51() {
|
||
|
let mut instance = create_module_51();
|
||
|
// We group the calls together
|
||
|
start_module_51(&mut instance);
|
||
|
c559_l1197_action_invoke(&mut instance);
|
||
|
}
|
||
|
fn create_module_52() -> Box<Instance> {
|
||
|
let module_str = "(module
|
||
|
(type (;0;) (func (param i32) (result f32)))
|
||
|
(func (;0;) (type 0) (param i32) (result f32)
|
||
|
get_local 0
|
||
|
i32.const 268435455
|
||
|
i32.and
|
||
|
f32.convert_s/i32
|
||
|
f32.const -0x1p+23 (;=-8.38861e+06;)
|
||
|
f32.add)
|
||
|
(export \"llvm_pr27153\" (func 0)))
|
||
|
";
|
||
|
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_52(instance: &mut Instance) {
|
||
|
// TODO Review is explicit start needed? Start now called in runtime::Instance::new()
|
||
|
//instance.start();
|
||
|
}
|
||
|
|
||
|
// Line 1208
|
||
|
fn c561_l1208_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c561_l1208_action_invoke");
|
||
|
let result = instance.call("llvm_pr27153", &[Value::I32(33554434 as i32)]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((25165824.0f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1213
|
||
|
|
||
|
#[test]
|
||
|
fn test_module_52() {
|
||
|
let mut instance = create_module_52();
|
||
|
// We group the calls together
|
||
|
start_module_52(&mut instance);
|
||
|
c561_l1208_action_invoke(&mut instance);
|
||
|
}
|
||
|
fn create_module_53() -> Box<Instance> {
|
||
|
let module_str = "(module
|
||
|
(type (;0;) (func (param i32 i32) (result f32)))
|
||
|
(func (;0;) (type 0) (param i32 i32) (result f32)
|
||
|
get_local 0
|
||
|
i32.const -25034805
|
||
|
i32.or
|
||
|
f32.convert_s/i32
|
||
|
get_local 1
|
||
|
i32.const 14942208
|
||
|
i32.and
|
||
|
f32.convert_s/i32
|
||
|
f32.add)
|
||
|
(export \"llvm_pr27036\" (func 0)))
|
||
|
";
|
||
|
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_53(instance: &mut Instance) {
|
||
|
// TODO Review is explicit start needed? Start now called in runtime::Instance::new()
|
||
|
//instance.start();
|
||
|
}
|
||
|
|
||
|
// Line 1220
|
||
|
fn c563_l1220_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c563_l1220_action_invoke");
|
||
|
let result = instance.call("llvm_pr27036", &[Value::I32(-25034805 as i32), Value::I32(14942208 as i32)]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((-10092596.0f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1230
|
||
|
|
||
|
#[test]
|
||
|
fn test_module_53() {
|
||
|
let mut instance = create_module_53();
|
||
|
// We group the calls together
|
||
|
start_module_53(&mut instance);
|
||
|
c563_l1220_action_invoke(&mut instance);
|
||
|
}
|
||
|
fn create_module_54() -> Box<Instance> {
|
||
|
let module_str = "(module
|
||
|
(type (;0;) (func (param f64 f64 f64 f64) (result f64)))
|
||
|
(type (;1;) (func (param f64 f64 f64) (result f64)))
|
||
|
(type (;2;) (func (param f32 f32 f32) (result f32)))
|
||
|
(func (;0;) (type 0) (param f64 f64 f64 f64) (result f64)
|
||
|
get_local 0
|
||
|
get_local 1
|
||
|
f64.mul
|
||
|
get_local 2
|
||
|
get_local 3
|
||
|
f64.mul
|
||
|
f64.div)
|
||
|
(func (;1;) (type 1) (param f64 f64 f64) (result f64)
|
||
|
get_local 0
|
||
|
get_local 1
|
||
|
f64.mul
|
||
|
get_local 2
|
||
|
f64.sub)
|
||
|
(func (;2;) (type 2) (param f32 f32 f32) (result f32)
|
||
|
get_local 0
|
||
|
get_local 1
|
||
|
f32.mul
|
||
|
get_local 2
|
||
|
f32.mul)
|
||
|
(export \"thepast0\" (func 0))
|
||
|
(export \"thepast1\" (func 1))
|
||
|
(export \"thepast2\" (func 2)))
|
||
|
";
|
||
|
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_54(instance: &mut Instance) {
|
||
|
// TODO Review is explicit start needed? Start now called in runtime::Instance::new()
|
||
|
//instance.start();
|
||
|
}
|
||
|
|
||
|
// Line 1244
|
||
|
fn c565_l1244_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c565_l1244_action_invoke");
|
||
|
let result = instance.call("thepast0", &[Value::F64((0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004450147717014403f64).to_bits()), Value::F64((0.9999999999999999f64).to_bits()), Value::F64((2.0f64).to_bits()), Value::F64((0.5f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000044501477170144023f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1245
|
||
|
fn c566_l1245_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c566_l1245_action_invoke");
|
||
|
let result = instance.call("thepast1", &[Value::F64((0.00000000000000005551115123125783f64).to_bits()), Value::F64((0.9999999999999999f64).to_bits()), Value::F64((0.00000000000000005551115123125783f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((-0.000000000000000000000000000000006162975822039155f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1246
|
||
|
fn c567_l1246_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c567_l1246_action_invoke");
|
||
|
let result = instance.call("thepast2", &[Value::F32((0.000000000000000000000000000000000000023509887f32).to_bits()), Value::F32((0.5f32).to_bits()), Value::F32((1.0f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((0.000000000000000000000000000000000000011754944f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1251
|
||
|
|
||
|
#[test]
|
||
|
fn test_module_54() {
|
||
|
let mut instance = create_module_54();
|
||
|
// We group the calls together
|
||
|
start_module_54(&mut instance);
|
||
|
c565_l1244_action_invoke(&mut instance);
|
||
|
c566_l1245_action_invoke(&mut instance);
|
||
|
c567_l1246_action_invoke(&mut instance);
|
||
|
}
|
||
|
fn create_module_55() -> Box<Instance> {
|
||
|
let module_str = "(module
|
||
|
(type (;0;) (func (param f32) (result f32)))
|
||
|
(func (;0;) (type 0) (param f32) (result f32)
|
||
|
f32.const 0x1p+0 (;=1;)
|
||
|
get_local 0
|
||
|
f32.div)
|
||
|
(export \"inverse\" (func 0)))
|
||
|
";
|
||
|
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_55(instance: &mut Instance) {
|
||
|
// TODO Review is explicit start needed? Start now called in runtime::Instance::new()
|
||
|
//instance.start();
|
||
|
}
|
||
|
|
||
|
// Line 1257
|
||
|
fn c569_l1257_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c569_l1257_action_invoke");
|
||
|
let result = instance.call("inverse", &[Value::F32((96.0f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((0.010416667f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1262
|
||
|
|
||
|
#[test]
|
||
|
fn test_module_55() {
|
||
|
let mut instance = create_module_55();
|
||
|
// We group the calls together
|
||
|
start_module_55(&mut instance);
|
||
|
c569_l1257_action_invoke(&mut instance);
|
||
|
}
|
||
|
fn create_module_56() -> Box<Instance> {
|
||
|
let module_str = "(module
|
||
|
(type (;0;) (func (param f32) (result f32)))
|
||
|
(type (;1;) (func (param f64) (result f64)))
|
||
|
(func (;0;) (type 0) (param f32) (result f32)
|
||
|
get_local 0
|
||
|
f32.sqrt
|
||
|
f32.const 0x1p+1 (;=2;)
|
||
|
f32.sub)
|
||
|
(func (;1;) (type 1) (param f64) (result f64)
|
||
|
get_local 0
|
||
|
f64.sqrt
|
||
|
f64.const 0x1p+1 (;=2;)
|
||
|
f64.sub)
|
||
|
(export \"f32_sqrt_minus_2\" (func 0))
|
||
|
(export \"f64_sqrt_minus_2\" (func 1)))
|
||
|
";
|
||
|
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_56(instance: &mut Instance) {
|
||
|
// TODO Review is explicit start needed? Start now called in runtime::Instance::new()
|
||
|
//instance.start();
|
||
|
}
|
||
|
|
||
|
// Line 1272
|
||
|
fn c571_l1272_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c571_l1272_action_invoke");
|
||
|
let result = instance.call("f32_sqrt_minus_2", &[Value::F32((4.0f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((0.0f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1273
|
||
|
fn c572_l1273_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c572_l1273_action_invoke");
|
||
|
let result = instance.call("f64_sqrt_minus_2", &[Value::F64((4.0f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((0.0f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1277
|
||
|
|
||
|
#[test]
|
||
|
fn test_module_56() {
|
||
|
let mut instance = create_module_56();
|
||
|
// We group the calls together
|
||
|
start_module_56(&mut instance);
|
||
|
c571_l1272_action_invoke(&mut instance);
|
||
|
c572_l1273_action_invoke(&mut instance);
|
||
|
}
|
||
|
fn create_module_57() -> Box<Instance> {
|
||
|
let module_str = "(module
|
||
|
(type (;0;) (func (param f32) (result f32)))
|
||
|
(type (;1;) (func (param f64) (result f64)))
|
||
|
(func (;0;) (type 0) (param f32) (result f32)
|
||
|
f32.const 0x1p+0 (;=1;)
|
||
|
f32.const 0x1p+0 (;=1;)
|
||
|
get_local 0
|
||
|
f32.div
|
||
|
f32.div)
|
||
|
(func (;1;) (type 1) (param f64) (result f64)
|
||
|
f64.const 0x1p+0 (;=1;)
|
||
|
f64.const 0x1p+0 (;=1;)
|
||
|
get_local 0
|
||
|
f64.div
|
||
|
f64.div)
|
||
|
(export \"f32.no_fold_recip_recip\" (func 0))
|
||
|
(export \"f64.no_fold_recip_recip\" (func 1)))
|
||
|
";
|
||
|
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_57(instance: &mut Instance) {
|
||
|
// TODO Review is explicit start needed? Start now called in runtime::Instance::new()
|
||
|
//instance.start();
|
||
|
}
|
||
|
|
||
|
// Line 1285
|
||
|
fn c574_l1285_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c574_l1285_action_invoke");
|
||
|
let result = instance.call("f32.no_fold_recip_recip", &[Value::F32((-70435790000000000000.0f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((-70435784000000000000.0f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1286
|
||
|
fn c575_l1286_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c575_l1286_action_invoke");
|
||
|
let result = instance.call("f32.no_fold_recip_recip", &[Value::F32((0.000000000000000000000012466101f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((0.0000000000000000000000124661f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1287
|
||
|
fn c576_l1287_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c576_l1287_action_invoke");
|
||
|
let result = instance.call("f32.no_fold_recip_recip", &[Value::F32((0.000000000000000000097184545f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((0.00000000000000000009718455f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1288
|
||
|
fn c577_l1288_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c577_l1288_action_invoke");
|
||
|
let result = instance.call("f32.no_fold_recip_recip", &[Value::F32((-30.400759f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((-30.40076f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1289
|
||
|
fn c578_l1289_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c578_l1289_action_invoke");
|
||
|
let result = instance.call("f32.no_fold_recip_recip", &[Value::F32((2331659200000000000000.0f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((2331659000000000000000.0f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1291
|
||
|
fn c579_l1291_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c579_l1291_action_invoke");
|
||
|
let result = instance.call("f32.no_fold_recip_recip", &[Value::F32((-0.0f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((-0.0f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1292
|
||
|
fn c580_l1292_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c580_l1292_action_invoke");
|
||
|
let result = instance.call("f32.no_fold_recip_recip", &[Value::F32((0.0f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((0.0f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1293
|
||
|
fn c581_l1293_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c581_l1293_action_invoke");
|
||
|
let result = instance.call("f32.no_fold_recip_recip", &[Value::F32(f32::NEG_INFINITY.to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32(f32::NEG_INFINITY.to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1294
|
||
|
fn c582_l1294_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c582_l1294_action_invoke");
|
||
|
let result = instance.call("f32.no_fold_recip_recip", &[Value::F32(f32::INFINITY.to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32(f32::INFINITY.to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1296
|
||
|
fn c583_l1296_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c583_l1296_action_invoke");
|
||
|
let result = instance.call("f64.no_fold_recip_recip", &[Value::F64((-657971534362886860000000000000000000000000000.0f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((-657971534362886900000000000000000000000000000.0f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1297
|
||
|
fn c584_l1297_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c584_l1297_action_invoke");
|
||
|
let result = instance.call("f64.no_fold_recip_recip", &[Value::F64((-144246931868576430000.0f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((-144246931868576420000.0f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1298
|
||
|
fn c585_l1298_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c585_l1298_action_invoke");
|
||
|
let result = instance.call("f64.no_fold_recip_recip", &[Value::F64((184994689206231350000000000000000000000000000000000.0f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((184994689206231330000000000000000000000000000000000.0f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1299
|
||
|
fn c586_l1299_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c586_l1299_action_invoke");
|
||
|
let result = instance.call("f64.no_fold_recip_recip", &[Value::F64((0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000005779584288006583f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000005779584288006582f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1300
|
||
|
fn c587_l1300_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c587_l1300_action_invoke");
|
||
|
let result = instance.call("f64.no_fold_recip_recip", &[Value::F64((51501178696141640000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.0f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((51501178696141634000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.0f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1302
|
||
|
fn c588_l1302_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c588_l1302_action_invoke");
|
||
|
let result = instance.call("f64.no_fold_recip_recip", &[Value::F64((-0.0f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((-0.0f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1303
|
||
|
fn c589_l1303_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c589_l1303_action_invoke");
|
||
|
let result = instance.call("f64.no_fold_recip_recip", &[Value::F64((0.0f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((0.0f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1304
|
||
|
fn c590_l1304_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c590_l1304_action_invoke");
|
||
|
let result = instance.call("f64.no_fold_recip_recip", &[Value::F64(f64::NEG_INFINITY.to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64(f64::NEG_INFINITY.to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1305
|
||
|
fn c591_l1305_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c591_l1305_action_invoke");
|
||
|
let result = instance.call("f64.no_fold_recip_recip", &[Value::F64(f64::INFINITY.to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64(f64::INFINITY.to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1309
|
||
|
|
||
|
#[test]
|
||
|
fn test_module_57() {
|
||
|
let mut instance = create_module_57();
|
||
|
// We group the calls together
|
||
|
start_module_57(&mut instance);
|
||
|
c574_l1285_action_invoke(&mut instance);
|
||
|
c575_l1286_action_invoke(&mut instance);
|
||
|
c576_l1287_action_invoke(&mut instance);
|
||
|
c577_l1288_action_invoke(&mut instance);
|
||
|
c578_l1289_action_invoke(&mut instance);
|
||
|
c579_l1291_action_invoke(&mut instance);
|
||
|
c580_l1292_action_invoke(&mut instance);
|
||
|
c581_l1293_action_invoke(&mut instance);
|
||
|
c582_l1294_action_invoke(&mut instance);
|
||
|
c583_l1296_action_invoke(&mut instance);
|
||
|
c584_l1297_action_invoke(&mut instance);
|
||
|
c585_l1298_action_invoke(&mut instance);
|
||
|
c586_l1299_action_invoke(&mut instance);
|
||
|
c587_l1300_action_invoke(&mut instance);
|
||
|
c588_l1302_action_invoke(&mut instance);
|
||
|
c589_l1303_action_invoke(&mut instance);
|
||
|
c590_l1304_action_invoke(&mut instance);
|
||
|
c591_l1305_action_invoke(&mut instance);
|
||
|
}
|
||
|
fn create_module_58() -> Box<Instance> {
|
||
|
let module_str = "(module
|
||
|
(type (;0;) (func (param f32 f32) (result f32)))
|
||
|
(type (;1;) (func (param f64 f64) (result f64)))
|
||
|
(func (;0;) (type 0) (param f32 f32) (result f32)
|
||
|
get_local 0
|
||
|
get_local 1
|
||
|
f32.add
|
||
|
get_local 0
|
||
|
get_local 1
|
||
|
f32.sub
|
||
|
f32.mul)
|
||
|
(func (;1;) (type 1) (param f64 f64) (result f64)
|
||
|
get_local 0
|
||
|
get_local 1
|
||
|
f64.add
|
||
|
get_local 0
|
||
|
get_local 1
|
||
|
f64.sub
|
||
|
f64.mul)
|
||
|
(export \"f32.no_algebraic_factoring\" (func 0))
|
||
|
(export \"f64.no_algebraic_factoring\" (func 1)))
|
||
|
";
|
||
|
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_58(instance: &mut Instance) {
|
||
|
// TODO Review is explicit start needed? Start now called in runtime::Instance::new()
|
||
|
//instance.start();
|
||
|
}
|
||
|
|
||
|
// Line 1319
|
||
|
fn c593_l1319_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c593_l1319_action_invoke");
|
||
|
let result = instance.call("f32.no_algebraic_factoring", &[Value::F32((-0.000000000000000053711865f32).to_bits()), Value::F32((0.00000000000000009744328f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((-0.000000000000000000000000000000006610229f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1320
|
||
|
fn c594_l1320_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c594_l1320_action_invoke");
|
||
|
let result = instance.call("f32.no_algebraic_factoring", &[Value::F32((-19756732.0f32).to_bits()), Value::F32((32770204.0f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((-683557800000000.0f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1321
|
||
|
fn c595_l1321_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c595_l1321_action_invoke");
|
||
|
let result = instance.call("f32.no_algebraic_factoring", &[Value::F32((52314150000000.0f32).to_bits()), Value::F32((-145309980000000.0f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((-18378221000000000000000000000.0f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1322
|
||
|
fn c596_l1322_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c596_l1322_action_invoke");
|
||
|
let result = instance.call("f32.no_algebraic_factoring", &[Value::F32((195260.38f32).to_bits()), Value::F32((-227.75723f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((38126563000.0f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1323
|
||
|
fn c597_l1323_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c597_l1323_action_invoke");
|
||
|
let result = instance.call("f32.no_algebraic_factoring", &[Value::F32((-237.48706f32).to_bits()), Value::F32((-972341.5f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((-945447960000.0f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1325
|
||
|
fn c598_l1325_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c598_l1325_action_invoke");
|
||
|
let result = instance.call("f64.no_algebraic_factoring", &[Value::F64((0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000009639720335949767f64).to_bits()), Value::F64((0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008019175443606207f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((-0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006430717386609473f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1326
|
||
|
fn c599_l1326_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c599_l1326_action_invoke");
|
||
|
let result = instance.call("f64.no_algebraic_factoring", &[Value::F64((0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000005166066590392027f64).to_bits()), Value::F64((0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001494333315888213f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000026688244016362468f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1327
|
||
|
fn c600_l1327_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c600_l1327_action_invoke");
|
||
|
let result = instance.call("f64.no_algebraic_factoring", &[Value::F64((-0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002866135870517635f64).to_bits()), Value::F64((-0.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000012114355254268516f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((-0.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000014675678175314036f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1328
|
||
|
fn c601_l1328_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c601_l1328_action_invoke");
|
||
|
let result = instance.call("f64.no_algebraic_factoring", &[Value::F64((-1292099281007814900000000000000000000000000000000000000.0f64).to_bits()), Value::F64((662717187728034000000000000000000000000000000000000000000.0f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((-439192401389602300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.0f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1329
|
||
|
fn c602_l1329_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c602_l1329_action_invoke");
|
||
|
let result = instance.call("f64.no_algebraic_factoring", &[Value::F64((26242795689010570000000000000000000.0f64).to_bits()), Value::F64((-1625023398605080200000000000.0f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((688684325575149100000000000000000000000000000000000000000000000000000.0f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1333
|
||
|
|
||
|
#[test]
|
||
|
fn test_module_58() {
|
||
|
let mut instance = create_module_58();
|
||
|
// We group the calls together
|
||
|
start_module_58(&mut instance);
|
||
|
c593_l1319_action_invoke(&mut instance);
|
||
|
c594_l1320_action_invoke(&mut instance);
|
||
|
c595_l1321_action_invoke(&mut instance);
|
||
|
c596_l1322_action_invoke(&mut instance);
|
||
|
c597_l1323_action_invoke(&mut instance);
|
||
|
c598_l1325_action_invoke(&mut instance);
|
||
|
c599_l1326_action_invoke(&mut instance);
|
||
|
c600_l1327_action_invoke(&mut instance);
|
||
|
c601_l1328_action_invoke(&mut instance);
|
||
|
c602_l1329_action_invoke(&mut instance);
|
||
|
}
|
||
|
fn create_module_59() -> Box<Instance> {
|
||
|
let module_str = "(module
|
||
|
(type (;0;) (func (param f32 f32) (result f32)))
|
||
|
(type (;1;) (func (param f64 f64) (result f64)))
|
||
|
(func (;0;) (type 0) (param f32 f32) (result f32)
|
||
|
get_local 0
|
||
|
get_local 0
|
||
|
f32.mul
|
||
|
get_local 1
|
||
|
get_local 1
|
||
|
f32.mul
|
||
|
f32.sub)
|
||
|
(func (;1;) (type 1) (param f64 f64) (result f64)
|
||
|
get_local 0
|
||
|
get_local 0
|
||
|
f64.mul
|
||
|
get_local 1
|
||
|
get_local 1
|
||
|
f64.mul
|
||
|
f64.sub)
|
||
|
(export \"f32.no_algebraic_factoring\" (func 0))
|
||
|
(export \"f64.no_algebraic_factoring\" (func 1)))
|
||
|
";
|
||
|
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_59(instance: &mut Instance) {
|
||
|
// TODO Review is explicit start needed? Start now called in runtime::Instance::new()
|
||
|
//instance.start();
|
||
|
}
|
||
|
|
||
|
// Line 1343
|
||
|
fn c604_l1343_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c604_l1343_action_invoke");
|
||
|
let result = instance.call("f32.no_algebraic_factoring", &[Value::F32((0.000000000000022102996f32).to_bits()), Value::F32((0.0000000000031465275f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((-0.0000000000000000000000099001476f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1344
|
||
|
fn c605_l1344_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c605_l1344_action_invoke");
|
||
|
let result = instance.call("f32.no_algebraic_factoring", &[Value::F32((-3289460800000.0f32).to_bits()), Value::F32((-15941539000.0f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((10820299000000000000000000.0f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1345
|
||
|
fn c606_l1345_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c606_l1345_action_invoke");
|
||
|
let result = instance.call("f32.no_algebraic_factoring", &[Value::F32((0.00036497542f32).to_bits()), Value::F32((-0.00016153714f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((0.000000107112804f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1346
|
||
|
fn c607_l1346_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c607_l1346_action_invoke");
|
||
|
let result = instance.call("f32.no_algebraic_factoring", &[Value::F32((0.000000000000065383266f32).to_bits()), Value::F32((-0.000000000000027412773f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((0.000000000000000000000000003523511f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1347
|
||
|
fn c608_l1347_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c608_l1347_action_invoke");
|
||
|
let result = instance.call("f32.no_algebraic_factoring", &[Value::F32((3609682000000000.0f32).to_bits()), Value::F32((-5260104400000000.0f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((-14638896000000000000000000000000.0f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1349
|
||
|
fn c609_l1349_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c609_l1349_action_invoke");
|
||
|
let result = instance.call("f64.no_algebraic_factoring", &[Value::F64((213640454349895100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.0f64).to_bits()), Value::F64((-292858755839442800000000000000000000000000000000000000000000000000000000000000000000000000000000000000.0f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((45642243734743850000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.0f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1350
|
||
|
fn c610_l1350_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c610_l1350_action_invoke");
|
||
|
let result = instance.call("f64.no_algebraic_factoring", &[Value::F64((-1229017115924435800000000000000000000000000000000000000000000000000000000000000000000000000000.0f64).to_bits()), Value::F64((-8222158919016600000000000000000000000000000000000000000000000000000000000000000000000000000000000000.0f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((-67603897289562710000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.0f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1351
|
||
|
fn c611_l1351_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c611_l1351_action_invoke");
|
||
|
let result = instance.call("f64.no_algebraic_factoring", &[Value::F64((5477733829752.252f64).to_bits()), Value::F64((-970738900948.5906f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((29063233895797397000000000.0f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1352
|
||
|
fn c612_l1352_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c612_l1352_action_invoke");
|
||
|
let result = instance.call("f64.no_algebraic_factoring", &[Value::F64((-10689141744923551000000000000000000000000000000000000000.0f64).to_bits()), Value::F64((-173378393593738040000000000000000000000000000000000.0f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((114257751213007240000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.0f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1353
|
||
|
fn c613_l1353_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c613_l1353_action_invoke");
|
||
|
let result = instance.call("f64.no_algebraic_factoring", &[Value::F64((-0.000000000000000000000000000000000000000000000000000000000000000000000010295699877022106f64).to_bits()), Value::F64((-0.000000000000000000000000000000000000000000000000000000000000000000000008952274637805908f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000025858214767010105f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1358
|
||
|
|
||
|
#[test]
|
||
|
fn test_module_59() {
|
||
|
let mut instance = create_module_59();
|
||
|
// We group the calls together
|
||
|
start_module_59(&mut instance);
|
||
|
c604_l1343_action_invoke(&mut instance);
|
||
|
c605_l1344_action_invoke(&mut instance);
|
||
|
c606_l1345_action_invoke(&mut instance);
|
||
|
c607_l1346_action_invoke(&mut instance);
|
||
|
c608_l1347_action_invoke(&mut instance);
|
||
|
c609_l1349_action_invoke(&mut instance);
|
||
|
c610_l1350_action_invoke(&mut instance);
|
||
|
c611_l1351_action_invoke(&mut instance);
|
||
|
c612_l1352_action_invoke(&mut instance);
|
||
|
c613_l1353_action_invoke(&mut instance);
|
||
|
}
|
||
|
fn create_module_60() -> Box<Instance> {
|
||
|
let module_str = "(module
|
||
|
(type (;0;) (func (param i32 i32 i32)))
|
||
|
(type (;1;) (func (param i32) (result f32)))
|
||
|
(func (;0;) (type 0) (param i32 i32 i32)
|
||
|
(local f32 f32 f32 f32 f32 f32 f32 f32)
|
||
|
get_local 0
|
||
|
f32.load
|
||
|
set_local 3
|
||
|
get_local 0
|
||
|
f32.load offset=4
|
||
|
set_local 4
|
||
|
get_local 0
|
||
|
f32.load offset=8
|
||
|
set_local 5
|
||
|
get_local 0
|
||
|
f32.load offset=12
|
||
|
set_local 6
|
||
|
get_local 1
|
||
|
f32.load
|
||
|
set_local 7
|
||
|
get_local 1
|
||
|
f32.load offset=4
|
||
|
set_local 8
|
||
|
get_local 1
|
||
|
f32.load offset=8
|
||
|
set_local 9
|
||
|
get_local 1
|
||
|
f32.load offset=12
|
||
|
set_local 10
|
||
|
get_local 2
|
||
|
get_local 3
|
||
|
get_local 7
|
||
|
f32.add
|
||
|
f32.store
|
||
|
get_local 2
|
||
|
get_local 4
|
||
|
get_local 8
|
||
|
f32.add
|
||
|
f32.store offset=4
|
||
|
get_local 2
|
||
|
get_local 5
|
||
|
get_local 9
|
||
|
f32.add
|
||
|
f32.store offset=8
|
||
|
get_local 2
|
||
|
get_local 6
|
||
|
get_local 10
|
||
|
f32.add
|
||
|
f32.store offset=12)
|
||
|
(func (;1;) (type 1) (param i32) (result f32)
|
||
|
get_local 0
|
||
|
f32.load)
|
||
|
(memory (;0;) 1 1)
|
||
|
(export \"f32.simple_x4_sum\" (func 0))
|
||
|
(export \"f32.load\" (func 1))
|
||
|
(data (;0;) (i32.const 0) \"\\01\\00\\00\\00\\01\\00\\00\\80\\01\\00\\00\\00\\01\\00\\00\\80\\01\\00\\00\\00\\01\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\"))
|
||
|
";
|
||
|
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_60(instance: &mut Instance) {
|
||
|
// TODO Review is explicit start needed? Start now called in runtime::Instance::new()
|
||
|
//instance.start();
|
||
|
}
|
||
|
|
||
|
// Line 1391
|
||
|
fn c615_l1391_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c615_l1391_action_invoke");
|
||
|
let result = instance.call("f32.simple_x4_sum", &[Value::I32(0 as i32), Value::I32(16 as i32), Value::I32(32 as i32)]);
|
||
|
assert_eq!(result, Ok(None));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1392
|
||
|
fn c616_l1392_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c616_l1392_action_invoke");
|
||
|
let result = instance.call("f32.load", &[Value::I32(32 as i32)]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((0.000000000000000000000000000000000000000000003f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1393
|
||
|
fn c617_l1393_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c617_l1393_action_invoke");
|
||
|
let result = instance.call("f32.load", &[Value::I32(36 as i32)]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((0.0f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1394
|
||
|
fn c618_l1394_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c618_l1394_action_invoke");
|
||
|
let result = instance.call("f32.load", &[Value::I32(40 as i32)]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((0.000000000000000000000000000000000000000000001f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1395
|
||
|
fn c619_l1395_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c619_l1395_action_invoke");
|
||
|
let result = instance.call("f32.load", &[Value::I32(44 as i32)]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((-0.000000000000000000000000000000000000000000001f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1397
|
||
|
|
||
|
#[test]
|
||
|
fn test_module_60() {
|
||
|
let mut instance = create_module_60();
|
||
|
// We group the calls together
|
||
|
start_module_60(&mut instance);
|
||
|
c615_l1391_action_invoke(&mut instance);
|
||
|
c616_l1392_action_invoke(&mut instance);
|
||
|
c617_l1393_action_invoke(&mut instance);
|
||
|
c618_l1394_action_invoke(&mut instance);
|
||
|
c619_l1395_action_invoke(&mut instance);
|
||
|
}
|
||
|
fn create_module_61() -> Box<Instance> {
|
||
|
let module_str = "(module
|
||
|
(type (;0;) (func (param i32 i32 i32)))
|
||
|
(type (;1;) (func (param i32) (result f64)))
|
||
|
(func (;0;) (type 0) (param i32 i32 i32)
|
||
|
(local f64 f64 f64 f64 f64 f64 f64 f64)
|
||
|
get_local 0
|
||
|
f64.load
|
||
|
set_local 3
|
||
|
get_local 0
|
||
|
f64.load offset=8
|
||
|
set_local 4
|
||
|
get_local 0
|
||
|
f64.load offset=16
|
||
|
set_local 5
|
||
|
get_local 0
|
||
|
f64.load offset=24
|
||
|
set_local 6
|
||
|
get_local 1
|
||
|
f64.load
|
||
|
set_local 7
|
||
|
get_local 1
|
||
|
f64.load offset=8
|
||
|
set_local 8
|
||
|
get_local 1
|
||
|
f64.load offset=16
|
||
|
set_local 9
|
||
|
get_local 1
|
||
|
f64.load offset=24
|
||
|
set_local 10
|
||
|
get_local 2
|
||
|
get_local 3
|
||
|
get_local 7
|
||
|
f64.add
|
||
|
f64.store
|
||
|
get_local 2
|
||
|
get_local 4
|
||
|
get_local 8
|
||
|
f64.add
|
||
|
f64.store offset=8
|
||
|
get_local 2
|
||
|
get_local 5
|
||
|
get_local 9
|
||
|
f64.add
|
||
|
f64.store offset=16
|
||
|
get_local 2
|
||
|
get_local 6
|
||
|
get_local 10
|
||
|
f64.add
|
||
|
f64.store offset=24)
|
||
|
(func (;1;) (type 1) (param i32) (result f64)
|
||
|
get_local 0
|
||
|
f64.load)
|
||
|
(memory (;0;) 1 1)
|
||
|
(export \"f64.simple_x4_sum\" (func 0))
|
||
|
(export \"f64.load\" (func 1))
|
||
|
(data (;0;) (i32.const 0) \"\\01\\00\\00\\00\\00\\00\\00\\00\\01\\00\\00\\00\\00\\00\\00\\80\\01\\00\\00\\00\\00\\00\\00\\00\\01\\00\\00\\00\\00\\00\\00\\80\\01\\00\\00\\00\\00\\00\\00\\00\\01\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\"))
|
||
|
";
|
||
|
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_61(instance: &mut Instance) {
|
||
|
// TODO Review is explicit start needed? Start now called in runtime::Instance::new()
|
||
|
//instance.start();
|
||
|
}
|
||
|
|
||
|
// Line 1430
|
||
|
fn c621_l1430_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c621_l1430_action_invoke");
|
||
|
let result = instance.call("f64.simple_x4_sum", &[Value::I32(0 as i32), Value::I32(32 as i32), Value::I32(64 as i32)]);
|
||
|
assert_eq!(result, Ok(None));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1431
|
||
|
fn c622_l1431_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c622_l1431_action_invoke");
|
||
|
let result = instance.call("f64.load", &[Value::I32(64 as i32)]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1432
|
||
|
fn c623_l1432_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c623_l1432_action_invoke");
|
||
|
let result = instance.call("f64.load", &[Value::I32(72 as i32)]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((0.0f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1433
|
||
|
fn c624_l1433_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c624_l1433_action_invoke");
|
||
|
let result = instance.call("f64.load", &[Value::I32(80 as i32)]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000005f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1434
|
||
|
fn c625_l1434_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c625_l1434_action_invoke");
|
||
|
let result = instance.call("f64.load", &[Value::I32(88 as i32)]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((-0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000005f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1439
|
||
|
|
||
|
#[test]
|
||
|
fn test_module_61() {
|
||
|
let mut instance = create_module_61();
|
||
|
// We group the calls together
|
||
|
start_module_61(&mut instance);
|
||
|
c621_l1430_action_invoke(&mut instance);
|
||
|
c622_l1431_action_invoke(&mut instance);
|
||
|
c623_l1432_action_invoke(&mut instance);
|
||
|
c624_l1433_action_invoke(&mut instance);
|
||
|
c625_l1434_action_invoke(&mut instance);
|
||
|
}
|
||
|
fn create_module_62() -> Box<Instance> {
|
||
|
let module_str = "(module
|
||
|
(type (;0;) (func (param i32 i32) (result f32)))
|
||
|
(func (;0;) (type 0) (param i32 i32) (result f32)
|
||
|
(local f32 f32 f32)
|
||
|
block ;; label = @1
|
||
|
loop ;; label = @2
|
||
|
get_local 3
|
||
|
get_local 0
|
||
|
f32.load
|
||
|
get_local 4
|
||
|
f32.sub
|
||
|
tee_local 4
|
||
|
f32.add
|
||
|
tee_local 2
|
||
|
get_local 3
|
||
|
f32.sub
|
||
|
get_local 4
|
||
|
f32.sub
|
||
|
set_local 4
|
||
|
get_local 0
|
||
|
i32.const 4
|
||
|
i32.add
|
||
|
set_local 0
|
||
|
get_local 2
|
||
|
set_local 3
|
||
|
get_local 1
|
||
|
i32.const -1
|
||
|
i32.add
|
||
|
tee_local 1
|
||
|
br_if 0 (;@2;)
|
||
|
end
|
||
|
end
|
||
|
get_local 2)
|
||
|
(func (;1;) (type 0) (param i32 i32) (result f32)
|
||
|
(local f32)
|
||
|
block ;; label = @1
|
||
|
loop ;; label = @2
|
||
|
get_local 2
|
||
|
get_local 0
|
||
|
f32.load
|
||
|
f32.add
|
||
|
set_local 2
|
||
|
get_local 0
|
||
|
i32.const 4
|
||
|
i32.add
|
||
|
set_local 0
|
||
|
get_local 1
|
||
|
i32.const -1
|
||
|
i32.add
|
||
|
set_local 1
|
||
|
get_local 1
|
||
|
br_if 0 (;@2;)
|
||
|
end
|
||
|
end
|
||
|
get_local 2)
|
||
|
(memory (;0;) 1 1)
|
||
|
(export \"f32.kahan_sum\" (func 0))
|
||
|
(export \"f32.plain_sum\" (func 1))
|
||
|
(data (;0;) (i32.const 0) \"\\c4\\c5W$\\a5\\84\\c8\\0bm\\b8K.\\f2v\\17\\1c\\caJV\\1e\\1bnq\\22]\\17\\1en\\bf\\cd\\14\\5c\\c7!UQ9\\9c\\1f\\b2Q\\f0\\a3\\93\\d7\\c1,\\ae~\\a8(:\\01!\\f4\\0aX\\93\\f8Bw\\9f\\839j_\\ba\\f7\\0a\\d8Qj4\\ca\\ad\\c64\\0e\\d8&\\dcL3\\1c\\ed)\\90\\a8x\\0f\\d1\\cev1#\\83\\b85\\e8\\f2D\\b0\\d3\\a1\\fc\\bb2\\e1\\b0\\baiD\\09\\d6\\d9}\\ff.\\c0Z6\\143\\14>\\a9\\fa\\87m\\8b\\bc\\ce\\9d\\a7\\fd\\c4\\e9\\85?\\dd\\d7\\e1\\18\\a6P&rn?s\\0f\\f8\\12\\93#4av\\12H\\c0\\9b\\05\\93\\eb\\ac\\86\\de\\94>U\\e8\\8c\\e8\\dd\\e4\\fc\\95G\\beV\\03! L\\e6\\bf{\\f6\\7f\\d5\\bas\\1c\\c1\\14\\8f\\c4'\\96\\b3\\bd3\\ffxA_\\c0Z\\ce\\f6gns\\9a\\17fp\\03\\f8\\ce'\\a3R\\b2\\9f;\\bf\\fb\\ae\\ed\\d3Z\\f87W\\f0\\f5n\\ef\\b1Mp=T\\a7\\01\\9a\\85\\08H\\91\\f5\\9d\\0c`\\87[\\d9T\\1eQm\\88\\8e\\08\\8c\\a5q:V\\08gF\\8f\\8f\\13*,\\ec,\\1f\\b4b+oA\\0a\\c4eB\\a21k,}>\\bbu\\ac\\86\\970\\d9H\\cd\\9a\\1fV\\c4\\c6\\e4\\12\\c0\\9d\\fb\\ee\\02\\8c\\ce\\1c\\f2\\1e\\a1x#\\db\\c4\\1eI\\03\\d3q\\cc\\08P\\c5\\d8\\5c\\ed\\d5\\b5e\\ac\\b5\\c9!\\d2\\c9)v\\de\\f00\\1a[<\\f2;\\db:9\\82:\\16\\08o\\a8\\f1\\beii\\99q\\a6\\05\\d3\\14\\93*\\16\\f2/\\11\\c7~ \\bb\\91D\\ee\\f8\\e4\\01S\\c0\\b9\\7f\\f0\\bf\\f0\\03\\9cm\\b1\\df\\a2D\\01mkq+\\5c\\b3!\\19F^\\8f\\db\\91\\d3|xk\\b7\\12\\00\\8f\\eb\\bd\\8a\\f5\\d4.\\c4\\c1\\1e\\dfscYGI\\03\\0a\\b7\\cf$\\cf\\9c\\0eDz\\9e\\14\\fbB\\bf\\9d90\\9e\\a0\\ab/\\d1\\ae\\9ej\\83C\\e3U}\\85\\bfc\\8a\\f8\\96\\10\\1f\\fem\\e7\\22\\1b\\e1iF\\8aD\\c8\\c8\\f9\\0c+\\19\\07\\a5\\02>\\f20\\10\\9a\\85\\8a_\\ef\\81E\\a0w\\b1\\03\\10sK\\ae\\98\\9dG\\bf\\9a-:\\d5\\0f\\03f\\e3=S\\d9@\\ce\\1fo2/!+#!lb\\d4\\a7>\\a8\\ce(1-\\00=g^\\af\\a0\\cf.\\d2\\b9k\\84\\ebi\\08<b6\\be\\12\\fd6\\7f\\88>\\ad\\bc\\0b\\c0A\\c4P\\b6\\e3P1\\e8\\ce\\e2\\96eU\\9c\\16F\\e6\\b0-:\\e8\\81\\05\\b0\\bf4\\f7\\bc\\10\\1c\\fb\\cc<\\f1\\85\\97B\\9f\\eb\\14\\8d<\\bf\\d7\\17\\88I\\9d\\8b+\\b2:\\83\\d1O\\04\\9e\\a1\\0f\\ad\\08\\9dT\\af\\d1\\82\\c3\\ec2/\\02\\8f\\05!-\\a2\\b7\\e4\\f4o.\\81+\\0b\\9c\\fc\\cb\\fet\\02\\f9\\db\\f4\\f3\\ea\\00\\a8\\ec\\d1\\99t&\\dd\\d64\\d5%\\b1F\\dd\\9c\\aaq\\f5`\\b0\\88\\c8\\e0\\0bYZ%O)f\\f9\\e3.\\fe\\e9\\da\\e5\\18O'b\\f4\\ce\\a4!\\95t\\c7Wd'\\9aL\\fdT}a\\ce\\c3\\ac\\87F\\9c\\fa\\ff\\09\\cay\\97g$t\\ca\\d4!\\83&%\\19\\127d\\19\\e5e\\e0tu\\8e\\dd\\c8\\eft\\c7\\d8!+y\\04QFe`\\03]\\fa\\d8\\f4e\\a4\\9e]#\\da\\d7\\8a\\92\\80\\a4\\dex<\\f1WBm\\cd\\c9/\\d5\\a4\\9e\\ab@\\f4\\cb\\1b\\d7\\a3\\ca\\fc\\eb\\a7\\01\\b2\\9aiNF\\9b\\18N\\ddy\\a7\\aa\\a6R9\\1e\\ef0\\cc\\9b\\bd[\\eeL!m0\\00r\\b0F_\\08\\cf\\c5\\b9\\e0>\\c2\\b3\\0c\\dc\\8ed\\de\\19By\\cfC\\eaC]\\8e\\88\\f7\\ab\\15\\dc?\\c8g \\db\\b8d\\b1G\\1f\\de\\f2\\cb?Y\\9f\\d8F\\90\\dc\\ae/\\22\\f9\\e21\\89\\d9\\9c\\1cL\\d3\\a9JW\\84\\9c\\9f\\ea,<\\ae<\\c3\\1e\\8b\\e5N\\17\\01%\\db4F_\\15\\ea\\05\\0c|\\d9E\\8c\\19\\d0s\\8a\\96\\16\\ddD\\f9\\05\\b7[q\\b0\\e6!6_u\\89\\91su\\ab}\\ae\\d3s\\ec7\\c6\\eaUu\\ef\\ea\\ab\\8b{\\11\\dcm\\1a\\b2j\\c4%\\cf\\aa\\e3\\9fII\\89\\cb7\\9b\\0a\\a7\\01`p\\dc\\b7\\c8\\83\\e1B\\f5\\be\\adb\\94\\ad\\8d\\a1\"))
|
||
|
";
|
||
|
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_62(instance: &mut Instance) {
|
||
|
// TODO Review is explicit start needed? Start now called in runtime::Instance::new()
|
||
|
//instance.start();
|
||
|
}
|
||
|
|
||
|
// Line 1530
|
||
|
fn c627_l1530_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c627_l1530_action_invoke");
|
||
|
let result = instance.call("f32.kahan_sum", &[Value::I32(0 as i32), Value::I32(256 as i32)]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((-21558138000000000000000000000000.0f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1531
|
||
|
fn c628_l1531_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c628_l1531_action_invoke");
|
||
|
let result = instance.call("f32.plain_sum", &[Value::I32(0 as i32), Value::I32(256 as i32)]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((-16487540000000000000000000000000.0f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1533
|
||
|
|
||
|
#[test]
|
||
|
fn test_module_62() {
|
||
|
let mut instance = create_module_62();
|
||
|
// We group the calls together
|
||
|
start_module_62(&mut instance);
|
||
|
c627_l1530_action_invoke(&mut instance);
|
||
|
c628_l1531_action_invoke(&mut instance);
|
||
|
}
|
||
|
fn create_module_63() -> Box<Instance> {
|
||
|
let module_str = "(module
|
||
|
(type (;0;) (func (param i32 i32) (result f64)))
|
||
|
(func (;0;) (type 0) (param i32 i32) (result f64)
|
||
|
(local f64 f64 f64)
|
||
|
block ;; label = @1
|
||
|
loop ;; label = @2
|
||
|
get_local 3
|
||
|
get_local 0
|
||
|
f64.load
|
||
|
get_local 4
|
||
|
f64.sub
|
||
|
tee_local 4
|
||
|
f64.add
|
||
|
tee_local 2
|
||
|
get_local 3
|
||
|
f64.sub
|
||
|
get_local 4
|
||
|
f64.sub
|
||
|
set_local 4
|
||
|
get_local 0
|
||
|
i32.const 8
|
||
|
i32.add
|
||
|
set_local 0
|
||
|
get_local 2
|
||
|
set_local 3
|
||
|
get_local 1
|
||
|
i32.const -1
|
||
|
i32.add
|
||
|
tee_local 1
|
||
|
br_if 0 (;@2;)
|
||
|
end
|
||
|
end
|
||
|
get_local 2)
|
||
|
(func (;1;) (type 0) (param i32 i32) (result f64)
|
||
|
(local f64)
|
||
|
block ;; label = @1
|
||
|
loop ;; label = @2
|
||
|
get_local 2
|
||
|
get_local 0
|
||
|
f64.load
|
||
|
f64.add
|
||
|
set_local 2
|
||
|
get_local 0
|
||
|
i32.const 8
|
||
|
i32.add
|
||
|
set_local 0
|
||
|
get_local 1
|
||
|
i32.const -1
|
||
|
i32.add
|
||
|
set_local 1
|
||
|
get_local 1
|
||
|
br_if 0 (;@2;)
|
||
|
end
|
||
|
end
|
||
|
get_local 2)
|
||
|
(memory (;0;) 1 1)
|
||
|
(export \"f64.kahan_sum\" (func 0))
|
||
|
(export \"f64.plain_sum\" (func 1))
|
||
|
(data (;0;) (i32.const 0) \"\\13\\05\\84B]\\a2,\\c6C\\dbU\\a9\\cd\\daU\\e3s\\fcX\\d6\\ba\\d5\\00\\fd\\835B\\88\\8b\\13]8JG\\0drs\\a1\\1a\\ef\\c4E\\17W\\d8\\c9F\\e0\\8dl\\e17p\\c8\\83[U^Z-s\\1eV\\c8\\e1mi\\14x\\0a\\8aZd:\\09\\c7\\a8\\87\\c5\\f0\\d3]\\e6\\03\\fc\\93\\be&\\ca\\d6\\a9\\91`\\bd\\b0\\ed\\ae\\f70~\\92:o\\a7Y\\8e\\aa}\\bfgX*T\\f8N\\fe\\ed5X\\a6Q\\bfB\\e5Kf'$m\\7fB-(\\92\\18\\ec\\08\\ae\\e7U\\da\\b1\\a6e\\a5rPG\\1b\\b8\\a9T\\d7\\a6\\06[\\0fBX\\83\\8a\\17\\82\\c6\\10C\\a0\\c0.m\\bcZ\\85Sr\\7f\\adD\\bc0<U\\b2$\\9at:\\9e\\e1\\d8\\0fp\\fc\\a9:\\cd\\93K\\ec\\e3~\\dd]'\\cd\\f8\\a0\\9d\\1c\\11\\c0W.\\fd\\c8\\132\\cc:\\1a}\\a3AU\\ed\\c3\\82I*\\04\\1e\\efs\\b9..\\e3_\\f4\\df\\e6\\b23\\0c9?oDj\\03\\c1B\\b9\\fa\\b1\\c8\\ed\\a5X\\99\\7f\\ed\\b4r\\9ey\\eb\\fbC\\82E\\aa\\bb\\95\\d2\\ff(\\9e\\f6\\a1\\ad\\95\\d6U\\95\\0do`\\11\\c7x>I\\f2~H\\f4\\a2q\\d0\\13\\8e\\b3\\de\\99R\\e3Et\\eav\\0e\\1b*\\c8\\ee\\14\\01\\c4P[6<\\ef\\bar\\a2\\a6\\08\\f8{6\\9d\\f9\\ef\\0b\\c7V-\\5c\\f0\\9d]\\de\\fc\\b8\\ad\\0fd\\0e\\97\\152&\\c21\\e6\\05\\1e\\ef\\cb\\17\\1bm\\15\\0bt]\\d3.\\f8k\\86\\b4\\basRS\\99\\a9v E\\c9@\\80k\\14\\ed\\a1\\fa\\80F\\e6&\\d2\\e6\\98\\c4W\\bf\\c4\\1c\\a4\\90z6\\94\\14\\ba\\15\\89n\\e6\\9c7\\8c\\f4\\de\\12\\22]\\a1yPg\\0d=z\\e9\\d4\\aa.\\7f*z0=\\ea]\\12H\\fe\\e1\\18\\cd\\a4W\\a2\\87>\\b6\\9a\\8b\\db\\da\\9dx\\9c\\cf\\8d\\b1O\\90\\b44\\e0\\9d\\f6\\ca\\feL;xm\\0a\\5c\\18\\9fa\\b9\\dd\\b4\\e0\\0fv\\e0\\1bi\\0d^Xsp^\\0e-\\a1}\\ff \\eb\\914\\92\\ac8r*\\1f\\8eq.j\\f1\\af\\c7'p\\d9\\c4W\\f7\\d2<\\1d\\b8\\f0\\f0d\\cf\\dc\\ae\\be\\a3\\cc>\\22}Ni!c\\17\\ed\\03\\02T\\9a\\0fPN\\13Z5\\a1\\22\\a4\\df\\86\\c2ty\\16\\b8ii\\a0R]\\11d\\bd[\\93\\fci\\a0\\f4\\13\\d0\\81Q\\dd\\fa\\0c\\15\\c3z\\c9bz\\a9\\1d\\c9\\e6Z\\b3[\\97\\02<d\\22\\12<\\22\\90d-0TL\\b4\\a1\\22\\09W\\22^\\8e8+\\02\\a8\\ae\\f6\\be\\0d+\\f2\\03\\ad\\fa\\10\\01qw*0\\02\\95\\f6\\00>\\d0\\c4\\8d4\\19P!\\0a\\bcP\\da<0\\d6:1\\94\\8d:\\fe\\ef\\14W\\9dK\\93\\00\\96$\\0co\\fd\\bc#v\\02l\\ebRr\\80\\11~\\80:\\13\\128\\1d8I\\95@'\\8aD{\\e8\\dcm\\8c\\8c\\8e<\\b5\\b3\\18\\0e\\f6\\08\\1a\\84A5\\ff\\8b\\b8\\93@\\ea\\e1Q\\1d\\89\\a5\\8dBh)\\ea/\\c1zR\\eb\\90]M\\d6\\80\\e3\\d7uH\\ce\\ed\\d3\\01\\1c\\8d[\\a5\\94\\0dx\\cf\\f1\\06\\13/\\98\\02\\a4m.l\\f2\\d5t)\\89L\\f9\\03\\f5\\c7\\18\\adz\\f0h\\f8\\5c\\d6Y\\87n\\d6?\\06\\be\\86 \\e3A\\91\\22\\f3n\\8b\\f0h\\1cW\\a7\\fc\\b0|\\9e\\99\\0b\\96\\1a\\89_\\e6\\0d|\\08Q\\a0\\a2g\\9aG\\00\\93k\\f9(\\f0h\\dbb\\f1\\e0e,S3\\e0\\a7\\ca\\11B0\\f6\\af\\01\\c1e=2\\01o\\ab.\\be\\d3\\8b\\be\\14\\c3\\ff\\ec\\fb\\f0\\f9\\c5\\0c\\05o\\01\\09k\\e341\\0c\\1ff\\a6B\\bc\\1a\\87I\\16\\16\\8c\\b0\\90\\0d4\\8c\\0a\\e1\\09^\\10\\a4kV\\cc\\f0\\c9\\bb\\dc\\b8\\5c\\ce\\f6\\cc\\8du~\\b3\\07\\88\\04/\\b4^\\c9\\e3J#s\\19bl\\9a\\03vD\\86\\9c`\\fc\\dbr\\8f'\\a0\\dd\\b3\\c5\\da\\ff\\f9\\ecj\\b1{\\d3\\cfP7\\c9zx\\0c\\e4:\\b6\\f5\\e6\\f4\\98nB}5s\\8bE\\c0V\\97\\cdm\\ce\\cf\\ad1\\b3\\c3T\\fa\\ef\\d5\\c0\\f4j_T\\e7I>3\\0a08\\fd\\d9\\05\\ff\\a5?WF\\14\\b5\\91\\17\\cak\\98#ze\\b3l\\02\\b4\\ccy]X\\d8\\b3\\d5\\94\\ae\\f4mue\\f7\\92\\bf~GL<\\ee\\db\\ac\\f12]\\fboA\\1c4\\c8\\83O\\c2X\\01\\be\\05>f\\16\\a6\\04m]O\\86\\09'\\82%\\12\\cd:\\cd\\cek\\bc\\ca\\ac(\\9b\\eej%\\86\\9eEp\\c6\\d2\\bd;}B\\e5'\\af\\c7\\1d\\f4\\81\\c8\\b3v\\8a\\a86\\a3\\ae*\\e6\\18\\e16\\22\\ad\\f6%r\\b09\\8b\\01\\9a\\22{\\84\\c3-_r\\a4\\98\\ac\\15p\\e7\\d4\\18\\e2}\\d20|3\\08\\cd\\ca\\c4\\22\\85\\88u\\81\\c6JtX\\8d\\e0\\e8\\ac\\c5\\abuZ\\f4(\\12\\f0\\18ER\\f2\\97\\b2\\93Ao\\8d\\7f\\dbp\\fb\\a3]\\1f\\a7\\8d\\98 +\\22\\9f:\\01\\b5\\8b\\1b\\d2\\cb\\14\\03\\0e\\14\\14\\d2\\19Z\\1f\\ce^\\cd\\81y\\15\\01\\ca\\dest\\8cV \\9fw-%\\16\\f6aQ\\1d\\a4\\8e\\9b\\98\\a5\\c6\\ec\\a8EW\\82Yx\\0d\\90\\b4\\dfQ\\b0\\c3\\82\\94\\cc\\b3S\\09\\15m\\96l:@G\\b7Jz\\05/\\a1\\1e\\8c\\9d\\a0 \\88\\fbR\\b7\\9f\\f3\\f3\\bb_\\e7\\8aa\\a7!\\b1\\ac\\fa\\09\\aa\\a4l\\bc$\\80\\ba*\\e9e\\ffp\\ff\\cc\\fae\\87v\\f3\\c5\\15\\ce\\cb\\e8B1\\00\\0c\\91W\\d9\\e0\\9d5T$\\ad\\a4\\d8\\f9\\08gc\\c8\\cf\\81\\dd\\90\\a2\\d7\\c4\\07J\\e6\\10og\\e7'\\d4#Y\\18\\f2\\a8\\9d_\\d8\\940\\aaT\\86O\\87\\9d\\82\\b5&\\ca\\a6\\96\\bf\\cfU\\f9\\9d7\\01\\19HC\\c5\\94l\\f3t\\97XL<\\9d\\0
|
||
|
";
|
||
|
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_63(instance: &mut Instance) {
|
||
|
// TODO Review is explicit start needed? Start now called in runtime::Instance::new()
|
||
|
//instance.start();
|
||
|
}
|
||
|
|
||
|
// Line 1581
|
||
|
fn c630_l1581_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c630_l1581_action_invoke");
|
||
|
let result = instance.call("f64.kahan_sum", &[Value::I32(0 as i32), Value::I32(256 as i32)]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((4996401743142033000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.0f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1582
|
||
|
fn c631_l1582_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c631_l1582_action_invoke");
|
||
|
let result = instance.call("f64.plain_sum", &[Value::I32(0 as i32), Value::I32(256 as i32)]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((4996401743297957600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.0f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1586
|
||
|
|
||
|
#[test]
|
||
|
fn test_module_63() {
|
||
|
let mut instance = create_module_63();
|
||
|
// We group the calls together
|
||
|
start_module_63(&mut instance);
|
||
|
c630_l1581_action_invoke(&mut instance);
|
||
|
c631_l1582_action_invoke(&mut instance);
|
||
|
}
|
||
|
fn create_module_64() -> Box<Instance> {
|
||
|
let module_str = "(module
|
||
|
(type (;0;) (func (param f32 f32) (result f32)))
|
||
|
(type (;1;) (func (param f64 f64) (result f64)))
|
||
|
(func (;0;) (type 0) (param f32 f32) (result f32)
|
||
|
get_local 0
|
||
|
get_local 1
|
||
|
f32.sub
|
||
|
f32.neg)
|
||
|
(func (;1;) (type 1) (param f64 f64) (result f64)
|
||
|
get_local 0
|
||
|
get_local 1
|
||
|
f64.sub
|
||
|
f64.neg)
|
||
|
(export \"f32.no_fold_neg_sub\" (func 0))
|
||
|
(export \"f64.no_fold_neg_sub\" (func 1)))
|
||
|
";
|
||
|
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_64(instance: &mut Instance) {
|
||
|
// TODO Review is explicit start needed? Start now called in runtime::Instance::new()
|
||
|
//instance.start();
|
||
|
}
|
||
|
|
||
|
// Line 1594
|
||
|
fn c633_l1594_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c633_l1594_action_invoke");
|
||
|
let result = instance.call("f32.no_fold_neg_sub", &[Value::F32((-0.0f32).to_bits()), Value::F32((-0.0f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((-0.0f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1595
|
||
|
fn c634_l1595_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c634_l1595_action_invoke");
|
||
|
let result = instance.call("f32.no_fold_neg_sub", &[Value::F32((0.0f32).to_bits()), Value::F32((-0.0f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((-0.0f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1596
|
||
|
fn c635_l1596_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c635_l1596_action_invoke");
|
||
|
let result = instance.call("f32.no_fold_neg_sub", &[Value::F32((-0.0f32).to_bits()), Value::F32((0.0f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((0.0f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1597
|
||
|
fn c636_l1597_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c636_l1597_action_invoke");
|
||
|
let result = instance.call("f32.no_fold_neg_sub", &[Value::F32((0.0f32).to_bits()), Value::F32((0.0f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((-0.0f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1599
|
||
|
fn c637_l1599_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c637_l1599_action_invoke");
|
||
|
let result = instance.call("f64.no_fold_neg_sub", &[Value::F64((-0.0f64).to_bits()), Value::F64((-0.0f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((-0.0f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1600
|
||
|
fn c638_l1600_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c638_l1600_action_invoke");
|
||
|
let result = instance.call("f64.no_fold_neg_sub", &[Value::F64((0.0f64).to_bits()), Value::F64((-0.0f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((-0.0f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1601
|
||
|
fn c639_l1601_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c639_l1601_action_invoke");
|
||
|
let result = instance.call("f64.no_fold_neg_sub", &[Value::F64((-0.0f64).to_bits()), Value::F64((0.0f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((0.0f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1602
|
||
|
fn c640_l1602_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c640_l1602_action_invoke");
|
||
|
let result = instance.call("f64.no_fold_neg_sub", &[Value::F64((0.0f64).to_bits()), Value::F64((0.0f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((-0.0f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1606
|
||
|
|
||
|
#[test]
|
||
|
fn test_module_64() {
|
||
|
let mut instance = create_module_64();
|
||
|
// We group the calls together
|
||
|
start_module_64(&mut instance);
|
||
|
c633_l1594_action_invoke(&mut instance);
|
||
|
c634_l1595_action_invoke(&mut instance);
|
||
|
c635_l1596_action_invoke(&mut instance);
|
||
|
c636_l1597_action_invoke(&mut instance);
|
||
|
c637_l1599_action_invoke(&mut instance);
|
||
|
c638_l1600_action_invoke(&mut instance);
|
||
|
c639_l1601_action_invoke(&mut instance);
|
||
|
c640_l1602_action_invoke(&mut instance);
|
||
|
}
|
||
|
fn create_module_65() -> Box<Instance> {
|
||
|
let module_str = "(module
|
||
|
(type (;0;) (func (param f32 f32) (result f32)))
|
||
|
(type (;1;) (func (param f64 f64) (result f64)))
|
||
|
(func (;0;) (type 0) (param f32 f32) (result f32)
|
||
|
get_local 0
|
||
|
get_local 1
|
||
|
f32.add
|
||
|
f32.neg)
|
||
|
(func (;1;) (type 1) (param f64 f64) (result f64)
|
||
|
get_local 0
|
||
|
get_local 1
|
||
|
f64.add
|
||
|
f64.neg)
|
||
|
(export \"f32.no_fold_neg_add\" (func 0))
|
||
|
(export \"f64.no_fold_neg_add\" (func 1)))
|
||
|
";
|
||
|
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_65(instance: &mut Instance) {
|
||
|
// TODO Review is explicit start needed? Start now called in runtime::Instance::new()
|
||
|
//instance.start();
|
||
|
}
|
||
|
|
||
|
// Line 1614
|
||
|
fn c642_l1614_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c642_l1614_action_invoke");
|
||
|
let result = instance.call("f32.no_fold_neg_add", &[Value::F32((-0.0f32).to_bits()), Value::F32((-0.0f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((0.0f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1615
|
||
|
fn c643_l1615_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c643_l1615_action_invoke");
|
||
|
let result = instance.call("f32.no_fold_neg_add", &[Value::F32((0.0f32).to_bits()), Value::F32((-0.0f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((-0.0f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1616
|
||
|
fn c644_l1616_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c644_l1616_action_invoke");
|
||
|
let result = instance.call("f32.no_fold_neg_add", &[Value::F32((-0.0f32).to_bits()), Value::F32((0.0f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((-0.0f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1617
|
||
|
fn c645_l1617_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c645_l1617_action_invoke");
|
||
|
let result = instance.call("f32.no_fold_neg_add", &[Value::F32((0.0f32).to_bits()), Value::F32((0.0f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((-0.0f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1619
|
||
|
fn c646_l1619_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c646_l1619_action_invoke");
|
||
|
let result = instance.call("f64.no_fold_neg_add", &[Value::F64((-0.0f64).to_bits()), Value::F64((-0.0f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((0.0f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1620
|
||
|
fn c647_l1620_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c647_l1620_action_invoke");
|
||
|
let result = instance.call("f64.no_fold_neg_add", &[Value::F64((0.0f64).to_bits()), Value::F64((-0.0f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((-0.0f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1621
|
||
|
fn c648_l1621_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c648_l1621_action_invoke");
|
||
|
let result = instance.call("f64.no_fold_neg_add", &[Value::F64((-0.0f64).to_bits()), Value::F64((0.0f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((-0.0f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1622
|
||
|
fn c649_l1622_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c649_l1622_action_invoke");
|
||
|
let result = instance.call("f64.no_fold_neg_add", &[Value::F64((0.0f64).to_bits()), Value::F64((0.0f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((-0.0f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1626
|
||
|
|
||
|
#[test]
|
||
|
fn test_module_65() {
|
||
|
let mut instance = create_module_65();
|
||
|
// We group the calls together
|
||
|
start_module_65(&mut instance);
|
||
|
c642_l1614_action_invoke(&mut instance);
|
||
|
c643_l1615_action_invoke(&mut instance);
|
||
|
c644_l1616_action_invoke(&mut instance);
|
||
|
c645_l1617_action_invoke(&mut instance);
|
||
|
c646_l1619_action_invoke(&mut instance);
|
||
|
c647_l1620_action_invoke(&mut instance);
|
||
|
c648_l1621_action_invoke(&mut instance);
|
||
|
c649_l1622_action_invoke(&mut instance);
|
||
|
}
|
||
|
fn create_module_66() -> Box<Instance> {
|
||
|
let module_str = "(module
|
||
|
(type (;0;) (func (param f32 f32) (result f32)))
|
||
|
(type (;1;) (func (param f64 f64) (result f64)))
|
||
|
(func (;0;) (type 0) (param f32 f32) (result f32)
|
||
|
get_local 0
|
||
|
f32.neg
|
||
|
get_local 1
|
||
|
f32.neg
|
||
|
f32.add)
|
||
|
(func (;1;) (type 1) (param f64 f64) (result f64)
|
||
|
get_local 0
|
||
|
f64.neg
|
||
|
get_local 1
|
||
|
f64.neg
|
||
|
f64.add)
|
||
|
(export \"f32.no_fold_add_neg_neg\" (func 0))
|
||
|
(export \"f64.no_fold_add_neg_neg\" (func 1)))
|
||
|
";
|
||
|
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_66(instance: &mut Instance) {
|
||
|
// TODO Review is explicit start needed? Start now called in runtime::Instance::new()
|
||
|
//instance.start();
|
||
|
}
|
||
|
|
||
|
// Line 1634
|
||
|
fn c651_l1634_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c651_l1634_action_invoke");
|
||
|
let result = instance.call("f32.no_fold_add_neg_neg", &[Value::F32((-0.0f32).to_bits()), Value::F32((-0.0f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((0.0f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1635
|
||
|
fn c652_l1635_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c652_l1635_action_invoke");
|
||
|
let result = instance.call("f32.no_fold_add_neg_neg", &[Value::F32((0.0f32).to_bits()), Value::F32((-0.0f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((0.0f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1636
|
||
|
fn c653_l1636_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c653_l1636_action_invoke");
|
||
|
let result = instance.call("f32.no_fold_add_neg_neg", &[Value::F32((-0.0f32).to_bits()), Value::F32((0.0f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((0.0f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1637
|
||
|
fn c654_l1637_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c654_l1637_action_invoke");
|
||
|
let result = instance.call("f32.no_fold_add_neg_neg", &[Value::F32((0.0f32).to_bits()), Value::F32((0.0f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((-0.0f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1639
|
||
|
fn c655_l1639_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c655_l1639_action_invoke");
|
||
|
let result = instance.call("f64.no_fold_add_neg_neg", &[Value::F64((-0.0f64).to_bits()), Value::F64((-0.0f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((0.0f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1640
|
||
|
fn c656_l1640_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c656_l1640_action_invoke");
|
||
|
let result = instance.call("f64.no_fold_add_neg_neg", &[Value::F64((0.0f64).to_bits()), Value::F64((-0.0f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((0.0f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1641
|
||
|
fn c657_l1641_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c657_l1641_action_invoke");
|
||
|
let result = instance.call("f64.no_fold_add_neg_neg", &[Value::F64((-0.0f64).to_bits()), Value::F64((0.0f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((0.0f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1642
|
||
|
fn c658_l1642_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c658_l1642_action_invoke");
|
||
|
let result = instance.call("f64.no_fold_add_neg_neg", &[Value::F64((0.0f64).to_bits()), Value::F64((0.0f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((-0.0f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1646
|
||
|
|
||
|
#[test]
|
||
|
fn test_module_66() {
|
||
|
let mut instance = create_module_66();
|
||
|
// We group the calls together
|
||
|
start_module_66(&mut instance);
|
||
|
c651_l1634_action_invoke(&mut instance);
|
||
|
c652_l1635_action_invoke(&mut instance);
|
||
|
c653_l1636_action_invoke(&mut instance);
|
||
|
c654_l1637_action_invoke(&mut instance);
|
||
|
c655_l1639_action_invoke(&mut instance);
|
||
|
c656_l1640_action_invoke(&mut instance);
|
||
|
c657_l1641_action_invoke(&mut instance);
|
||
|
c658_l1642_action_invoke(&mut instance);
|
||
|
}
|
||
|
fn create_module_67() -> Box<Instance> {
|
||
|
let module_str = "(module
|
||
|
(type (;0;) (func (param f32) (result f32)))
|
||
|
(type (;1;) (func (param f64) (result f64)))
|
||
|
(func (;0;) (type 0) (param f32) (result f32)
|
||
|
get_local 0
|
||
|
f32.neg
|
||
|
get_local 0
|
||
|
f32.add)
|
||
|
(func (;1;) (type 1) (param f64) (result f64)
|
||
|
get_local 0
|
||
|
f64.neg
|
||
|
get_local 0
|
||
|
f64.add)
|
||
|
(export \"f32.no_fold_add_neg\" (func 0))
|
||
|
(export \"f64.no_fold_add_neg\" (func 1)))
|
||
|
";
|
||
|
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_67(instance: &mut Instance) {
|
||
|
// TODO Review is explicit start needed? Start now called in runtime::Instance::new()
|
||
|
//instance.start();
|
||
|
}
|
||
|
|
||
|
// Line 1654
|
||
|
fn c660_l1654_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c660_l1654_action_invoke");
|
||
|
let result = instance.call("f32.no_fold_add_neg", &[Value::F32((0.0f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((0.0f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1655
|
||
|
fn c661_l1655_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c661_l1655_action_invoke");
|
||
|
let result = instance.call("f32.no_fold_add_neg", &[Value::F32((-0.0f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((0.0f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1656
|
||
|
fn c662_l1656_assert_return_canonical_nan(instance: &mut Instance) {
|
||
|
println!("Executing function {}", "c662_l1656_assert_return_canonical_nan");
|
||
|
let result = instance.call("f32.no_fold_add_neg", &[Value::F32(f32::INFINITY.to_bits())]).unwrap().expect("Missing result in c662_l1656_assert_return_canonical_nan");
|
||
|
assert!(match result {
|
||
|
Value::F32(fp) => f32::from_bits(fp).is_quiet_nan(),
|
||
|
Value::F64(fp) => f64::from_bits(fp).is_quiet_nan(),
|
||
|
_ => unimplemented!()
|
||
|
})
|
||
|
}
|
||
|
|
||
|
// Line 1657
|
||
|
fn c663_l1657_assert_return_canonical_nan(instance: &mut Instance) {
|
||
|
println!("Executing function {}", "c663_l1657_assert_return_canonical_nan");
|
||
|
let result = instance.call("f32.no_fold_add_neg", &[Value::F32(f32::NEG_INFINITY.to_bits())]).unwrap().expect("Missing result in c663_l1657_assert_return_canonical_nan");
|
||
|
assert!(match result {
|
||
|
Value::F32(fp) => f32::from_bits(fp).is_quiet_nan(),
|
||
|
Value::F64(fp) => f64::from_bits(fp).is_quiet_nan(),
|
||
|
_ => unimplemented!()
|
||
|
})
|
||
|
}
|
||
|
|
||
|
// Line 1659
|
||
|
fn c664_l1659_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c664_l1659_action_invoke");
|
||
|
let result = instance.call("f64.no_fold_add_neg", &[Value::F64((0.0f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((0.0f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1660
|
||
|
fn c665_l1660_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c665_l1660_action_invoke");
|
||
|
let result = instance.call("f64.no_fold_add_neg", &[Value::F64((-0.0f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((0.0f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1661
|
||
|
fn c666_l1661_assert_return_canonical_nan(instance: &mut Instance) {
|
||
|
println!("Executing function {}", "c666_l1661_assert_return_canonical_nan");
|
||
|
let result = instance.call("f64.no_fold_add_neg", &[Value::F64(f64::INFINITY.to_bits())]).unwrap().expect("Missing result in c666_l1661_assert_return_canonical_nan");
|
||
|
assert!(match result {
|
||
|
Value::F32(fp) => f32::from_bits(fp).is_quiet_nan(),
|
||
|
Value::F64(fp) => f64::from_bits(fp).is_quiet_nan(),
|
||
|
_ => unimplemented!()
|
||
|
})
|
||
|
}
|
||
|
|
||
|
// Line 1662
|
||
|
fn c667_l1662_assert_return_canonical_nan(instance: &mut Instance) {
|
||
|
println!("Executing function {}", "c667_l1662_assert_return_canonical_nan");
|
||
|
let result = instance.call("f64.no_fold_add_neg", &[Value::F64(f64::NEG_INFINITY.to_bits())]).unwrap().expect("Missing result in c667_l1662_assert_return_canonical_nan");
|
||
|
assert!(match result {
|
||
|
Value::F32(fp) => f32::from_bits(fp).is_quiet_nan(),
|
||
|
Value::F64(fp) => f64::from_bits(fp).is_quiet_nan(),
|
||
|
_ => unimplemented!()
|
||
|
})
|
||
|
}
|
||
|
|
||
|
// Line 1666
|
||
|
|
||
|
#[test]
|
||
|
fn test_module_67() {
|
||
|
let mut instance = create_module_67();
|
||
|
// We group the calls together
|
||
|
start_module_67(&mut instance);
|
||
|
c660_l1654_action_invoke(&mut instance);
|
||
|
c661_l1655_action_invoke(&mut instance);
|
||
|
c662_l1656_assert_return_canonical_nan(&mut instance);
|
||
|
c663_l1657_assert_return_canonical_nan(&mut instance);
|
||
|
c664_l1659_action_invoke(&mut instance);
|
||
|
c665_l1660_action_invoke(&mut instance);
|
||
|
c666_l1661_assert_return_canonical_nan(&mut instance);
|
||
|
c667_l1662_assert_return_canonical_nan(&mut instance);
|
||
|
}
|
||
|
fn create_module_68() -> Box<Instance> {
|
||
|
let module_str = "(module
|
||
|
(type (;0;) (func (param f32) (result f32)))
|
||
|
(type (;1;) (func (param f64) (result f64)))
|
||
|
(func (;0;) (type 0) (param f32) (result f32)
|
||
|
get_local 0
|
||
|
get_local 0
|
||
|
f32.add
|
||
|
get_local 0
|
||
|
f32.add
|
||
|
get_local 0
|
||
|
f32.add
|
||
|
get_local 0
|
||
|
f32.add
|
||
|
get_local 0
|
||
|
f32.add)
|
||
|
(func (;1;) (type 1) (param f64) (result f64)
|
||
|
get_local 0
|
||
|
get_local 0
|
||
|
f64.add
|
||
|
get_local 0
|
||
|
f64.add
|
||
|
get_local 0
|
||
|
f64.add
|
||
|
get_local 0
|
||
|
f64.add
|
||
|
get_local 0
|
||
|
f64.add)
|
||
|
(export \"f32.no_fold_6x_via_add\" (func 0))
|
||
|
(export \"f64.no_fold_6x_via_add\" (func 1)))
|
||
|
";
|
||
|
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_68(instance: &mut Instance) {
|
||
|
// TODO Review is explicit start needed? Start now called in runtime::Instance::new()
|
||
|
//instance.start();
|
||
|
}
|
||
|
|
||
|
// Line 1680
|
||
|
fn c669_l1680_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c669_l1680_action_invoke");
|
||
|
let result = instance.call("f32.no_fold_6x_via_add", &[Value::F32((-855513700000000000000000000000.0f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((-5133083000000000000000000000000.0f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1681
|
||
|
fn c670_l1681_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c670_l1681_action_invoke");
|
||
|
let result = instance.call("f32.no_fold_6x_via_add", &[Value::F32((-0.00000000000000000000001209506f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((-0.00000000000000000000007257036f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1682
|
||
|
fn c671_l1682_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c671_l1682_action_invoke");
|
||
|
let result = instance.call("f32.no_fold_6x_via_add", &[Value::F32((0.000000000000000000000006642689f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((0.000000000000000000000039856134f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1683
|
||
|
fn c672_l1683_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c672_l1683_action_invoke");
|
||
|
let result = instance.call("f32.no_fold_6x_via_add", &[Value::F32((-0.0000000006147346f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((-0.0000000036884074f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1684
|
||
|
fn c673_l1684_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c673_l1684_action_invoke");
|
||
|
let result = instance.call("f32.no_fold_6x_via_add", &[Value::F32((-1209858100000000000000000.0f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((-7259148300000000000000000.0f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1686
|
||
|
fn c674_l1686_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c674_l1686_action_invoke");
|
||
|
let result = instance.call("f64.no_fold_6x_via_add", &[Value::F64((-351704490602771400000.0f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((-2110226943616628600000.0f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1687
|
||
|
fn c675_l1687_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c675_l1687_action_invoke");
|
||
|
let result = instance.call("f64.no_fold_6x_via_add", &[Value::F64((-0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000014824294109868734f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((-0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008894576465921239f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1688
|
||
|
fn c676_l1688_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c676_l1688_action_invoke");
|
||
|
let result = instance.call("f64.no_fold_6x_via_add", &[Value::F64((-7484567838781003000000000000000000000000000000000000000000000000000000000000000000.0f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((-44907407032686014000000000000000000000000000000000000000000000000000000000000000000.0f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1689
|
||
|
fn c677_l1689_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c677_l1689_action_invoke");
|
||
|
let result = instance.call("f64.no_fold_6x_via_add", &[Value::F64((17277868192936067000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.0f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((103667209157616410000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.0f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1690
|
||
|
fn c678_l1690_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c678_l1690_action_invoke");
|
||
|
let result = instance.call("f64.no_fold_6x_via_add", &[Value::F64((-43116397525195610000000000000000000000000000000000000000000000000000000.0f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((-258698385151173640000000000000000000000000000000000000000000000000000000.0f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1695
|
||
|
|
||
|
#[test]
|
||
|
fn test_module_68() {
|
||
|
let mut instance = create_module_68();
|
||
|
// We group the calls together
|
||
|
start_module_68(&mut instance);
|
||
|
c669_l1680_action_invoke(&mut instance);
|
||
|
c670_l1681_action_invoke(&mut instance);
|
||
|
c671_l1682_action_invoke(&mut instance);
|
||
|
c672_l1683_action_invoke(&mut instance);
|
||
|
c673_l1684_action_invoke(&mut instance);
|
||
|
c674_l1686_action_invoke(&mut instance);
|
||
|
c675_l1687_action_invoke(&mut instance);
|
||
|
c676_l1688_action_invoke(&mut instance);
|
||
|
c677_l1689_action_invoke(&mut instance);
|
||
|
c678_l1690_action_invoke(&mut instance);
|
||
|
}
|
||
|
fn create_module_69() -> Box<Instance> {
|
||
|
let module_str = "(module
|
||
|
(type (;0;) (func (param f32 f32 f32) (result f32)))
|
||
|
(type (;1;) (func (param f64 f64 f64) (result f64)))
|
||
|
(func (;0;) (type 0) (param f32 f32 f32) (result f32)
|
||
|
get_local 0
|
||
|
get_local 1
|
||
|
f32.div
|
||
|
get_local 2
|
||
|
f32.div)
|
||
|
(func (;1;) (type 1) (param f64 f64 f64) (result f64)
|
||
|
get_local 0
|
||
|
get_local 1
|
||
|
f64.div
|
||
|
get_local 2
|
||
|
f64.div)
|
||
|
(export \"f32.no_fold_div_div\" (func 0))
|
||
|
(export \"f64.no_fold_div_div\" (func 1)))
|
||
|
";
|
||
|
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_69(instance: &mut Instance) {
|
||
|
// TODO Review is explicit start needed? Start now called in runtime::Instance::new()
|
||
|
//instance.start();
|
||
|
}
|
||
|
|
||
|
// Line 1703
|
||
|
fn c680_l1703_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c680_l1703_action_invoke");
|
||
|
let result = instance.call("f32.no_fold_div_div", &[Value::F32((-593847530000000000000000.0f32).to_bits()), Value::F32((-0.000030265672f32).to_bits()), Value::F32((-1584.8682f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((-12380309000000000000000000.0f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1704
|
||
|
fn c681_l1704_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c681_l1704_action_invoke");
|
||
|
let result = instance.call("f32.no_fold_div_div", &[Value::F32((0.0000000000000000000015438962f32).to_bits()), Value::F32((2533429300000000000000000000000000.0f32).to_bits()), Value::F32((-0.00000000000000000000000000000000026844783f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((-0.0f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1705
|
||
|
fn c682_l1705_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c682_l1705_action_invoke");
|
||
|
let result = instance.call("f32.no_fold_div_div", &[Value::F32((13417423000000.0f32).to_bits()), Value::F32((0.000000000000000000000000000000029339205f32).to_bits()), Value::F32((76386374000000000000000000000000.0f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32(f32::INFINITY.to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1706
|
||
|
fn c683_l1706_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c683_l1706_action_invoke");
|
||
|
let result = instance.call("f32.no_fold_div_div", &[Value::F32((-0.00010776529f32).to_bits()), Value::F32((-34220943000000000000000000000000000000.0f32).to_bits()), Value::F32((-0.00000000000016562324f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((-0.000000000000000000000000000019011327f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1707
|
||
|
fn c684_l1707_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c684_l1707_action_invoke");
|
||
|
let result = instance.call("f32.no_fold_div_div", &[Value::F32((130582500000000.0f32).to_bits()), Value::F32((96245350000000000.0f32).to_bits()), Value::F32((-41461545000000000000000000000000000000.0f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((-0.000000000000000000000000000000000000000032723f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1709
|
||
|
fn c685_l1709_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c685_l1709_action_invoke");
|
||
|
let result = instance.call("f64.no_fold_div_div", &[Value::F64((477762874671014340000000000000000000000000000000000000000000000000000000000000000000000000000000000000.0f64).to_bits()), Value::F64((102786720420404010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.0f64).to_bits()), Value::F64((-0.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000718999894988884f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((-64646730118787990000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.0f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1710
|
||
|
fn c686_l1710_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c686_l1710_action_invoke");
|
||
|
let result = instance.call("f64.no_fold_div_div", &[Value::F64((-21790236783875714000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.0f64).to_bits()), Value::F64((0.0000000028324436844616576f64).to_bits()), Value::F64((186110768259868700000000000000000000000000000000000000000000000000000000000000000000000000000000.0f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((-41336068079920670000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.0f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1711
|
||
|
fn c687_l1711_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c687_l1711_action_invoke");
|
||
|
let result = instance.call("f64.no_fold_div_div", &[Value::F64((-7.287619347826683f64).to_bits()), Value::F64((-13467607316739855000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.0f64).to_bits()), Value::F64((2462719007013688000000000000000000000000000000000000.0f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000219725454f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1712
|
||
|
fn c688_l1712_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c688_l1712_action_invoke");
|
||
|
let result = instance.call("f64.no_fold_div_div", &[Value::F64((-286552397862963300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.0f64).to_bits()), Value::F64((0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010211980370639414f64).to_bits()), Value::F64((28764586483324010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.0f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64(f64::NEG_INFINITY.to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1713
|
||
|
fn c689_l1713_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c689_l1713_action_invoke");
|
||
|
let result = instance.call("f64.no_fold_div_div", &[Value::F64((-0.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000009525735602663874f64).to_bits()), Value::F64((0.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000050233948816631796f64).to_bits()), Value::F64((-0.0000000000000000000000000000000000000000028304570228221077f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((0.00000000000000000000000000000000000000000000006699534674970116f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1719
|
||
|
|
||
|
#[test]
|
||
|
fn test_module_69() {
|
||
|
let mut instance = create_module_69();
|
||
|
// We group the calls together
|
||
|
start_module_69(&mut instance);
|
||
|
c680_l1703_action_invoke(&mut instance);
|
||
|
c681_l1704_action_invoke(&mut instance);
|
||
|
c682_l1705_action_invoke(&mut instance);
|
||
|
c683_l1706_action_invoke(&mut instance);
|
||
|
c684_l1707_action_invoke(&mut instance);
|
||
|
c685_l1709_action_invoke(&mut instance);
|
||
|
c686_l1710_action_invoke(&mut instance);
|
||
|
c687_l1711_action_invoke(&mut instance);
|
||
|
c688_l1712_action_invoke(&mut instance);
|
||
|
c689_l1713_action_invoke(&mut instance);
|
||
|
}
|
||
|
fn create_module_70() -> Box<Instance> {
|
||
|
let module_str = "(module
|
||
|
(type (;0;) (func (param f32 f32 f32 f32) (result f32)))
|
||
|
(type (;1;) (func (param f64 f64 f64 f64) (result f64)))
|
||
|
(func (;0;) (type 0) (param f32 f32 f32 f32) (result f32)
|
||
|
get_local 0
|
||
|
get_local 1
|
||
|
f32.div
|
||
|
get_local 2
|
||
|
get_local 3
|
||
|
f32.div
|
||
|
f32.mul)
|
||
|
(func (;1;) (type 1) (param f64 f64 f64 f64) (result f64)
|
||
|
get_local 0
|
||
|
get_local 1
|
||
|
f64.div
|
||
|
get_local 2
|
||
|
get_local 3
|
||
|
f64.div
|
||
|
f64.mul)
|
||
|
(export \"f32.no_fold_mul_divs\" (func 0))
|
||
|
(export \"f64.no_fold_mul_divs\" (func 1)))
|
||
|
";
|
||
|
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_70(instance: &mut Instance) {
|
||
|
// TODO Review is explicit start needed? Start now called in runtime::Instance::new()
|
||
|
//instance.start();
|
||
|
}
|
||
|
|
||
|
// Line 1727
|
||
|
fn c691_l1727_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c691_l1727_action_invoke");
|
||
|
let result = instance.call("f32.no_fold_mul_divs", &[Value::F32((-0.0000000000000000000000000000000027234733f32).to_bits()), Value::F32((0.0000000000000000000000000003897843f32).to_bits()), Value::F32((0.000000000000000000000000004847123f32).to_bits()), Value::F32((-25.357775f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((0.0000000000000000000000000000000013355855f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1728
|
||
|
fn c692_l1728_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c692_l1728_action_invoke");
|
||
|
let result = instance.call("f32.no_fold_mul_divs", &[Value::F32((-5372844000000000000000000000000.0f32).to_bits()), Value::F32((38340910.0f32).to_bits()), Value::F32((0.000014973162f32).to_bits()), Value::F32((0.19213825f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((-10920475000000000000.0f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1729
|
||
|
fn c693_l1729_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c693_l1729_action_invoke");
|
||
|
let result = instance.call("f32.no_fold_mul_divs", &[Value::F32((-16085042000.0f32).to_bits()), Value::F32((-1092920200000.0f32).to_bits()), Value::F32((-869606000.0f32).to_bits()), Value::F32((-1201.206f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((10654.639f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1730
|
||
|
fn c694_l1730_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c694_l1730_action_invoke");
|
||
|
let result = instance.call("f32.no_fold_mul_divs", &[Value::F32((-1271223140000000000000000000000000.0f32).to_bits()), Value::F32((0.00000000010768114f32).to_bits()), Value::F32((0.000018576271f32).to_bits()), Value::F32((492686200000000000000000.0f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32(f32::NEG_INFINITY.to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1731
|
||
|
fn c695_l1731_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c695_l1731_action_invoke");
|
||
|
let result = instance.call("f32.no_fold_mul_divs", &[Value::F32((0.00000000000000013783864f32).to_bits()), Value::F32((-0.000000000000000000065046285f32).to_bits()), Value::F32((0.00000000000000000000000000068167684f32).to_bits()), Value::F32((0.000000000022892627f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((-0.000000000000063100295f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1733
|
||
|
fn c696_l1733_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c696_l1733_action_invoke");
|
||
|
let result = instance.call("f64.no_fold_mul_divs", &[Value::F64((-0.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003466499805233369f64).to_bits()), Value::F64((-0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004045567512248635f64).to_bits()), Value::F64((-646234107060759200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.0f64).to_bits()), Value::F64((100455895333540740000000000000000000000000000000000000000.0f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((-55.12215321310017f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1734
|
||
|
fn c697_l1734_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c697_l1734_action_invoke");
|
||
|
let result = instance.call("f64.no_fold_mul_divs", &[Value::F64((-50548839076363250000000000000000000.0f64).to_bits()), Value::F64((0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000022223781649976275f64).to_bits()), Value::F64((-15029790371100852000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.0f64).to_bits()), Value::F64((-699412375953812100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.0f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64(f64::NEG_INFINITY.to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1735
|
||
|
fn c698_l1735_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c698_l1735_action_invoke");
|
||
|
let result = instance.call("f64.no_fold_mul_divs", &[Value::F64((-836111653634494700000000000000000000000000000000000000000000000000000000000000000000000000000.0f64).to_bits()), Value::F64((-10029528876067567000000000000000000000000000000000000000000.0f64).to_bits()), Value::F64((-0.0000000000000000000000000000000000000000012867801766038772f64).to_bits()), Value::F64((-42230277746883753000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.0f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002540178100556387f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1736
|
||
|
fn c699_l1736_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c699_l1736_action_invoke");
|
||
|
let result = instance.call("f64.no_fold_mul_divs", &[Value::F64((-1202003211641119300000000000000000000000.0f64).to_bits()), Value::F64((-0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004667409771338769f64).to_bits()), Value::F64((0.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010888652376540085f64).to_bits()), Value::F64((18334948666517216000000000000000000000000000000000000000000000000000.0f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((0.0f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1737
|
||
|
fn c700_l1737_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c700_l1737_action_invoke");
|
||
|
let result = instance.call("f64.no_fold_mul_divs", &[Value::F64((0.000006331839568840419f64).to_bits()), Value::F64((0.000000000000000000000000000000000000000000000000000000000000000000000000000000000005544474241905778f64).to_bits()), Value::F64((0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000027822472480359097f64).to_bits()), Value::F64((-14419321081893022000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.0f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((-0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000022035374770746518f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1741
|
||
|
|
||
|
#[test]
|
||
|
fn test_module_70() {
|
||
|
let mut instance = create_module_70();
|
||
|
// We group the calls together
|
||
|
start_module_70(&mut instance);
|
||
|
c691_l1727_action_invoke(&mut instance);
|
||
|
c692_l1728_action_invoke(&mut instance);
|
||
|
c693_l1729_action_invoke(&mut instance);
|
||
|
c694_l1730_action_invoke(&mut instance);
|
||
|
c695_l1731_action_invoke(&mut instance);
|
||
|
c696_l1733_action_invoke(&mut instance);
|
||
|
c697_l1734_action_invoke(&mut instance);
|
||
|
c698_l1735_action_invoke(&mut instance);
|
||
|
c699_l1736_action_invoke(&mut instance);
|
||
|
c700_l1737_action_invoke(&mut instance);
|
||
|
}
|
||
|
fn create_module_71() -> Box<Instance> {
|
||
|
let module_str = "(module
|
||
|
(type (;0;) (func (param f32 f32 f32) (result f32)))
|
||
|
(type (;1;) (func (param f64 f64 f64) (result f64)))
|
||
|
(func (;0;) (type 0) (param f32 f32 f32) (result f32)
|
||
|
get_local 0
|
||
|
get_local 2
|
||
|
f32.div
|
||
|
get_local 1
|
||
|
get_local 2
|
||
|
f32.div
|
||
|
f32.add)
|
||
|
(func (;1;) (type 1) (param f64 f64 f64) (result f64)
|
||
|
get_local 0
|
||
|
get_local 2
|
||
|
f64.div
|
||
|
get_local 1
|
||
|
get_local 2
|
||
|
f64.div
|
||
|
f64.add)
|
||
|
(export \"f32.no_fold_add_divs\" (func 0))
|
||
|
(export \"f64.no_fold_add_divs\" (func 1)))
|
||
|
";
|
||
|
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_71(instance: &mut Instance) {
|
||
|
// TODO Review is explicit start needed? Start now called in runtime::Instance::new()
|
||
|
//instance.start();
|
||
|
}
|
||
|
|
||
|
// Line 1749
|
||
|
fn c702_l1749_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c702_l1749_action_invoke");
|
||
|
let result = instance.call("f32.no_fold_add_divs", &[Value::F32((377.3689f32).to_bits()), Value::F32((-0.040118184f32).to_bits()), Value::F32((-136292990000000000000000000000000000000.0f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((-0.0000000000000000000000000000000000027685121f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1750
|
||
|
fn c703_l1750_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c703_l1750_action_invoke");
|
||
|
let result = instance.call("f32.no_fold_add_divs", &[Value::F32((-0.00000000000000000018234023f32).to_bits()), Value::F32((-0.0000000000000033970288f32).to_bits()), Value::F32((-170996700000000.0f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((0.000000000000000000000000000019867115f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1751
|
||
|
fn c704_l1751_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c704_l1751_action_invoke");
|
||
|
let result = instance.call("f32.no_fold_add_divs", &[Value::F32((-0.000000000000019672638f32).to_bits()), Value::F32((0.00000000000000000006414099f32).to_bits()), Value::F32((-541989070000000.0f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((0.000000000000000000000000000036296997f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1752
|
||
|
fn c705_l1752_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c705_l1752_action_invoke");
|
||
|
let result = instance.call("f32.no_fold_add_divs", &[Value::F32((-0.0000000000000000000000000000004038506f32).to_bits()), Value::F32((0.000000000000000000000000000003848228f32).to_bits()), Value::F32((-345237200000000000000000000.0f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((0.0f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1753
|
||
|
fn c706_l1753_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c706_l1753_action_invoke");
|
||
|
let result = instance.call("f32.no_fold_add_divs", &[Value::F32((0.0010934415f32).to_bits()), Value::F32((0.20703124f32).to_bits()), Value::F32((0.00000000000000000000000000000000000013509784f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((1540547700000000000000000000000000000.0f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1755
|
||
|
fn c707_l1755_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c707_l1755_action_invoke");
|
||
|
let result = instance.call("f64.no_fold_add_divs", &[Value::F64((-4917019432143760000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.0f64).to_bits()), Value::F64((68132156322019020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.0f64).to_bits()), Value::F64((26125410100237784000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.0f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((0.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000024196801752520584f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1756
|
||
|
fn c708_l1756_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c708_l1756_action_invoke");
|
||
|
let result = instance.call("f64.no_fold_add_divs", &[Value::F64((-10206467953224550.0f64).to_bits()), Value::F64((63.422616671746226f64).to_bits()), Value::F64((-0.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000016024747869814892f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((6369190976445851000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.0f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1757
|
||
|
fn c709_l1757_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c709_l1757_action_invoke");
|
||
|
let result = instance.call("f64.no_fold_add_divs", &[Value::F64((-0.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000015270569633109837f64).to_bits()), Value::F64((0.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000025755503329232514f64).to_bits()), Value::F64((58826939164214920000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.0f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((0.0f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1758
|
||
|
fn c710_l1758_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c710_l1758_action_invoke");
|
||
|
let result = instance.call("f64.no_fold_add_divs", &[Value::F64((26667964874394640000000000000000000000000000000000000000000000000000000000000000000000000000000.0f64).to_bits()), Value::F64((-2131569252493657800000000000000000000000000000000000000000000000000000000000000000000000000000000000.0f64).to_bits()), Value::F64((0.000000000000000000000000000000000000012377004518680012f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((-172217969324625340000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.0f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1759
|
||
|
fn c711_l1759_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c711_l1759_action_invoke");
|
||
|
let result = instance.call("f64.no_fold_add_divs", &[Value::F64((-0.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000012952888377288216f64).to_bits()), Value::F64((0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000005808769259900048f64).to_bits()), Value::F64((0.0000000000000000000016745741699443756f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((-0.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000007735034106987796f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1763
|
||
|
|
||
|
#[test]
|
||
|
fn test_module_71() {
|
||
|
let mut instance = create_module_71();
|
||
|
// We group the calls together
|
||
|
start_module_71(&mut instance);
|
||
|
c702_l1749_action_invoke(&mut instance);
|
||
|
c703_l1750_action_invoke(&mut instance);
|
||
|
c704_l1751_action_invoke(&mut instance);
|
||
|
c705_l1752_action_invoke(&mut instance);
|
||
|
c706_l1753_action_invoke(&mut instance);
|
||
|
c707_l1755_action_invoke(&mut instance);
|
||
|
c708_l1756_action_invoke(&mut instance);
|
||
|
c709_l1757_action_invoke(&mut instance);
|
||
|
c710_l1758_action_invoke(&mut instance);
|
||
|
c711_l1759_action_invoke(&mut instance);
|
||
|
}
|
||
|
fn create_module_72() -> Box<Instance> {
|
||
|
let module_str = "(module
|
||
|
(type (;0;) (func (param f32) (result f32)))
|
||
|
(type (;1;) (func (param f64) (result f64)))
|
||
|
(func (;0;) (type 0) (param f32) (result f32)
|
||
|
get_local 0
|
||
|
get_local 0
|
||
|
f32.mul
|
||
|
f32.sqrt)
|
||
|
(func (;1;) (type 1) (param f64) (result f64)
|
||
|
get_local 0
|
||
|
get_local 0
|
||
|
f64.mul
|
||
|
f64.sqrt)
|
||
|
(export \"f32.no_fold_sqrt_square\" (func 0))
|
||
|
(export \"f64.no_fold_sqrt_square\" (func 1)))
|
||
|
";
|
||
|
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_72(instance: &mut Instance) {
|
||
|
// TODO Review is explicit start needed? Start now called in runtime::Instance::new()
|
||
|
//instance.start();
|
||
|
}
|
||
|
|
||
|
// Line 1771
|
||
|
fn c713_l1771_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c713_l1771_action_invoke");
|
||
|
let result = instance.call("f32.no_fold_sqrt_square", &[Value::F32((-0.00000000000000000001846f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((0.00000000000000000001846001f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1772
|
||
|
fn c714_l1772_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c714_l1772_action_invoke");
|
||
|
let result = instance.call("f32.no_fold_sqrt_square", &[Value::F32((-0.00000000000000000000017907473f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((0.00000000000000000000017952678f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1773
|
||
|
fn c715_l1773_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c715_l1773_action_invoke");
|
||
|
let result = instance.call("f32.no_fold_sqrt_square", &[Value::F32((-0.00000000000000000000079120785f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((0.000000000000000000000791442f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1774
|
||
|
fn c716_l1774_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c716_l1774_action_invoke");
|
||
|
let result = instance.call("f32.no_fold_sqrt_square", &[Value::F32((0.000000000000000000000000018012938f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((0.0f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1775
|
||
|
fn c717_l1775_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c717_l1775_action_invoke");
|
||
|
let result = instance.call("f32.no_fold_sqrt_square", &[Value::F32((610501970000000000000000000000000.0f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32(f32::INFINITY.to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1777
|
||
|
fn c718_l1777_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c718_l1777_action_invoke");
|
||
|
let result = instance.call("f64.no_fold_sqrt_square", &[Value::F64((0.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006209297167747496f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((0.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006209299542179727f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1778
|
||
|
fn c719_l1778_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c719_l1778_action_invoke");
|
||
|
let result = instance.call("f64.no_fold_sqrt_square", &[Value::F64((-0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000024211175303738945f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000024211175303738937f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1779
|
||
|
fn c720_l1779_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c720_l1779_action_invoke");
|
||
|
let result = instance.call("f64.no_fold_sqrt_square", &[Value::F64((-0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000016460687611875645f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000016460687611532367f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1780
|
||
|
fn c721_l1780_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c721_l1780_action_invoke");
|
||
|
let result = instance.call("f64.no_fold_sqrt_square", &[Value::F64((-0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003797811613378828f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((0.0f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1781
|
||
|
fn c722_l1781_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c722_l1781_action_invoke");
|
||
|
let result = instance.call("f64.no_fold_sqrt_square", &[Value::F64((815808428460559200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.0f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64(f64::INFINITY.to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1785
|
||
|
|
||
|
#[test]
|
||
|
fn test_module_72() {
|
||
|
let mut instance = create_module_72();
|
||
|
// We group the calls together
|
||
|
start_module_72(&mut instance);
|
||
|
c713_l1771_action_invoke(&mut instance);
|
||
|
c714_l1772_action_invoke(&mut instance);
|
||
|
c715_l1773_action_invoke(&mut instance);
|
||
|
c716_l1774_action_invoke(&mut instance);
|
||
|
c717_l1775_action_invoke(&mut instance);
|
||
|
c718_l1777_action_invoke(&mut instance);
|
||
|
c719_l1778_action_invoke(&mut instance);
|
||
|
c720_l1779_action_invoke(&mut instance);
|
||
|
c721_l1780_action_invoke(&mut instance);
|
||
|
c722_l1781_action_invoke(&mut instance);
|
||
|
}
|
||
|
fn create_module_73() -> Box<Instance> {
|
||
|
let module_str = "(module
|
||
|
(type (;0;) (func (param f32 f32) (result f32)))
|
||
|
(type (;1;) (func (param f64 f64) (result f64)))
|
||
|
(func (;0;) (type 0) (param f32 f32) (result f32)
|
||
|
get_local 0
|
||
|
f32.sqrt
|
||
|
get_local 1
|
||
|
f32.sqrt
|
||
|
f32.mul)
|
||
|
(func (;1;) (type 1) (param f64 f64) (result f64)
|
||
|
get_local 0
|
||
|
f64.sqrt
|
||
|
get_local 1
|
||
|
f64.sqrt
|
||
|
f64.mul)
|
||
|
(export \"f32.no_fold_mul_sqrts\" (func 0))
|
||
|
(export \"f64.no_fold_mul_sqrts\" (func 1)))
|
||
|
";
|
||
|
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_73(instance: &mut Instance) {
|
||
|
// TODO Review is explicit start needed? Start now called in runtime::Instance::new()
|
||
|
//instance.start();
|
||
|
}
|
||
|
|
||
|
// Line 1793
|
||
|
fn c724_l1793_assert_return_canonical_nan(instance: &mut Instance) {
|
||
|
println!("Executing function {}", "c724_l1793_assert_return_canonical_nan");
|
||
|
let result = instance.call("f32.no_fold_mul_sqrts", &[Value::F32((0.000000000000000000000000000000000000043885047f32).to_bits()), Value::F32((-0.00000000000000000000000011867334f32).to_bits())]).unwrap().expect("Missing result in c724_l1793_assert_return_canonical_nan");
|
||
|
assert!(match result {
|
||
|
Value::F32(fp) => f32::from_bits(fp).is_quiet_nan(),
|
||
|
Value::F64(fp) => f64::from_bits(fp).is_quiet_nan(),
|
||
|
_ => unimplemented!()
|
||
|
})
|
||
|
}
|
||
|
|
||
|
// Line 1794
|
||
|
fn c725_l1794_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c725_l1794_action_invoke");
|
||
|
let result = instance.call("f32.no_fold_mul_sqrts", &[Value::F32((0.00000000000000000000000000025365908f32).to_bits()), Value::F32((0.00000000041320675f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((0.00000000000000000032374932f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1795
|
||
|
fn c726_l1795_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c726_l1795_action_invoke");
|
||
|
let result = instance.call("f32.no_fold_mul_sqrts", &[Value::F32((0.0000000000000000000000000042144832f32).to_bits()), Value::F32((97.249115f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((0.00000000000064019905f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1796
|
||
|
fn c727_l1796_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c727_l1796_action_invoke");
|
||
|
let result = instance.call("f32.no_fold_mul_sqrts", &[Value::F32((3724076300000000000000000000000.0f32).to_bits()), Value::F32((0.002944908f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((104723750000000.0f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1797
|
||
|
fn c728_l1797_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c728_l1797_action_invoke");
|
||
|
let result = instance.call("f32.no_fold_mul_sqrts", &[Value::F32((0.00000000000000001866056f32).to_bits()), Value::F32((0.002111261f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((0.00000000019848755f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1799
|
||
|
fn c729_l1799_assert_return_canonical_nan(instance: &mut Instance) {
|
||
|
println!("Executing function {}", "c729_l1799_assert_return_canonical_nan");
|
||
|
let result = instance.call("f64.no_fold_mul_sqrts", &[Value::F64((-0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000012742064369772862f64).to_bits()), Value::F64((-0.006829962938197246f64).to_bits())]).unwrap().expect("Missing result in c729_l1799_assert_return_canonical_nan");
|
||
|
assert!(match result {
|
||
|
Value::F32(fp) => f32::from_bits(fp).is_quiet_nan(),
|
||
|
Value::F64(fp) => f64::from_bits(fp).is_quiet_nan(),
|
||
|
_ => unimplemented!()
|
||
|
})
|
||
|
}
|
||
|
|
||
|
// Line 1800
|
||
|
fn c730_l1800_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c730_l1800_action_invoke");
|
||
|
let result = instance.call("f64.no_fold_mul_sqrts", &[Value::F64((0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000037082569269527534f64).to_bits()), Value::F64((0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000047183002857015043f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000041829020688865954f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1801
|
||
|
fn c731_l1801_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c731_l1801_action_invoke");
|
||
|
let result = instance.call("f64.no_fold_mul_sqrts", &[Value::F64((0.000000000000000000000000002329359505918655f64).to_bits()), Value::F64((0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020743399642806364f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000021981545701574452f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1802
|
||
|
fn c732_l1802_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c732_l1802_action_invoke");
|
||
|
let result = instance.call("f64.no_fold_mul_sqrts", &[Value::F64((0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010541899336289437f64).to_bits()), Value::F64((0.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000598123819872803f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002511047809129887f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1803
|
||
|
fn c733_l1803_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c733_l1803_action_invoke");
|
||
|
let result = instance.call("f64.no_fold_mul_sqrts", &[Value::F64((25589482.717358638f64).to_bits()), Value::F64((39138912071199020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.0f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((1000771959050695500000000000000000000000000000000000000000000000000000000000000000.0f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1807
|
||
|
|
||
|
#[test]
|
||
|
fn test_module_73() {
|
||
|
let mut instance = create_module_73();
|
||
|
// We group the calls together
|
||
|
start_module_73(&mut instance);
|
||
|
c724_l1793_assert_return_canonical_nan(&mut instance);
|
||
|
c725_l1794_action_invoke(&mut instance);
|
||
|
c726_l1795_action_invoke(&mut instance);
|
||
|
c727_l1796_action_invoke(&mut instance);
|
||
|
c728_l1797_action_invoke(&mut instance);
|
||
|
c729_l1799_assert_return_canonical_nan(&mut instance);
|
||
|
c730_l1800_action_invoke(&mut instance);
|
||
|
c731_l1801_action_invoke(&mut instance);
|
||
|
c732_l1802_action_invoke(&mut instance);
|
||
|
c733_l1803_action_invoke(&mut instance);
|
||
|
}
|
||
|
fn create_module_74() -> Box<Instance> {
|
||
|
let module_str = "(module
|
||
|
(type (;0;) (func (param f32 f32) (result f32)))
|
||
|
(type (;1;) (func (param f64 f64) (result f64)))
|
||
|
(func (;0;) (type 0) (param f32 f32) (result f32)
|
||
|
get_local 0
|
||
|
f32.sqrt
|
||
|
get_local 1
|
||
|
f32.sqrt
|
||
|
f32.div)
|
||
|
(func (;1;) (type 1) (param f64 f64) (result f64)
|
||
|
get_local 0
|
||
|
f64.sqrt
|
||
|
get_local 1
|
||
|
f64.sqrt
|
||
|
f64.div)
|
||
|
(export \"f32.no_fold_div_sqrts\" (func 0))
|
||
|
(export \"f64.no_fold_div_sqrts\" (func 1)))
|
||
|
";
|
||
|
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_74(instance: &mut Instance) {
|
||
|
// TODO Review is explicit start needed? Start now called in runtime::Instance::new()
|
||
|
//instance.start();
|
||
|
}
|
||
|
|
||
|
// Line 1815
|
||
|
fn c735_l1815_assert_return_canonical_nan(instance: &mut Instance) {
|
||
|
println!("Executing function {}", "c735_l1815_assert_return_canonical_nan");
|
||
|
let result = instance.call("f32.no_fold_div_sqrts", &[Value::F32((-58545012.0f32).to_bits()), Value::F32((-0.000000000000000006443773f32).to_bits())]).unwrap().expect("Missing result in c735_l1815_assert_return_canonical_nan");
|
||
|
assert!(match result {
|
||
|
Value::F32(fp) => f32::from_bits(fp).is_quiet_nan(),
|
||
|
Value::F64(fp) => f64::from_bits(fp).is_quiet_nan(),
|
||
|
_ => unimplemented!()
|
||
|
})
|
||
|
}
|
||
|
|
||
|
// Line 1816
|
||
|
fn c736_l1816_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c736_l1816_action_invoke");
|
||
|
let result = instance.call("f32.no_fold_div_sqrts", &[Value::F32((7407384000.0f32).to_bits()), Value::F32((209778930.0f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((5.9422584f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1817
|
||
|
fn c737_l1817_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c737_l1817_action_invoke");
|
||
|
let result = instance.call("f32.no_fold_div_sqrts", &[Value::F32((0.0000000000000000000000000000000000013764126f32).to_bits()), Value::F32((54692.9f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((0.0000000000000000000050165927f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1818
|
||
|
fn c738_l1818_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c738_l1818_action_invoke");
|
||
|
let result = instance.call("f32.no_fold_div_sqrts", &[Value::F32((979288960000000000.0f32).to_bits()), Value::F32((0.0000000012643552f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((27830490000000.0f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1819
|
||
|
fn c739_l1819_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c739_l1819_action_invoke");
|
||
|
let result = instance.call("f32.no_fold_div_sqrts", &[Value::F32((0.00000000000000000000000000000000029141283f32).to_bits()), Value::F32((0.00000000000000000000000000000017928174f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((0.04031682f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1821
|
||
|
fn c740_l1821_assert_return_canonical_nan(instance: &mut Instance) {
|
||
|
println!("Executing function {}", "c740_l1821_assert_return_canonical_nan");
|
||
|
let result = instance.call("f64.no_fold_div_sqrts", &[Value::F64((-0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000012206137319883022f64).to_bits()), Value::F64((-0.000000000000000000000000000000000000000000000000000000008209583449676083f64).to_bits())]).unwrap().expect("Missing result in c740_l1821_assert_return_canonical_nan");
|
||
|
assert!(match result {
|
||
|
Value::F32(fp) => f32::from_bits(fp).is_quiet_nan(),
|
||
|
Value::F64(fp) => f64::from_bits(fp).is_quiet_nan(),
|
||
|
_ => unimplemented!()
|
||
|
})
|
||
|
}
|
||
|
|
||
|
// Line 1822
|
||
|
fn c741_l1822_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c741_l1822_action_invoke");
|
||
|
let result = instance.call("f64.no_fold_div_sqrts", &[Value::F64((0.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000033818852462305824f64).to_bits()), Value::F64((7655783976315048000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.0f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000021017671425665687f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1823
|
||
|
fn c742_l1823_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c742_l1823_action_invoke");
|
||
|
let result = instance.call("f64.no_fold_div_sqrts", &[Value::F64((45963335670647510000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.0f64).to_bits()), Value::F64((0.0000000000000000000000000000000023932467846883046f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((138583660172663150000000000000000000000000000000000000000000000000000000000000000000000000000000.0f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1824
|
||
|
fn c743_l1824_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c743_l1824_action_invoke");
|
||
|
let result = instance.call("f64.no_fold_div_sqrts", &[Value::F64((0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000025327340978668086f64).to_bits()), Value::F64((4475305129961258000000000000000000000000000000000000000000000000000000000000000000000000.0f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000023789399141325018f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1825
|
||
|
fn c744_l1825_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c744_l1825_action_invoke");
|
||
|
let result = instance.call("f64.no_fold_div_sqrts", &[Value::F64((0.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000005103070160197939f64).to_bits()), Value::F64((460157669098082500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.0f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((0.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010530826009924495f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1829
|
||
|
|
||
|
#[test]
|
||
|
fn test_module_74() {
|
||
|
let mut instance = create_module_74();
|
||
|
// We group the calls together
|
||
|
start_module_74(&mut instance);
|
||
|
c735_l1815_assert_return_canonical_nan(&mut instance);
|
||
|
c736_l1816_action_invoke(&mut instance);
|
||
|
c737_l1817_action_invoke(&mut instance);
|
||
|
c738_l1818_action_invoke(&mut instance);
|
||
|
c739_l1819_action_invoke(&mut instance);
|
||
|
c740_l1821_assert_return_canonical_nan(&mut instance);
|
||
|
c741_l1822_action_invoke(&mut instance);
|
||
|
c742_l1823_action_invoke(&mut instance);
|
||
|
c743_l1824_action_invoke(&mut instance);
|
||
|
c744_l1825_action_invoke(&mut instance);
|
||
|
}
|
||
|
fn create_module_75() -> Box<Instance> {
|
||
|
let module_str = "(module
|
||
|
(type (;0;) (func (param f32 f32) (result f32)))
|
||
|
(type (;1;) (func (param f64 f64) (result f64)))
|
||
|
(func (;0;) (type 0) (param f32 f32) (result f32)
|
||
|
get_local 0
|
||
|
get_local 1
|
||
|
f32.sqrt
|
||
|
f32.mul
|
||
|
get_local 1
|
||
|
f32.div)
|
||
|
(func (;1;) (type 1) (param f64 f64) (result f64)
|
||
|
get_local 0
|
||
|
get_local 1
|
||
|
f64.sqrt
|
||
|
f64.mul
|
||
|
get_local 1
|
||
|
f64.div)
|
||
|
(export \"f32.no_fold_mul_sqrt_div\" (func 0))
|
||
|
(export \"f64.no_fold_mul_sqrt_div\" (func 1)))
|
||
|
";
|
||
|
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_75(instance: &mut Instance) {
|
||
|
// TODO Review is explicit start needed? Start now called in runtime::Instance::new()
|
||
|
//instance.start();
|
||
|
}
|
||
|
|
||
|
// Line 1837
|
||
|
fn c746_l1837_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c746_l1837_action_invoke");
|
||
|
let result = instance.call("f32.no_fold_mul_sqrt_div", &[Value::F32((-4728556800000000000000000.0f32).to_bits()), Value::F32((8677282000000000000000000000.0f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32(f32::NEG_INFINITY.to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1838
|
||
|
fn c747_l1838_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c747_l1838_action_invoke");
|
||
|
let result = instance.call("f32.no_fold_mul_sqrt_div", &[Value::F32((-0.0000000000000000000000000000000000011776882f32).to_bits()), Value::F32((0.000000000000000000000000000009805153f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((-0.0f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1839
|
||
|
fn c748_l1839_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c748_l1839_action_invoke");
|
||
|
let result = instance.call("f32.no_fold_mul_sqrt_div", &[Value::F32((816717060.0f32).to_bits()), Value::F32((0.000000000000000000000000000000000000003323171f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((14167568000000000000000000000.0f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1840
|
||
|
fn c749_l1840_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c749_l1840_action_invoke");
|
||
|
let result = instance.call("f32.no_fold_mul_sqrt_div", &[Value::F32((-11932267000000.0f32).to_bits()), Value::F32((8637067000000000000000000000000000.0f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((-0.00012839255f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1841
|
||
|
fn c750_l1841_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c750_l1841_action_invoke");
|
||
|
let result = instance.call("f32.no_fold_mul_sqrt_div", &[Value::F32((-401.0235f32).to_bits()), Value::F32((134.33022f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((-34.600548f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1843
|
||
|
fn c751_l1843_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c751_l1843_action_invoke");
|
||
|
let result = instance.call("f64.no_fold_mul_sqrt_div", &[Value::F64((1468134622910490500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.0f64).to_bits()), Value::F64((2466074582285183000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.0f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64(f64::INFINITY.to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1844
|
||
|
fn c752_l1844_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c752_l1844_action_invoke");
|
||
|
let result = instance.call("f64.no_fold_mul_sqrt_div", &[Value::F64((-0.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000017254022016758028f64).to_bits()), Value::F64((0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000055835540747130025f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((-0.0f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1845
|
||
|
fn c753_l1845_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c753_l1845_action_invoke");
|
||
|
let result = instance.call("f64.no_fold_mul_sqrt_div", &[Value::F64((0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000016812810256029166f64).to_bits()), Value::F64((7362783602442129000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.0f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006196112486187196f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1846
|
||
|
fn c754_l1846_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c754_l1846_action_invoke");
|
||
|
let result = instance.call("f64.no_fold_mul_sqrt_div", &[Value::F64((-10605483729939836000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.0f64).to_bits()), Value::F64((0.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000622591783694072f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((-42503900822233765000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.0f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1847
|
||
|
fn c755_l1847_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c755_l1847_action_invoke");
|
||
|
let result = instance.call("f64.no_fold_mul_sqrt_div", &[Value::F64((26336349695373093000000000000000.0f64).to_bits()), Value::F64((30791413285853300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.0f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004746142447510695f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1852
|
||
|
|
||
|
#[test]
|
||
|
fn test_module_75() {
|
||
|
let mut instance = create_module_75();
|
||
|
// We group the calls together
|
||
|
start_module_75(&mut instance);
|
||
|
c746_l1837_action_invoke(&mut instance);
|
||
|
c747_l1838_action_invoke(&mut instance);
|
||
|
c748_l1839_action_invoke(&mut instance);
|
||
|
c749_l1840_action_invoke(&mut instance);
|
||
|
c750_l1841_action_invoke(&mut instance);
|
||
|
c751_l1843_action_invoke(&mut instance);
|
||
|
c752_l1844_action_invoke(&mut instance);
|
||
|
c753_l1845_action_invoke(&mut instance);
|
||
|
c754_l1846_action_invoke(&mut instance);
|
||
|
c755_l1847_action_invoke(&mut instance);
|
||
|
}
|
||
|
fn create_module_76() -> Box<Instance> {
|
||
|
let module_str = "(module
|
||
|
(type (;0;) (func (param f32 f32 f32) (result f32)))
|
||
|
(type (;1;) (func (param f64 f64 f64) (result f64)))
|
||
|
(func (;0;) (type 0) (param f32 f32 f32) (result f32)
|
||
|
get_local 0
|
||
|
get_local 1
|
||
|
f32.mul
|
||
|
get_local 2
|
||
|
f32.mul)
|
||
|
(func (;1;) (type 1) (param f64 f64 f64) (result f64)
|
||
|
get_local 0
|
||
|
get_local 1
|
||
|
f64.mul
|
||
|
get_local 2
|
||
|
f64.mul)
|
||
|
(export \"f32.no_flush_intermediate_subnormal\" (func 0))
|
||
|
(export \"f64.no_flush_intermediate_subnormal\" (func 1)))
|
||
|
";
|
||
|
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_76(instance: &mut Instance) {
|
||
|
// TODO Review is explicit start needed? Start now called in runtime::Instance::new()
|
||
|
//instance.start();
|
||
|
}
|
||
|
|
||
|
// Line 1860
|
||
|
fn c757_l1860_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c757_l1860_action_invoke");
|
||
|
let result = instance.call("f32.no_flush_intermediate_subnormal", &[Value::F32((0.000000000000000000000000000000000000011754944f32).to_bits()), Value::F32((0.00000011920929f32).to_bits()), Value::F32((8388608.0f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((0.000000000000000000000000000000000000011754944f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1861
|
||
|
fn c758_l1861_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c758_l1861_action_invoke");
|
||
|
let result = instance.call("f64.no_flush_intermediate_subnormal", &[Value::F64((0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000022250738585072014f64).to_bits()), Value::F64((0.0000000000000002220446049250313f64).to_bits()), Value::F64((4503599627370496.0f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000022250738585072014f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1866
|
||
|
|
||
|
#[test]
|
||
|
fn test_module_76() {
|
||
|
let mut instance = create_module_76();
|
||
|
// We group the calls together
|
||
|
start_module_76(&mut instance);
|
||
|
c757_l1860_action_invoke(&mut instance);
|
||
|
c758_l1861_action_invoke(&mut instance);
|
||
|
}
|
||
|
fn create_module_77() -> Box<Instance> {
|
||
|
let module_str = "(module
|
||
|
(type (;0;) (func (param f32 f32) (result i32)))
|
||
|
(type (;1;) (func (param f64 f64) (result i32)))
|
||
|
(type (;2;) (func (param f64 f32) (result f32)))
|
||
|
(func (;0;) (type 0) (param f32 f32) (result i32)
|
||
|
get_local 0
|
||
|
get_local 1
|
||
|
f32.mul
|
||
|
get_local 0
|
||
|
f32.eq)
|
||
|
(func (;1;) (type 0) (param f32 f32) (result i32)
|
||
|
get_local 0
|
||
|
get_local 1
|
||
|
f32.mul
|
||
|
get_local 0
|
||
|
f32.le)
|
||
|
(func (;2;) (type 0) (param f32 f32) (result i32)
|
||
|
get_local 0
|
||
|
get_local 1
|
||
|
f32.mul
|
||
|
get_local 0
|
||
|
f32.lt)
|
||
|
(func (;3;) (type 1) (param f64 f64) (result i32)
|
||
|
get_local 0
|
||
|
get_local 1
|
||
|
f64.mul
|
||
|
get_local 0
|
||
|
f64.eq)
|
||
|
(func (;4;) (type 1) (param f64 f64) (result i32)
|
||
|
get_local 0
|
||
|
get_local 1
|
||
|
f64.mul
|
||
|
get_local 0
|
||
|
f64.le)
|
||
|
(func (;5;) (type 1) (param f64 f64) (result i32)
|
||
|
get_local 0
|
||
|
get_local 1
|
||
|
f64.mul
|
||
|
get_local 0
|
||
|
f64.lt)
|
||
|
(func (;6;) (type 2) (param f64 f32) (result f32)
|
||
|
get_local 0
|
||
|
f32.demote/f64
|
||
|
get_local 1
|
||
|
f32.mul)
|
||
|
(export \"f32.recoding_eq\" (func 0))
|
||
|
(export \"f32.recoding_le\" (func 1))
|
||
|
(export \"f32.recoding_lt\" (func 2))
|
||
|
(export \"f64.recoding_eq\" (func 3))
|
||
|
(export \"f64.recoding_le\" (func 4))
|
||
|
(export \"f64.recoding_lt\" (func 5))
|
||
|
(export \"recoding_demote\" (func 6)))
|
||
|
";
|
||
|
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_77(instance: &mut Instance) {
|
||
|
// TODO Review is explicit start needed? Start now called in runtime::Instance::new()
|
||
|
//instance.start();
|
||
|
}
|
||
|
|
||
|
// Line 1889
|
||
|
fn c760_l1889_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c760_l1889_action_invoke");
|
||
|
let result = instance.call("f32.recoding_eq", &[Value::F32(f32::NEG_INFINITY.to_bits()), Value::F32((3.0f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::I32(1 as i32))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1890
|
||
|
fn c761_l1890_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c761_l1890_action_invoke");
|
||
|
let result = instance.call("f32.recoding_le", &[Value::F32(f32::NEG_INFINITY.to_bits()), Value::F32((3.0f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::I32(1 as i32))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1891
|
||
|
fn c762_l1891_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c762_l1891_action_invoke");
|
||
|
let result = instance.call("f32.recoding_lt", &[Value::F32(f32::NEG_INFINITY.to_bits()), Value::F32((3.0f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::I32(0 as i32))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1893
|
||
|
fn c763_l1893_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c763_l1893_action_invoke");
|
||
|
let result = instance.call("f32.recoding_eq", &[Value::F32((0.0f32).to_bits()), Value::F32((1.0f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::I32(1 as i32))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1894
|
||
|
fn c764_l1894_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c764_l1894_action_invoke");
|
||
|
let result = instance.call("f32.recoding_le", &[Value::F32((0.0f32).to_bits()), Value::F32((1.0f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::I32(1 as i32))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1895
|
||
|
fn c765_l1895_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c765_l1895_action_invoke");
|
||
|
let result = instance.call("f32.recoding_lt", &[Value::F32((0.0f32).to_bits()), Value::F32((1.0f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::I32(0 as i32))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1897
|
||
|
fn c766_l1897_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c766_l1897_action_invoke");
|
||
|
let result = instance.call("f64.recoding_eq", &[Value::F64(f64::NEG_INFINITY.to_bits()), Value::F64((3.0f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::I32(1 as i32))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1898
|
||
|
fn c767_l1898_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c767_l1898_action_invoke");
|
||
|
let result = instance.call("f64.recoding_le", &[Value::F64(f64::NEG_INFINITY.to_bits()), Value::F64((3.0f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::I32(1 as i32))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1899
|
||
|
fn c768_l1899_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c768_l1899_action_invoke");
|
||
|
let result = instance.call("f64.recoding_lt", &[Value::F64(f64::NEG_INFINITY.to_bits()), Value::F64((3.0f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::I32(0 as i32))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1901
|
||
|
fn c769_l1901_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c769_l1901_action_invoke");
|
||
|
let result = instance.call("f64.recoding_eq", &[Value::F64((0.0f64).to_bits()), Value::F64((1.0f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::I32(1 as i32))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1902
|
||
|
fn c770_l1902_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c770_l1902_action_invoke");
|
||
|
let result = instance.call("f64.recoding_le", &[Value::F64((0.0f64).to_bits()), Value::F64((1.0f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::I32(1 as i32))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1903
|
||
|
fn c771_l1903_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c771_l1903_action_invoke");
|
||
|
let result = instance.call("f64.recoding_lt", &[Value::F64((0.0f64).to_bits()), Value::F64((1.0f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::I32(0 as i32))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1905
|
||
|
fn c772_l1905_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c772_l1905_action_invoke");
|
||
|
let result = instance.call("recoding_demote", &[Value::F64((0.00000000000000000000000000000000000000023860049081905093f64).to_bits()), Value::F32((1221.0f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((0.0000000000000000000000000000000000002913312f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1910
|
||
|
|
||
|
#[test]
|
||
|
fn test_module_77() {
|
||
|
let mut instance = create_module_77();
|
||
|
// We group the calls together
|
||
|
start_module_77(&mut instance);
|
||
|
c760_l1889_action_invoke(&mut instance);
|
||
|
c761_l1890_action_invoke(&mut instance);
|
||
|
c762_l1891_action_invoke(&mut instance);
|
||
|
c763_l1893_action_invoke(&mut instance);
|
||
|
c764_l1894_action_invoke(&mut instance);
|
||
|
c765_l1895_action_invoke(&mut instance);
|
||
|
c766_l1897_action_invoke(&mut instance);
|
||
|
c767_l1898_action_invoke(&mut instance);
|
||
|
c768_l1899_action_invoke(&mut instance);
|
||
|
c769_l1901_action_invoke(&mut instance);
|
||
|
c770_l1902_action_invoke(&mut instance);
|
||
|
c771_l1903_action_invoke(&mut instance);
|
||
|
c772_l1905_action_invoke(&mut instance);
|
||
|
}
|
||
|
fn create_module_78() -> Box<Instance> {
|
||
|
let module_str = "(module
|
||
|
(type (;0;) (func (param f32 f32 f32) (result i32)))
|
||
|
(type (;1;) (func (param f64 f64 f64) (result i32)))
|
||
|
(func (;0;) (type 0) (param f32 f32 f32) (result i32)
|
||
|
get_local 0
|
||
|
get_local 1
|
||
|
f32.div
|
||
|
get_local 2
|
||
|
f32.eq)
|
||
|
(func (;1;) (type 1) (param f64 f64 f64) (result i32)
|
||
|
get_local 0
|
||
|
get_local 1
|
||
|
f64.div
|
||
|
get_local 2
|
||
|
f64.eq)
|
||
|
(export \"f32.no_extended_precision_div\" (func 0))
|
||
|
(export \"f64.no_extended_precision_div\" (func 1)))
|
||
|
";
|
||
|
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_78(instance: &mut Instance) {
|
||
|
// TODO Review is explicit start needed? Start now called in runtime::Instance::new()
|
||
|
//instance.start();
|
||
|
}
|
||
|
|
||
|
// Line 1918
|
||
|
fn c774_l1918_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c774_l1918_action_invoke");
|
||
|
let result = instance.call("f32.no_extended_precision_div", &[Value::F32((3.0f32).to_bits()), Value::F32((7.0f32).to_bits()), Value::F32((0.42857143f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::I32(1 as i32))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1919
|
||
|
fn c775_l1919_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c775_l1919_action_invoke");
|
||
|
let result = instance.call("f64.no_extended_precision_div", &[Value::F64((3.0f64).to_bits()), Value::F64((7.0f64).to_bits()), Value::F64((0.42857142857142855f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::I32(1 as i32))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1926
|
||
|
|
||
|
#[test]
|
||
|
fn test_module_78() {
|
||
|
let mut instance = create_module_78();
|
||
|
// We group the calls together
|
||
|
start_module_78(&mut instance);
|
||
|
c774_l1918_action_invoke(&mut instance);
|
||
|
c775_l1919_action_invoke(&mut instance);
|
||
|
}
|
||
|
fn create_module_79() -> Box<Instance> {
|
||
|
let module_str = "(module
|
||
|
(type (;0;) (func (param f32) (result f32)))
|
||
|
(type (;1;) (func (param f64) (result f64)))
|
||
|
(func (;0;) (type 0) (param f32) (result f32)
|
||
|
f32.const -0x1p+3 (;=-8;)
|
||
|
get_local 0
|
||
|
f32.mul
|
||
|
f32.const 0x1p+3 (;=8;)
|
||
|
get_local 0
|
||
|
f32.mul
|
||
|
f32.add)
|
||
|
(func (;1;) (type 1) (param f64) (result f64)
|
||
|
f64.const -0x1p+3 (;=-8;)
|
||
|
get_local 0
|
||
|
f64.mul
|
||
|
f64.const 0x1p+3 (;=8;)
|
||
|
get_local 0
|
||
|
f64.mul
|
||
|
f64.add)
|
||
|
(export \"f32.no_distribute_exact\" (func 0))
|
||
|
(export \"f64.no_distribute_exact\" (func 1)))
|
||
|
";
|
||
|
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_79(instance: &mut Instance) {
|
||
|
// TODO Review is explicit start needed? Start now called in runtime::Instance::new()
|
||
|
//instance.start();
|
||
|
}
|
||
|
|
||
|
// Line 1934
|
||
|
fn c777_l1934_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c777_l1934_action_invoke");
|
||
|
let result = instance.call("f32.no_distribute_exact", &[Value::F32((-0.0f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((0.0f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1935
|
||
|
fn c778_l1935_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c778_l1935_action_invoke");
|
||
|
let result = instance.call("f64.no_distribute_exact", &[Value::F64((-0.0f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((0.0f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1940
|
||
|
|
||
|
#[test]
|
||
|
fn test_module_79() {
|
||
|
let mut instance = create_module_79();
|
||
|
// We group the calls together
|
||
|
start_module_79(&mut instance);
|
||
|
c777_l1934_action_invoke(&mut instance);
|
||
|
c778_l1935_action_invoke(&mut instance);
|
||
|
}
|
||
|
fn create_module_80() -> Box<Instance> {
|
||
|
let module_str = "(module
|
||
|
(type (;0;) (func (param f32) (result f32)))
|
||
|
(type (;1;) (func (param f32 f32 f32 f32) (result f32)))
|
||
|
(type (;2;) (func (param f32 f32 f32) (result f32)))
|
||
|
(type (;3;) (func (param f64) (result f64)))
|
||
|
(type (;4;) (func (param f64 f64 f64 f64) (result f64)))
|
||
|
(type (;5;) (func (param f64 f64 f64) (result f64)))
|
||
|
(func (;0;) (type 0) (param f32) (result f32)
|
||
|
get_local 0
|
||
|
f32.sqrt)
|
||
|
(func (;1;) (type 1) (param f32 f32 f32 f32) (result f32)
|
||
|
get_local 0
|
||
|
get_local 1
|
||
|
f32.div
|
||
|
get_local 2
|
||
|
get_local 3
|
||
|
get_local 2
|
||
|
f32.sub
|
||
|
f32.div
|
||
|
f32.add)
|
||
|
(func (;2;) (type 2) (param f32 f32 f32) (result f32)
|
||
|
get_local 0
|
||
|
get_local 1
|
||
|
f32.mul
|
||
|
get_local 2
|
||
|
f32.div)
|
||
|
(func (;3;) (type 2) (param f32 f32 f32) (result f32)
|
||
|
get_local 0
|
||
|
get_local 1
|
||
|
f32.div
|
||
|
get_local 2
|
||
|
get_local 0
|
||
|
f32.div
|
||
|
f32.add)
|
||
|
(func (;4;) (type 1) (param f32 f32 f32 f32) (result f32)
|
||
|
get_local 0
|
||
|
get_local 1
|
||
|
get_local 2
|
||
|
f32.mul
|
||
|
f32.add
|
||
|
get_local 3
|
||
|
get_local 1
|
||
|
get_local 2
|
||
|
f32.mul
|
||
|
f32.sub
|
||
|
f32.div)
|
||
|
(func (;5;) (type 3) (param f64) (result f64)
|
||
|
get_local 0
|
||
|
f64.sqrt)
|
||
|
(func (;6;) (type 4) (param f64 f64 f64 f64) (result f64)
|
||
|
get_local 0
|
||
|
get_local 1
|
||
|
f64.div
|
||
|
get_local 2
|
||
|
get_local 3
|
||
|
get_local 2
|
||
|
f64.sub
|
||
|
f64.div
|
||
|
f64.add)
|
||
|
(func (;7;) (type 5) (param f64 f64 f64) (result f64)
|
||
|
get_local 0
|
||
|
get_local 1
|
||
|
f64.mul
|
||
|
get_local 2
|
||
|
f64.div)
|
||
|
(func (;8;) (type 5) (param f64 f64 f64) (result f64)
|
||
|
get_local 0
|
||
|
get_local 1
|
||
|
f64.div
|
||
|
get_local 2
|
||
|
get_local 0
|
||
|
f64.div
|
||
|
f64.add)
|
||
|
(func (;9;) (type 4) (param f64 f64 f64 f64) (result f64)
|
||
|
get_local 0
|
||
|
get_local 1
|
||
|
get_local 2
|
||
|
f64.mul
|
||
|
f64.add
|
||
|
get_local 3
|
||
|
get_local 1
|
||
|
get_local 2
|
||
|
f64.mul
|
||
|
f64.sub
|
||
|
f64.div)
|
||
|
(export \"f32.sqrt\" (func 0))
|
||
|
(export \"f32.xkcd_sqrt_2\" (func 1))
|
||
|
(export \"f32.xkcd_sqrt_3\" (func 2))
|
||
|
(export \"f32.xkcd_sqrt_5\" (func 3))
|
||
|
(export \"f32.xkcd_better_sqrt_5\" (func 4))
|
||
|
(export \"f64.sqrt\" (func 5))
|
||
|
(export \"f64.xkcd_sqrt_2\" (func 6))
|
||
|
(export \"f64.xkcd_sqrt_3\" (func 7))
|
||
|
(export \"f64.xkcd_sqrt_5\" (func 8))
|
||
|
(export \"f64.xkcd_better_sqrt_5\" (func 9)))
|
||
|
";
|
||
|
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_80(instance: &mut Instance) {
|
||
|
// TODO Review is explicit start needed? Start now called in runtime::Instance::new()
|
||
|
//instance.start();
|
||
|
}
|
||
|
|
||
|
// Line 1972
|
||
|
fn c780_l1972_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c780_l1972_action_invoke");
|
||
|
let result = instance.call("f32.sqrt", &[Value::F32((2.0f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((1.4142135f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1973
|
||
|
fn c781_l1973_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c781_l1973_action_invoke");
|
||
|
let result = instance.call("f32.xkcd_sqrt_2", &[Value::F32((3.0f32).to_bits()), Value::F32((5.0f32).to_bits()), Value::F32((3.1415927f32).to_bits()), Value::F32((7.0f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((1.4142201f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1974
|
||
|
fn c782_l1974_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c782_l1974_action_invoke");
|
||
|
let result = instance.call("f32.sqrt", &[Value::F32((3.0f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((1.7320508f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1975
|
||
|
fn c783_l1975_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c783_l1975_action_invoke");
|
||
|
let result = instance.call("f32.xkcd_sqrt_3", &[Value::F32((2.0f32).to_bits()), Value::F32((2.7182817f32).to_bits()), Value::F32((3.1415927f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((1.7305119f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1976
|
||
|
fn c784_l1976_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c784_l1976_action_invoke");
|
||
|
let result = instance.call("f32.sqrt", &[Value::F32((5.0f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((2.236068f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1977
|
||
|
fn c785_l1977_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c785_l1977_action_invoke");
|
||
|
let result = instance.call("f32.xkcd_sqrt_5", &[Value::F32((2.0f32).to_bits()), Value::F32((2.7182817f32).to_bits()), Value::F32((3.0f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((2.2357588f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1978
|
||
|
fn c786_l1978_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c786_l1978_action_invoke");
|
||
|
let result = instance.call("f32.xkcd_better_sqrt_5", &[Value::F32((13.0f32).to_bits()), Value::F32((4.0f32).to_bits()), Value::F32((3.1415927f32).to_bits()), Value::F32((24.0f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((2.236068f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1980
|
||
|
fn c787_l1980_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c787_l1980_action_invoke");
|
||
|
let result = instance.call("f64.sqrt", &[Value::F64((2.0f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((1.4142135623730951f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1981
|
||
|
fn c788_l1981_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c788_l1981_action_invoke");
|
||
|
let result = instance.call("f64.xkcd_sqrt_2", &[Value::F64((3.0f64).to_bits()), Value::F64((5.0f64).to_bits()), Value::F64((3.141592653589793f64).to_bits()), Value::F64((7.0f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((1.4142200580539208f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1982
|
||
|
fn c789_l1982_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c789_l1982_action_invoke");
|
||
|
let result = instance.call("f64.sqrt", &[Value::F64((3.0f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((1.7320508075688772f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1983
|
||
|
fn c790_l1983_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c790_l1983_action_invoke");
|
||
|
let result = instance.call("f64.xkcd_sqrt_3", &[Value::F64((2.0f64).to_bits()), Value::F64((2.718281828459045f64).to_bits()), Value::F64((3.141592653589793f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((1.7305119588645301f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1984
|
||
|
fn c791_l1984_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c791_l1984_action_invoke");
|
||
|
let result = instance.call("f64.sqrt", &[Value::F64((5.0f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((2.23606797749979f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1985
|
||
|
fn c792_l1985_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c792_l1985_action_invoke");
|
||
|
let result = instance.call("f64.xkcd_sqrt_5", &[Value::F64((2.0f64).to_bits()), Value::F64((2.718281828459045f64).to_bits()), Value::F64((3.0f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((2.2357588823428847f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1986
|
||
|
fn c793_l1986_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c793_l1986_action_invoke");
|
||
|
let result = instance.call("f64.xkcd_better_sqrt_5", &[Value::F64((13.0f64).to_bits()), Value::F64((4.0f64).to_bits()), Value::F64((3.141592653589793f64).to_bits()), Value::F64((24.0f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((2.2360678094452893f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 1991
|
||
|
|
||
|
#[test]
|
||
|
fn test_module_80() {
|
||
|
let mut instance = create_module_80();
|
||
|
// We group the calls together
|
||
|
start_module_80(&mut instance);
|
||
|
c780_l1972_action_invoke(&mut instance);
|
||
|
c781_l1973_action_invoke(&mut instance);
|
||
|
c782_l1974_action_invoke(&mut instance);
|
||
|
c783_l1975_action_invoke(&mut instance);
|
||
|
c784_l1976_action_invoke(&mut instance);
|
||
|
c785_l1977_action_invoke(&mut instance);
|
||
|
c786_l1978_action_invoke(&mut instance);
|
||
|
c787_l1980_action_invoke(&mut instance);
|
||
|
c788_l1981_action_invoke(&mut instance);
|
||
|
c789_l1982_action_invoke(&mut instance);
|
||
|
c790_l1983_action_invoke(&mut instance);
|
||
|
c791_l1984_action_invoke(&mut instance);
|
||
|
c792_l1985_action_invoke(&mut instance);
|
||
|
c793_l1986_action_invoke(&mut instance);
|
||
|
}
|
||
|
fn create_module_81() -> Box<Instance> {
|
||
|
let module_str = "(module
|
||
|
(type (;0;) (func (param f32 f32) (result f32)))
|
||
|
(type (;1;) (func (param f64 f64) (result f64)))
|
||
|
(func (;0;) (type 0) (param f32 f32) (result f32)
|
||
|
loop ;; label = @1
|
||
|
get_local 0
|
||
|
get_local 0
|
||
|
f32.add
|
||
|
tee_local 0
|
||
|
f32.const 0x1p+0 (;=1;)
|
||
|
f32.add
|
||
|
get_local 0
|
||
|
f32.sub
|
||
|
f32.const -0x1p+0 (;=-1;)
|
||
|
f32.add
|
||
|
f32.const 0x0p+0 (;=0;)
|
||
|
f32.eq
|
||
|
br_if 0 (;@1;)
|
||
|
end
|
||
|
loop ;; label = @1
|
||
|
get_local 0
|
||
|
get_local 1
|
||
|
f32.const 0x1p+0 (;=1;)
|
||
|
f32.add
|
||
|
tee_local 1
|
||
|
f32.add
|
||
|
get_local 0
|
||
|
f32.sub
|
||
|
get_local 1
|
||
|
f32.sub
|
||
|
f32.const 0x0p+0 (;=0;)
|
||
|
f32.ne
|
||
|
br_if 0 (;@1;)
|
||
|
end
|
||
|
get_local 1)
|
||
|
(func (;1;) (type 1) (param f64 f64) (result f64)
|
||
|
loop ;; label = @1
|
||
|
get_local 0
|
||
|
get_local 0
|
||
|
f64.add
|
||
|
tee_local 0
|
||
|
f64.const 0x1p+0 (;=1;)
|
||
|
f64.add
|
||
|
get_local 0
|
||
|
f64.sub
|
||
|
f64.const -0x1p+0 (;=-1;)
|
||
|
f64.add
|
||
|
f64.const 0x0p+0 (;=0;)
|
||
|
f64.eq
|
||
|
br_if 0 (;@1;)
|
||
|
end
|
||
|
loop ;; label = @1
|
||
|
get_local 0
|
||
|
get_local 1
|
||
|
f64.const 0x1p+0 (;=1;)
|
||
|
f64.add
|
||
|
tee_local 1
|
||
|
f64.add
|
||
|
get_local 0
|
||
|
f64.sub
|
||
|
get_local 1
|
||
|
f64.sub
|
||
|
f64.const 0x0p+0 (;=0;)
|
||
|
f64.ne
|
||
|
br_if 0 (;@1;)
|
||
|
end
|
||
|
get_local 1)
|
||
|
(export \"f32.compute_radix\" (func 0))
|
||
|
(export \"f64.compute_radix\" (func 1)))
|
||
|
";
|
||
|
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_81(instance: &mut Instance) {
|
||
|
// TODO Review is explicit start needed? Start now called in runtime::Instance::new()
|
||
|
//instance.start();
|
||
|
}
|
||
|
|
||
|
// Line 2069
|
||
|
fn c795_l2069_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c795_l2069_action_invoke");
|
||
|
let result = instance.call("f32.compute_radix", &[Value::F32((1.0f32).to_bits()), Value::F32((1.0f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((2.0f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 2070
|
||
|
fn c796_l2070_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c796_l2070_action_invoke");
|
||
|
let result = instance.call("f64.compute_radix", &[Value::F64((1.0f64).to_bits()), Value::F64((1.0f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((2.0f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 2075
|
||
|
|
||
|
#[test]
|
||
|
fn test_module_81() {
|
||
|
let mut instance = create_module_81();
|
||
|
// We group the calls together
|
||
|
start_module_81(&mut instance);
|
||
|
c795_l2069_action_invoke(&mut instance);
|
||
|
c796_l2070_action_invoke(&mut instance);
|
||
|
}
|
||
|
fn create_module_82() -> Box<Instance> {
|
||
|
let module_str = "(module
|
||
|
(type (;0;) (func (param f32 f32) (result f32)))
|
||
|
(type (;1;) (func (param f64 f64) (result f64)))
|
||
|
(func (;0;) (type 0) (param f32 f32) (result f32)
|
||
|
get_local 0
|
||
|
f32.const 0x1p+0 (;=1;)
|
||
|
f32.sub
|
||
|
get_local 1
|
||
|
f32.mul
|
||
|
get_local 1
|
||
|
f32.add)
|
||
|
(func (;1;) (type 1) (param f64 f64) (result f64)
|
||
|
get_local 0
|
||
|
f64.const 0x1p+0 (;=1;)
|
||
|
f64.sub
|
||
|
get_local 1
|
||
|
f64.mul
|
||
|
get_local 1
|
||
|
f64.add)
|
||
|
(export \"f32.no_fold_sub1_mul_add\" (func 0))
|
||
|
(export \"f64.no_fold_sub1_mul_add\" (func 1)))
|
||
|
";
|
||
|
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_82(instance: &mut Instance) {
|
||
|
// TODO Review is explicit start needed? Start now called in runtime::Instance::new()
|
||
|
//instance.start();
|
||
|
}
|
||
|
|
||
|
// Line 2083
|
||
|
fn c798_l2083_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c798_l2083_action_invoke");
|
||
|
let result = instance.call("f32.no_fold_sub1_mul_add", &[Value::F32((0.00000000023283064f32).to_bits()), Value::F32((1.0f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((0.0f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 2084
|
||
|
fn c799_l2084_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c799_l2084_action_invoke");
|
||
|
let result = instance.call("f64.no_fold_sub1_mul_add", &[Value::F64((0.00000000000000000005421010862427522f64).to_bits()), Value::F64((1.0f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((0.0f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 2089
|
||
|
|
||
|
#[test]
|
||
|
fn test_module_82() {
|
||
|
let mut instance = create_module_82();
|
||
|
// We group the calls together
|
||
|
start_module_82(&mut instance);
|
||
|
c798_l2083_action_invoke(&mut instance);
|
||
|
c799_l2084_action_invoke(&mut instance);
|
||
|
}
|
||
|
fn create_module_83() -> Box<Instance> {
|
||
|
let module_str = "(module
|
||
|
(type (;0;) (func (param f32 f32 f32) (result i32)))
|
||
|
(type (;1;) (func (param f64 f64 f64) (result i32)))
|
||
|
(func (;0;) (type 0) (param f32 f32 f32) (result i32)
|
||
|
get_local 0
|
||
|
get_local 2
|
||
|
f32.add
|
||
|
get_local 1
|
||
|
get_local 2
|
||
|
f32.add
|
||
|
f32.le)
|
||
|
(func (;1;) (type 0) (param f32 f32 f32) (result i32)
|
||
|
get_local 0
|
||
|
get_local 2
|
||
|
f32.add
|
||
|
get_local 1
|
||
|
get_local 2
|
||
|
f32.add
|
||
|
f32.ge)
|
||
|
(func (;2;) (type 1) (param f64 f64 f64) (result i32)
|
||
|
get_local 0
|
||
|
get_local 2
|
||
|
f64.add
|
||
|
get_local 1
|
||
|
get_local 2
|
||
|
f64.add
|
||
|
f64.le)
|
||
|
(func (;3;) (type 1) (param f64 f64 f64) (result i32)
|
||
|
get_local 0
|
||
|
get_local 2
|
||
|
f64.add
|
||
|
get_local 1
|
||
|
get_local 2
|
||
|
f64.add
|
||
|
f64.ge)
|
||
|
(export \"f32.no_fold_add_le_monotonicity\" (func 0))
|
||
|
(export \"f32.no_fold_add_ge_monotonicity\" (func 1))
|
||
|
(export \"f64.no_fold_add_le_monotonicity\" (func 2))
|
||
|
(export \"f64.no_fold_add_ge_monotonicity\" (func 3)))
|
||
|
";
|
||
|
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_83(instance: &mut Instance) {
|
||
|
// TODO Review is explicit start needed? Start now called in runtime::Instance::new()
|
||
|
//instance.start();
|
||
|
}
|
||
|
|
||
|
// Line 2103
|
||
|
fn c801_l2103_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c801_l2103_action_invoke");
|
||
|
let result = instance.call("f32.no_fold_add_le_monotonicity", &[Value::F32((0.0f32).to_bits()), Value::F32((0.0f32).to_bits()), Value::F32(f32::from_bits(2143289344) as u32)]);
|
||
|
assert_eq!(result, Ok(Some(Value::I32(0 as i32))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 2104
|
||
|
fn c802_l2104_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c802_l2104_action_invoke");
|
||
|
let result = instance.call("f32.no_fold_add_le_monotonicity", &[Value::F32(f32::INFINITY.to_bits()), Value::F32(f32::NEG_INFINITY.to_bits()), Value::F32(f32::INFINITY.to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::I32(0 as i32))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 2105
|
||
|
fn c803_l2105_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c803_l2105_action_invoke");
|
||
|
let result = instance.call("f64.no_fold_add_le_monotonicity", &[Value::F64((0.0f64).to_bits()), Value::F64((0.0f64).to_bits()), Value::F64(f64::from_bits(9221120237041090560) as u64)]);
|
||
|
assert_eq!(result, Ok(Some(Value::I32(0 as i32))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 2106
|
||
|
fn c804_l2106_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c804_l2106_action_invoke");
|
||
|
let result = instance.call("f64.no_fold_add_le_monotonicity", &[Value::F64(f64::INFINITY.to_bits()), Value::F64(f64::NEG_INFINITY.to_bits()), Value::F64(f64::INFINITY.to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::I32(0 as i32))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 2110
|
||
|
|
||
|
#[test]
|
||
|
fn test_module_83() {
|
||
|
let mut instance = create_module_83();
|
||
|
// We group the calls together
|
||
|
start_module_83(&mut instance);
|
||
|
c801_l2103_action_invoke(&mut instance);
|
||
|
c802_l2104_action_invoke(&mut instance);
|
||
|
c803_l2105_action_invoke(&mut instance);
|
||
|
c804_l2106_action_invoke(&mut instance);
|
||
|
}
|
||
|
fn create_module_84() -> Box<Instance> {
|
||
|
let module_str = "(module
|
||
|
(type (;0;) (func (param f32 f32) (result i32)))
|
||
|
(type (;1;) (func (param f64 f64) (result i32)))
|
||
|
(func (;0;) (type 0) (param f32 f32) (result i32)
|
||
|
get_local 0
|
||
|
get_local 1
|
||
|
f32.lt
|
||
|
i32.eqz)
|
||
|
(func (;1;) (type 0) (param f32 f32) (result i32)
|
||
|
get_local 0
|
||
|
get_local 1
|
||
|
f32.le
|
||
|
i32.eqz)
|
||
|
(func (;2;) (type 0) (param f32 f32) (result i32)
|
||
|
get_local 0
|
||
|
get_local 1
|
||
|
f32.gt
|
||
|
i32.eqz)
|
||
|
(func (;3;) (type 0) (param f32 f32) (result i32)
|
||
|
get_local 0
|
||
|
get_local 1
|
||
|
f32.ge
|
||
|
i32.eqz)
|
||
|
(func (;4;) (type 1) (param f64 f64) (result i32)
|
||
|
get_local 0
|
||
|
get_local 1
|
||
|
f64.lt
|
||
|
i32.eqz)
|
||
|
(func (;5;) (type 1) (param f64 f64) (result i32)
|
||
|
get_local 0
|
||
|
get_local 1
|
||
|
f64.le
|
||
|
i32.eqz)
|
||
|
(func (;6;) (type 1) (param f64 f64) (result i32)
|
||
|
get_local 0
|
||
|
get_local 1
|
||
|
f64.gt
|
||
|
i32.eqz)
|
||
|
(func (;7;) (type 1) (param f64 f64) (result i32)
|
||
|
get_local 0
|
||
|
get_local 1
|
||
|
f64.ge
|
||
|
i32.eqz)
|
||
|
(export \"f32.not_lt\" (func 0))
|
||
|
(export \"f32.not_le\" (func 1))
|
||
|
(export \"f32.not_gt\" (func 2))
|
||
|
(export \"f32.not_ge\" (func 3))
|
||
|
(export \"f64.not_lt\" (func 4))
|
||
|
(export \"f64.not_le\" (func 5))
|
||
|
(export \"f64.not_gt\" (func 6))
|
||
|
(export \"f64.not_ge\" (func 7)))
|
||
|
";
|
||
|
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_84(instance: &mut Instance) {
|
||
|
// TODO Review is explicit start needed? Start now called in runtime::Instance::new()
|
||
|
//instance.start();
|
||
|
}
|
||
|
|
||
|
// Line 2136
|
||
|
fn c806_l2136_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c806_l2136_action_invoke");
|
||
|
let result = instance.call("f32.not_lt", &[Value::F32(f32::from_bits(2143289344) as u32), Value::F32((0.0f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::I32(1 as i32))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 2137
|
||
|
fn c807_l2137_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c807_l2137_action_invoke");
|
||
|
let result = instance.call("f32.not_le", &[Value::F32(f32::from_bits(2143289344) as u32), Value::F32((0.0f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::I32(1 as i32))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 2138
|
||
|
fn c808_l2138_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c808_l2138_action_invoke");
|
||
|
let result = instance.call("f32.not_gt", &[Value::F32(f32::from_bits(2143289344) as u32), Value::F32((0.0f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::I32(1 as i32))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 2139
|
||
|
fn c809_l2139_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c809_l2139_action_invoke");
|
||
|
let result = instance.call("f32.not_ge", &[Value::F32(f32::from_bits(2143289344) as u32), Value::F32((0.0f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::I32(1 as i32))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 2140
|
||
|
fn c810_l2140_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c810_l2140_action_invoke");
|
||
|
let result = instance.call("f64.not_lt", &[Value::F64(f64::from_bits(9221120237041090560) as u64), Value::F64((0.0f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::I32(1 as i32))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 2141
|
||
|
fn c811_l2141_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c811_l2141_action_invoke");
|
||
|
let result = instance.call("f64.not_le", &[Value::F64(f64::from_bits(9221120237041090560) as u64), Value::F64((0.0f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::I32(1 as i32))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 2142
|
||
|
fn c812_l2142_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c812_l2142_action_invoke");
|
||
|
let result = instance.call("f64.not_gt", &[Value::F64(f64::from_bits(9221120237041090560) as u64), Value::F64((0.0f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::I32(1 as i32))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 2143
|
||
|
fn c813_l2143_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c813_l2143_action_invoke");
|
||
|
let result = instance.call("f64.not_ge", &[Value::F64(f64::from_bits(9221120237041090560) as u64), Value::F64((0.0f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::I32(1 as i32))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 2149
|
||
|
|
||
|
#[test]
|
||
|
fn test_module_84() {
|
||
|
let mut instance = create_module_84();
|
||
|
// We group the calls together
|
||
|
start_module_84(&mut instance);
|
||
|
c806_l2136_action_invoke(&mut instance);
|
||
|
c807_l2137_action_invoke(&mut instance);
|
||
|
c808_l2138_action_invoke(&mut instance);
|
||
|
c809_l2139_action_invoke(&mut instance);
|
||
|
c810_l2140_action_invoke(&mut instance);
|
||
|
c811_l2141_action_invoke(&mut instance);
|
||
|
c812_l2142_action_invoke(&mut instance);
|
||
|
c813_l2143_action_invoke(&mut instance);
|
||
|
}
|
||
|
fn create_module_85() -> Box<Instance> {
|
||
|
let module_str = "(module
|
||
|
(type (;0;) (func (result f32)))
|
||
|
(type (;1;) (func (result f64)))
|
||
|
(func (;0;) (type 0) (result f32)
|
||
|
f32.const 0x1p+0 (;=1;)
|
||
|
f32.const 0x1.8p+1 (;=3;)
|
||
|
f32.const 0x1p+2 (;=4;)
|
||
|
f32.const 0x1.8p+1 (;=3;)
|
||
|
f32.div
|
||
|
f32.const 0x1p+0 (;=1;)
|
||
|
f32.sub
|
||
|
f32.mul
|
||
|
f32.sub)
|
||
|
(func (;1;) (type 1) (result f64)
|
||
|
f64.const 0x1p+0 (;=1;)
|
||
|
f64.const 0x1.8p+1 (;=3;)
|
||
|
f64.const 0x1p+2 (;=4;)
|
||
|
f64.const 0x1.8p+1 (;=3;)
|
||
|
f64.div
|
||
|
f64.const 0x1p+0 (;=1;)
|
||
|
f64.sub
|
||
|
f64.mul
|
||
|
f64.sub)
|
||
|
(export \"f32.epsilon\" (func 0))
|
||
|
(export \"f64.epsilon\" (func 1)))
|
||
|
";
|
||
|
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_85(instance: &mut Instance) {
|
||
|
// TODO Review is explicit start needed? Start now called in runtime::Instance::new()
|
||
|
//instance.start();
|
||
|
}
|
||
|
|
||
|
// Line 2157
|
||
|
fn c815_l2157_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c815_l2157_action_invoke");
|
||
|
let result = instance.call("f32.epsilon", &[]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((-0.00000011920929f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 2158
|
||
|
fn c816_l2158_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c816_l2158_action_invoke");
|
||
|
let result = instance.call("f64.epsilon", &[]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((0.0000000000000002220446049250313f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 2164
|
||
|
|
||
|
#[test]
|
||
|
fn test_module_85() {
|
||
|
let mut instance = create_module_85();
|
||
|
// We group the calls together
|
||
|
start_module_85(&mut instance);
|
||
|
c815_l2157_action_invoke(&mut instance);
|
||
|
c816_l2158_action_invoke(&mut instance);
|
||
|
}
|
||
|
fn create_module_86() -> Box<Instance> {
|
||
|
let module_str = "(module
|
||
|
(type (;0;) (func (result f32)))
|
||
|
(type (;1;) (func (result f64)))
|
||
|
(func (;0;) (type 0) (result f32)
|
||
|
(local f32 f32)
|
||
|
f32.const 0x1p+0 (;=1;)
|
||
|
set_local 0
|
||
|
loop ;; label = @1
|
||
|
get_local 0
|
||
|
tee_local 1
|
||
|
f32.const 0x1p-1 (;=0.5;)
|
||
|
f32.mul
|
||
|
tee_local 0
|
||
|
f32.const 0x1p+0 (;=1;)
|
||
|
f32.add
|
||
|
f32.const 0x1p+0 (;=1;)
|
||
|
f32.gt
|
||
|
br_if 0 (;@1;)
|
||
|
end
|
||
|
get_local 1)
|
||
|
(func (;1;) (type 1) (result f64)
|
||
|
(local f64 f64)
|
||
|
f64.const 0x1p+0 (;=1;)
|
||
|
set_local 0
|
||
|
loop ;; label = @1
|
||
|
get_local 0
|
||
|
tee_local 1
|
||
|
f64.const 0x1p-1 (;=0.5;)
|
||
|
f64.mul
|
||
|
tee_local 0
|
||
|
f64.const 0x1p+0 (;=1;)
|
||
|
f64.add
|
||
|
f64.const 0x1p+0 (;=1;)
|
||
|
f64.gt
|
||
|
br_if 0 (;@1;)
|
||
|
end
|
||
|
get_local 1)
|
||
|
(export \"f32.epsilon\" (func 0))
|
||
|
(export \"f64.epsilon\" (func 1)))
|
||
|
";
|
||
|
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_86(instance: &mut Instance) {
|
||
|
// TODO Review is explicit start needed? Start now called in runtime::Instance::new()
|
||
|
//instance.start();
|
||
|
}
|
||
|
|
||
|
// Line 2212
|
||
|
fn c818_l2212_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c818_l2212_action_invoke");
|
||
|
let result = instance.call("f32.epsilon", &[]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((0.00000011920929f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 2213
|
||
|
fn c819_l2213_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c819_l2213_action_invoke");
|
||
|
let result = instance.call("f64.epsilon", &[]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((0.0000000000000002220446049250313f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 2218
|
||
|
|
||
|
#[test]
|
||
|
fn test_module_86() {
|
||
|
let mut instance = create_module_86();
|
||
|
// We group the calls together
|
||
|
start_module_86(&mut instance);
|
||
|
c818_l2212_action_invoke(&mut instance);
|
||
|
c819_l2213_action_invoke(&mut instance);
|
||
|
}
|
||
|
fn create_module_87() -> Box<Instance> {
|
||
|
let module_str = "(module
|
||
|
(type (;0;) (func (param f32 f32) (result i32)))
|
||
|
(type (;1;) (func (param f64 f64) (result i32)))
|
||
|
(func (;0;) (type 0) (param f32 f32) (result i32)
|
||
|
get_local 0
|
||
|
get_local 1
|
||
|
f32.lt
|
||
|
get_local 0
|
||
|
get_local 1
|
||
|
f32.ge
|
||
|
i32.or)
|
||
|
(func (;1;) (type 0) (param f32 f32) (result i32)
|
||
|
get_local 0
|
||
|
get_local 1
|
||
|
f32.le
|
||
|
get_local 0
|
||
|
get_local 1
|
||
|
f32.gt
|
||
|
i32.or)
|
||
|
(func (;2;) (type 0) (param f32 f32) (result i32)
|
||
|
get_local 0
|
||
|
get_local 1
|
||
|
f32.gt
|
||
|
get_local 0
|
||
|
get_local 1
|
||
|
f32.le
|
||
|
i32.or)
|
||
|
(func (;3;) (type 0) (param f32 f32) (result i32)
|
||
|
get_local 0
|
||
|
get_local 1
|
||
|
f32.ge
|
||
|
get_local 0
|
||
|
get_local 1
|
||
|
f32.lt
|
||
|
i32.or)
|
||
|
(func (;4;) (type 1) (param f64 f64) (result i32)
|
||
|
get_local 0
|
||
|
get_local 1
|
||
|
f64.lt
|
||
|
get_local 0
|
||
|
get_local 1
|
||
|
f64.ge
|
||
|
i32.or)
|
||
|
(func (;5;) (type 1) (param f64 f64) (result i32)
|
||
|
get_local 0
|
||
|
get_local 1
|
||
|
f64.le
|
||
|
get_local 0
|
||
|
get_local 1
|
||
|
f64.gt
|
||
|
i32.or)
|
||
|
(func (;6;) (type 1) (param f64 f64) (result i32)
|
||
|
get_local 0
|
||
|
get_local 1
|
||
|
f64.gt
|
||
|
get_local 0
|
||
|
get_local 1
|
||
|
f64.le
|
||
|
i32.or)
|
||
|
(func (;7;) (type 1) (param f64 f64) (result i32)
|
||
|
get_local 0
|
||
|
get_local 1
|
||
|
f64.ge
|
||
|
get_local 0
|
||
|
get_local 1
|
||
|
f64.lt
|
||
|
i32.or)
|
||
|
(export \"f32.no_trichotomy_lt\" (func 0))
|
||
|
(export \"f32.no_trichotomy_le\" (func 1))
|
||
|
(export \"f32.no_trichotomy_gt\" (func 2))
|
||
|
(export \"f32.no_trichotomy_ge\" (func 3))
|
||
|
(export \"f64.no_trichotomy_lt\" (func 4))
|
||
|
(export \"f64.no_trichotomy_le\" (func 5))
|
||
|
(export \"f64.no_trichotomy_gt\" (func 6))
|
||
|
(export \"f64.no_trichotomy_ge\" (func 7)))
|
||
|
";
|
||
|
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_87(instance: &mut Instance) {
|
||
|
// TODO Review is explicit start needed? Start now called in runtime::Instance::new()
|
||
|
//instance.start();
|
||
|
}
|
||
|
|
||
|
// Line 2238
|
||
|
fn c821_l2238_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c821_l2238_action_invoke");
|
||
|
let result = instance.call("f32.no_trichotomy_lt", &[Value::F32((0.0f32).to_bits()), Value::F32(f32::from_bits(2143289344) as u32)]);
|
||
|
assert_eq!(result, Ok(Some(Value::I32(0 as i32))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 2239
|
||
|
fn c822_l2239_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c822_l2239_action_invoke");
|
||
|
let result = instance.call("f32.no_trichotomy_le", &[Value::F32((0.0f32).to_bits()), Value::F32(f32::from_bits(2143289344) as u32)]);
|
||
|
assert_eq!(result, Ok(Some(Value::I32(0 as i32))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 2240
|
||
|
fn c823_l2240_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c823_l2240_action_invoke");
|
||
|
let result = instance.call("f32.no_trichotomy_gt", &[Value::F32((0.0f32).to_bits()), Value::F32(f32::from_bits(2143289344) as u32)]);
|
||
|
assert_eq!(result, Ok(Some(Value::I32(0 as i32))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 2241
|
||
|
fn c824_l2241_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c824_l2241_action_invoke");
|
||
|
let result = instance.call("f32.no_trichotomy_ge", &[Value::F32((0.0f32).to_bits()), Value::F32(f32::from_bits(2143289344) as u32)]);
|
||
|
assert_eq!(result, Ok(Some(Value::I32(0 as i32))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 2242
|
||
|
fn c825_l2242_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c825_l2242_action_invoke");
|
||
|
let result = instance.call("f64.no_trichotomy_lt", &[Value::F64((0.0f64).to_bits()), Value::F64(f64::from_bits(9221120237041090560) as u64)]);
|
||
|
assert_eq!(result, Ok(Some(Value::I32(0 as i32))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 2243
|
||
|
fn c826_l2243_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c826_l2243_action_invoke");
|
||
|
let result = instance.call("f64.no_trichotomy_le", &[Value::F64((0.0f64).to_bits()), Value::F64(f64::from_bits(9221120237041090560) as u64)]);
|
||
|
assert_eq!(result, Ok(Some(Value::I32(0 as i32))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 2244
|
||
|
fn c827_l2244_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c827_l2244_action_invoke");
|
||
|
let result = instance.call("f64.no_trichotomy_gt", &[Value::F64((0.0f64).to_bits()), Value::F64(f64::from_bits(9221120237041090560) as u64)]);
|
||
|
assert_eq!(result, Ok(Some(Value::I32(0 as i32))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 2245
|
||
|
fn c828_l2245_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c828_l2245_action_invoke");
|
||
|
let result = instance.call("f64.no_trichotomy_ge", &[Value::F64((0.0f64).to_bits()), Value::F64(f64::from_bits(9221120237041090560) as u64)]);
|
||
|
assert_eq!(result, Ok(Some(Value::I32(0 as i32))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 2250
|
||
|
|
||
|
#[test]
|
||
|
fn test_module_87() {
|
||
|
let mut instance = create_module_87();
|
||
|
// We group the calls together
|
||
|
start_module_87(&mut instance);
|
||
|
c821_l2238_action_invoke(&mut instance);
|
||
|
c822_l2239_action_invoke(&mut instance);
|
||
|
c823_l2240_action_invoke(&mut instance);
|
||
|
c824_l2241_action_invoke(&mut instance);
|
||
|
c825_l2242_action_invoke(&mut instance);
|
||
|
c826_l2243_action_invoke(&mut instance);
|
||
|
c827_l2244_action_invoke(&mut instance);
|
||
|
c828_l2245_action_invoke(&mut instance);
|
||
|
}
|
||
|
fn create_module_88() -> Box<Instance> {
|
||
|
let module_str = "(module
|
||
|
(type (;0;) (func (param i32 i32) (result i32)))
|
||
|
(type (;1;) (func (param i32) (result i32)))
|
||
|
(type (;2;) (func (param i64 i64) (result i64)))
|
||
|
(type (;3;) (func (param i64) (result i64)))
|
||
|
(func (;0;) (type 0) (param i32 i32) (result i32)
|
||
|
get_local 0
|
||
|
f32.reinterpret/i32
|
||
|
get_local 1
|
||
|
f32.reinterpret/i32
|
||
|
f32.div
|
||
|
i32.reinterpret/f32
|
||
|
i32.const 2143289344
|
||
|
i32.and)
|
||
|
(func (;1;) (type 0) (param i32 i32) (result i32)
|
||
|
get_local 0
|
||
|
f32.reinterpret/i32
|
||
|
get_local 1
|
||
|
f32.reinterpret/i32
|
||
|
f32.div
|
||
|
i32.reinterpret/f32
|
||
|
i32.const 2147483647
|
||
|
i32.and)
|
||
|
(func (;2;) (type 1) (param i32) (result i32)
|
||
|
get_local 0
|
||
|
f32.reinterpret/i32
|
||
|
f32.neg
|
||
|
i32.reinterpret/f32)
|
||
|
(func (;3;) (type 2) (param i64 i64) (result i64)
|
||
|
get_local 0
|
||
|
f64.reinterpret/i64
|
||
|
get_local 1
|
||
|
f64.reinterpret/i64
|
||
|
f64.div
|
||
|
i64.reinterpret/f64
|
||
|
i64.const 9221120237041090560
|
||
|
i64.and)
|
||
|
(func (;4;) (type 2) (param i64 i64) (result i64)
|
||
|
get_local 0
|
||
|
f64.reinterpret/i64
|
||
|
get_local 1
|
||
|
f64.reinterpret/i64
|
||
|
f64.div
|
||
|
i64.reinterpret/f64
|
||
|
i64.const 9223372036854775807
|
||
|
i64.and)
|
||
|
(func (;5;) (type 3) (param i64) (result i64)
|
||
|
get_local 0
|
||
|
f64.reinterpret/i64
|
||
|
f64.neg
|
||
|
i64.reinterpret/f64)
|
||
|
(func (;6;) (type 1) (param i32) (result i32)
|
||
|
get_local 0
|
||
|
f32.reinterpret/i32
|
||
|
f32.const 0x0p+0 (;=0;)
|
||
|
f32.sub
|
||
|
i32.reinterpret/f32
|
||
|
i32.const 2143289344
|
||
|
i32.and)
|
||
|
(func (;7;) (type 1) (param i32) (result i32)
|
||
|
f32.const -0x0p+0 (;=-0;)
|
||
|
get_local 0
|
||
|
f32.reinterpret/i32
|
||
|
f32.sub
|
||
|
i32.reinterpret/f32
|
||
|
i32.const 2143289344
|
||
|
i32.and)
|
||
|
(func (;8;) (type 1) (param i32) (result i32)
|
||
|
get_local 0
|
||
|
f32.reinterpret/i32
|
||
|
f32.const 0x1p+0 (;=1;)
|
||
|
f32.mul
|
||
|
i32.reinterpret/f32
|
||
|
i32.const 2143289344
|
||
|
i32.and)
|
||
|
(func (;9;) (type 1) (param i32) (result i32)
|
||
|
f32.const -0x1p+0 (;=-1;)
|
||
|
get_local 0
|
||
|
f32.reinterpret/i32
|
||
|
f32.mul
|
||
|
i32.reinterpret/f32
|
||
|
i32.const 2143289344
|
||
|
i32.and)
|
||
|
(func (;10;) (type 1) (param i32) (result i32)
|
||
|
get_local 0
|
||
|
f32.reinterpret/i32
|
||
|
f32.const 0x1p+0 (;=1;)
|
||
|
f32.div
|
||
|
i32.reinterpret/f32
|
||
|
i32.const 2143289344
|
||
|
i32.and)
|
||
|
(func (;11;) (type 1) (param i32) (result i32)
|
||
|
get_local 0
|
||
|
f32.reinterpret/i32
|
||
|
f32.const -0x1p+0 (;=-1;)
|
||
|
f32.div
|
||
|
i32.reinterpret/f32
|
||
|
i32.const 2143289344
|
||
|
i32.and)
|
||
|
(func (;12;) (type 3) (param i64) (result i64)
|
||
|
get_local 0
|
||
|
f64.reinterpret/i64
|
||
|
f64.const 0x0p+0 (;=0;)
|
||
|
f64.sub
|
||
|
i64.reinterpret/f64
|
||
|
i64.const 9221120237041090560
|
||
|
i64.and)
|
||
|
(func (;13;) (type 3) (param i64) (result i64)
|
||
|
f64.const -0x0p+0 (;=-0;)
|
||
|
get_local 0
|
||
|
f64.reinterpret/i64
|
||
|
f64.sub
|
||
|
i64.reinterpret/f64
|
||
|
i64.const 9221120237041090560
|
||
|
i64.and)
|
||
|
(func (;14;) (type 3) (param i64) (result i64)
|
||
|
get_local 0
|
||
|
f64.reinterpret/i64
|
||
|
f64.const 0x1p+0 (;=1;)
|
||
|
f64.mul
|
||
|
i64.reinterpret/f64
|
||
|
i64.const 9221120237041090560
|
||
|
i64.and)
|
||
|
(func (;15;) (type 3) (param i64) (result i64)
|
||
|
f64.const -0x1p+0 (;=-1;)
|
||
|
get_local 0
|
||
|
f64.reinterpret/i64
|
||
|
f64.mul
|
||
|
i64.reinterpret/f64
|
||
|
i64.const 9221120237041090560
|
||
|
i64.and)
|
||
|
(func (;16;) (type 3) (param i64) (result i64)
|
||
|
get_local 0
|
||
|
f64.reinterpret/i64
|
||
|
f64.const 0x1p+0 (;=1;)
|
||
|
f64.div
|
||
|
i64.reinterpret/f64
|
||
|
i64.const 9221120237041090560
|
||
|
i64.and)
|
||
|
(func (;17;) (type 3) (param i64) (result i64)
|
||
|
get_local 0
|
||
|
f64.reinterpret/i64
|
||
|
f64.const -0x1p+0 (;=-1;)
|
||
|
f64.div
|
||
|
i64.reinterpret/f64
|
||
|
i64.const 9221120237041090560
|
||
|
i64.and)
|
||
|
(func (;18;) (type 1) (param i32) (result i32)
|
||
|
get_local 0
|
||
|
f32.reinterpret/i32
|
||
|
f64.promote/f32
|
||
|
f32.demote/f64
|
||
|
i32.reinterpret/f32
|
||
|
i32.const 2143289344
|
||
|
i32.and)
|
||
|
(export \"f32.arithmetic_nan_bitpattern\" (func 0))
|
||
|
(export \"f32.canonical_nan_bitpattern\" (func 1))
|
||
|
(export \"f32.nonarithmetic_nan_bitpattern\" (func 2))
|
||
|
(export \"f64.arithmetic_nan_bitpattern\" (func 3))
|
||
|
(export \"f64.canonical_nan_bitpattern\" (func 4))
|
||
|
(export \"f64.nonarithmetic_nan_bitpattern\" (func 5))
|
||
|
(export \"f32.no_fold_sub_zero\" (func 6))
|
||
|
(export \"f32.no_fold_neg0_sub\" (func 7))
|
||
|
(export \"f32.no_fold_mul_one\" (func 8))
|
||
|
(export \"f32.no_fold_neg1_mul\" (func 9))
|
||
|
(export \"f32.no_fold_div_one\" (func 10))
|
||
|
(export \"f32.no_fold_div_neg1\" (func 11))
|
||
|
(export \"f64.no_fold_sub_zero\" (func 12))
|
||
|
(export \"f64.no_fold_neg0_sub\" (func 13))
|
||
|
(export \"f64.no_fold_mul_one\" (func 14))
|
||
|
(export \"f64.no_fold_neg1_mul\" (func 15))
|
||
|
(export \"f64.no_fold_div_one\" (func 16))
|
||
|
(export \"f64.no_fold_div_neg1\" (func 17))
|
||
|
(export \"no_fold_promote_demote\" (func 18)))
|
||
|
";
|
||
|
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_88(instance: &mut Instance) {
|
||
|
// TODO Review is explicit start needed? Start now called in runtime::Instance::new()
|
||
|
//instance.start();
|
||
|
}
|
||
|
|
||
|
// Line 2329
|
||
|
fn c830_l2329_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c830_l2329_action_invoke");
|
||
|
let result = instance.call("f32.arithmetic_nan_bitpattern", &[Value::I32(2139107856 as i32), Value::I32(2139107856 as i32)]);
|
||
|
assert_eq!(result, Ok(Some(Value::I32(2143289344 as i32))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 2330
|
||
|
fn c831_l2330_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c831_l2330_action_invoke");
|
||
|
let result = instance.call("f32.canonical_nan_bitpattern", &[Value::I32(0 as i32), Value::I32(0 as i32)]);
|
||
|
assert_eq!(result, Ok(Some(Value::I32(2143289344 as i32))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 2331
|
||
|
fn c832_l2331_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c832_l2331_action_invoke");
|
||
|
let result = instance.call("f32.canonical_nan_bitpattern", &[Value::I32(2143289344 as i32), Value::I32(2143289344 as i32)]);
|
||
|
assert_eq!(result, Ok(Some(Value::I32(2143289344 as i32))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 2332
|
||
|
fn c833_l2332_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c833_l2332_action_invoke");
|
||
|
let result = instance.call("f32.canonical_nan_bitpattern", &[Value::I32(-4194304 as i32), Value::I32(2143289344 as i32)]);
|
||
|
assert_eq!(result, Ok(Some(Value::I32(2143289344 as i32))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 2333
|
||
|
fn c834_l2333_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c834_l2333_action_invoke");
|
||
|
let result = instance.call("f32.canonical_nan_bitpattern", &[Value::I32(2143289344 as i32), Value::I32(-4194304 as i32)]);
|
||
|
assert_eq!(result, Ok(Some(Value::I32(2143289344 as i32))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 2334
|
||
|
fn c835_l2334_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c835_l2334_action_invoke");
|
||
|
let result = instance.call("f32.canonical_nan_bitpattern", &[Value::I32(-4194304 as i32), Value::I32(-4194304 as i32)]);
|
||
|
assert_eq!(result, Ok(Some(Value::I32(2143289344 as i32))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 2335
|
||
|
fn c836_l2335_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c836_l2335_action_invoke");
|
||
|
let result = instance.call("f32.nonarithmetic_nan_bitpattern", &[Value::I32(2143302160 as i32)]);
|
||
|
assert_eq!(result, Ok(Some(Value::I32(-4181488 as i32))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 2336
|
||
|
fn c837_l2336_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c837_l2336_action_invoke");
|
||
|
let result = instance.call("f32.nonarithmetic_nan_bitpattern", &[Value::I32(-4181488 as i32)]);
|
||
|
assert_eq!(result, Ok(Some(Value::I32(2143302160 as i32))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 2337
|
||
|
fn c838_l2337_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c838_l2337_action_invoke");
|
||
|
let result = instance.call("f32.nonarithmetic_nan_bitpattern", &[Value::I32(2139107856 as i32)]);
|
||
|
assert_eq!(result, Ok(Some(Value::I32(-8375792 as i32))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 2338
|
||
|
fn c839_l2338_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c839_l2338_action_invoke");
|
||
|
let result = instance.call("f32.nonarithmetic_nan_bitpattern", &[Value::I32(-8375792 as i32)]);
|
||
|
assert_eq!(result, Ok(Some(Value::I32(2139107856 as i32))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 2339
|
||
|
fn c840_l2339_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c840_l2339_action_invoke");
|
||
|
let result = instance.call("f64.arithmetic_nan_bitpattern", &[Value::I64(9218868437227418128 as i64), Value::I64(9218868437227418128 as i64)]);
|
||
|
assert_eq!(result, Ok(Some(Value::I64(9221120237041090560 as i64))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 2340
|
||
|
fn c841_l2340_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c841_l2340_action_invoke");
|
||
|
let result = instance.call("f64.canonical_nan_bitpattern", &[Value::I64(0 as i64), Value::I64(0 as i64)]);
|
||
|
assert_eq!(result, Ok(Some(Value::I64(9221120237041090560 as i64))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 2341
|
||
|
fn c842_l2341_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c842_l2341_action_invoke");
|
||
|
let result = instance.call("f64.canonical_nan_bitpattern", &[Value::I64(9221120237041090560 as i64), Value::I64(9221120237041090560 as i64)]);
|
||
|
assert_eq!(result, Ok(Some(Value::I64(9221120237041090560 as i64))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 2342
|
||
|
fn c843_l2342_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c843_l2342_action_invoke");
|
||
|
let result = instance.call("f64.canonical_nan_bitpattern", &[Value::I64(-2251799813685248 as i64), Value::I64(9221120237041090560 as i64)]);
|
||
|
assert_eq!(result, Ok(Some(Value::I64(9221120237041090560 as i64))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 2343
|
||
|
fn c844_l2343_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c844_l2343_action_invoke");
|
||
|
let result = instance.call("f64.canonical_nan_bitpattern", &[Value::I64(9221120237041090560 as i64), Value::I64(-2251799813685248 as i64)]);
|
||
|
assert_eq!(result, Ok(Some(Value::I64(9221120237041090560 as i64))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 2344
|
||
|
fn c845_l2344_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c845_l2344_action_invoke");
|
||
|
let result = instance.call("f64.canonical_nan_bitpattern", &[Value::I64(-2251799813685248 as i64), Value::I64(-2251799813685248 as i64)]);
|
||
|
assert_eq!(result, Ok(Some(Value::I64(9221120237041090560 as i64))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 2345
|
||
|
fn c846_l2345_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c846_l2345_action_invoke");
|
||
|
let result = instance.call("f64.nonarithmetic_nan_bitpattern", &[Value::I64(9221120237041103376 as i64)]);
|
||
|
assert_eq!(result, Ok(Some(Value::I64(-2251799813672432 as i64))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 2346
|
||
|
fn c847_l2346_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c847_l2346_action_invoke");
|
||
|
let result = instance.call("f64.nonarithmetic_nan_bitpattern", &[Value::I64(-2251799813672432 as i64)]);
|
||
|
assert_eq!(result, Ok(Some(Value::I64(9221120237041103376 as i64))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 2347
|
||
|
fn c848_l2347_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c848_l2347_action_invoke");
|
||
|
let result = instance.call("f64.nonarithmetic_nan_bitpattern", &[Value::I64(9218868437227418128 as i64)]);
|
||
|
assert_eq!(result, Ok(Some(Value::I64(-4503599627357680 as i64))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 2348
|
||
|
fn c849_l2348_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c849_l2348_action_invoke");
|
||
|
let result = instance.call("f64.nonarithmetic_nan_bitpattern", &[Value::I64(-4503599627357680 as i64)]);
|
||
|
assert_eq!(result, Ok(Some(Value::I64(9218868437227418128 as i64))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 2349
|
||
|
fn c850_l2349_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c850_l2349_action_invoke");
|
||
|
let result = instance.call("f32.no_fold_sub_zero", &[Value::I32(2141192192 as i32)]);
|
||
|
assert_eq!(result, Ok(Some(Value::I32(2143289344 as i32))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 2350
|
||
|
fn c851_l2350_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c851_l2350_action_invoke");
|
||
|
let result = instance.call("f32.no_fold_neg0_sub", &[Value::I32(2141192192 as i32)]);
|
||
|
assert_eq!(result, Ok(Some(Value::I32(2143289344 as i32))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 2351
|
||
|
fn c852_l2351_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c852_l2351_action_invoke");
|
||
|
let result = instance.call("f32.no_fold_mul_one", &[Value::I32(2141192192 as i32)]);
|
||
|
assert_eq!(result, Ok(Some(Value::I32(2143289344 as i32))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 2352
|
||
|
fn c853_l2352_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c853_l2352_action_invoke");
|
||
|
let result = instance.call("f32.no_fold_neg1_mul", &[Value::I32(2141192192 as i32)]);
|
||
|
assert_eq!(result, Ok(Some(Value::I32(2143289344 as i32))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 2353
|
||
|
fn c854_l2353_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c854_l2353_action_invoke");
|
||
|
let result = instance.call("f32.no_fold_div_one", &[Value::I32(2141192192 as i32)]);
|
||
|
assert_eq!(result, Ok(Some(Value::I32(2143289344 as i32))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 2354
|
||
|
fn c855_l2354_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c855_l2354_action_invoke");
|
||
|
let result = instance.call("f32.no_fold_div_neg1", &[Value::I32(2141192192 as i32)]);
|
||
|
assert_eq!(result, Ok(Some(Value::I32(2143289344 as i32))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 2355
|
||
|
fn c856_l2355_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c856_l2355_action_invoke");
|
||
|
let result = instance.call("f64.no_fold_sub_zero", &[Value::I64(9219994337134247936 as i64)]);
|
||
|
assert_eq!(result, Ok(Some(Value::I64(9221120237041090560 as i64))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 2356
|
||
|
fn c857_l2356_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c857_l2356_action_invoke");
|
||
|
let result = instance.call("f64.no_fold_neg0_sub", &[Value::I64(9219994337134247936 as i64)]);
|
||
|
assert_eq!(result, Ok(Some(Value::I64(9221120237041090560 as i64))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 2357
|
||
|
fn c858_l2357_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c858_l2357_action_invoke");
|
||
|
let result = instance.call("f64.no_fold_mul_one", &[Value::I64(9219994337134247936 as i64)]);
|
||
|
assert_eq!(result, Ok(Some(Value::I64(9221120237041090560 as i64))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 2358
|
||
|
fn c859_l2358_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c859_l2358_action_invoke");
|
||
|
let result = instance.call("f64.no_fold_neg1_mul", &[Value::I64(9219994337134247936 as i64)]);
|
||
|
assert_eq!(result, Ok(Some(Value::I64(9221120237041090560 as i64))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 2359
|
||
|
fn c860_l2359_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c860_l2359_action_invoke");
|
||
|
let result = instance.call("f64.no_fold_div_one", &[Value::I64(9219994337134247936 as i64)]);
|
||
|
assert_eq!(result, Ok(Some(Value::I64(9221120237041090560 as i64))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 2360
|
||
|
fn c861_l2360_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c861_l2360_action_invoke");
|
||
|
let result = instance.call("f64.no_fold_div_neg1", &[Value::I64(9219994337134247936 as i64)]);
|
||
|
assert_eq!(result, Ok(Some(Value::I64(9221120237041090560 as i64))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 2361
|
||
|
fn c862_l2361_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c862_l2361_action_invoke");
|
||
|
let result = instance.call("no_fold_promote_demote", &[Value::I32(2141192192 as i32)]);
|
||
|
assert_eq!(result, Ok(Some(Value::I32(2143289344 as i32))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 2366
|
||
|
|
||
|
#[test]
|
||
|
fn test_module_88() {
|
||
|
let mut instance = create_module_88();
|
||
|
// We group the calls together
|
||
|
start_module_88(&mut instance);
|
||
|
c830_l2329_action_invoke(&mut instance);
|
||
|
c831_l2330_action_invoke(&mut instance);
|
||
|
c832_l2331_action_invoke(&mut instance);
|
||
|
c833_l2332_action_invoke(&mut instance);
|
||
|
c834_l2333_action_invoke(&mut instance);
|
||
|
c835_l2334_action_invoke(&mut instance);
|
||
|
c836_l2335_action_invoke(&mut instance);
|
||
|
c837_l2336_action_invoke(&mut instance);
|
||
|
c838_l2337_action_invoke(&mut instance);
|
||
|
c839_l2338_action_invoke(&mut instance);
|
||
|
c840_l2339_action_invoke(&mut instance);
|
||
|
c841_l2340_action_invoke(&mut instance);
|
||
|
c842_l2341_action_invoke(&mut instance);
|
||
|
c843_l2342_action_invoke(&mut instance);
|
||
|
c844_l2343_action_invoke(&mut instance);
|
||
|
c845_l2344_action_invoke(&mut instance);
|
||
|
c846_l2345_action_invoke(&mut instance);
|
||
|
c847_l2346_action_invoke(&mut instance);
|
||
|
c848_l2347_action_invoke(&mut instance);
|
||
|
c849_l2348_action_invoke(&mut instance);
|
||
|
c850_l2349_action_invoke(&mut instance);
|
||
|
c851_l2350_action_invoke(&mut instance);
|
||
|
c852_l2351_action_invoke(&mut instance);
|
||
|
c853_l2352_action_invoke(&mut instance);
|
||
|
c854_l2353_action_invoke(&mut instance);
|
||
|
c855_l2354_action_invoke(&mut instance);
|
||
|
c856_l2355_action_invoke(&mut instance);
|
||
|
c857_l2356_action_invoke(&mut instance);
|
||
|
c858_l2357_action_invoke(&mut instance);
|
||
|
c859_l2358_action_invoke(&mut instance);
|
||
|
c860_l2359_action_invoke(&mut instance);
|
||
|
c861_l2360_action_invoke(&mut instance);
|
||
|
c862_l2361_action_invoke(&mut instance);
|
||
|
}
|
||
|
fn create_module_89() -> Box<Instance> {
|
||
|
let module_str = "(module
|
||
|
(type (;0;) (func (param f64 f64 f64 f64 f64 f64 f64 f64) (result f64)))
|
||
|
(func (;0;) (type 0) (param f64 f64 f64 f64 f64 f64 f64 f64) (result f64)
|
||
|
get_local 0
|
||
|
get_local 4
|
||
|
f64.mul
|
||
|
get_local 1
|
||
|
get_local 5
|
||
|
f64.mul
|
||
|
f64.add
|
||
|
get_local 2
|
||
|
get_local 6
|
||
|
f64.mul
|
||
|
f64.add
|
||
|
get_local 3
|
||
|
get_local 7
|
||
|
f64.mul
|
||
|
f64.add)
|
||
|
(func (;1;) (type 0) (param f64 f64 f64 f64 f64 f64 f64 f64) (result f64)
|
||
|
get_local 0
|
||
|
get_local 4
|
||
|
f64.mul
|
||
|
get_local 1
|
||
|
get_local 5
|
||
|
f64.mul
|
||
|
f64.add
|
||
|
get_local 2
|
||
|
get_local 6
|
||
|
f64.mul
|
||
|
get_local 3
|
||
|
get_local 7
|
||
|
f64.mul
|
||
|
f64.add
|
||
|
f64.add)
|
||
|
(export \"dot_product_example\" (func 0))
|
||
|
(export \"with_binary_sum_collapse\" (func 1)))
|
||
|
";
|
||
|
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_89(instance: &mut Instance) {
|
||
|
// TODO Review is explicit start needed? Start now called in runtime::Instance::new()
|
||
|
//instance.start();
|
||
|
}
|
||
|
|
||
|
// Line 2389
|
||
|
fn c864_l2389_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c864_l2389_action_invoke");
|
||
|
let result = instance.call("dot_product_example", &[Value::F64((32000000.0f64).to_bits()), Value::F64((1.0f64).to_bits()), Value::F64((-1.0f64).to_bits()), Value::F64((80000000.0f64).to_bits()), Value::F64((40000000.0f64).to_bits()), Value::F64((1.0f64).to_bits()), Value::F64((-1.0f64).to_bits()), Value::F64((-16000000.0f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((2.0f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 2393
|
||
|
fn c865_l2393_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c865_l2393_action_invoke");
|
||
|
let result = instance.call("with_binary_sum_collapse", &[Value::F64((32000000.0f64).to_bits()), Value::F64((1.0f64).to_bits()), Value::F64((-1.0f64).to_bits()), Value::F64((80000000.0f64).to_bits()), Value::F64((40000000.0f64).to_bits()), Value::F64((1.0f64).to_bits()), Value::F64((-1.0f64).to_bits()), Value::F64((-16000000.0f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((2.0f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 2400
|
||
|
|
||
|
#[test]
|
||
|
fn test_module_89() {
|
||
|
let mut instance = create_module_89();
|
||
|
// We group the calls together
|
||
|
start_module_89(&mut instance);
|
||
|
c864_l2389_action_invoke(&mut instance);
|
||
|
c865_l2393_action_invoke(&mut instance);
|
||
|
}
|
||
|
fn create_module_90() -> Box<Instance> {
|
||
|
let module_str = "(module
|
||
|
(type (;0;) (func (param f32 f32) (result f32)))
|
||
|
(type (;1;) (func (param f64 f64) (result f64)))
|
||
|
(func (;0;) (type 0) (param f32 f32) (result f32)
|
||
|
get_local 0
|
||
|
get_local 0
|
||
|
f32.mul
|
||
|
get_local 1
|
||
|
get_local 1
|
||
|
f32.mul
|
||
|
f32.sub
|
||
|
f32.sqrt)
|
||
|
(func (;1;) (type 1) (param f64 f64) (result f64)
|
||
|
get_local 0
|
||
|
get_local 0
|
||
|
f64.mul
|
||
|
get_local 1
|
||
|
get_local 1
|
||
|
f64.mul
|
||
|
f64.sub
|
||
|
f64.sqrt)
|
||
|
(export \"f32.contract2fma\" (func 0))
|
||
|
(export \"f64.contract2fma\" (func 1)))
|
||
|
";
|
||
|
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_90(instance: &mut Instance) {
|
||
|
// TODO Review is explicit start needed? Start now called in runtime::Instance::new()
|
||
|
//instance.start();
|
||
|
}
|
||
|
|
||
|
// Line 2411
|
||
|
fn c867_l2411_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c867_l2411_action_invoke");
|
||
|
let result = instance.call("f32.contract2fma", &[Value::F32((1.0f32).to_bits()), Value::F32((1.0f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((0.0f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 2412
|
||
|
fn c868_l2412_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c868_l2412_action_invoke");
|
||
|
let result = instance.call("f32.contract2fma", &[Value::F32((1.1f32).to_bits()), Value::F32((1.1f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((0.0f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 2413
|
||
|
fn c869_l2413_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c869_l2413_action_invoke");
|
||
|
let result = instance.call("f32.contract2fma", &[Value::F32((1.1999999f32).to_bits()), Value::F32((1.1999999f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((0.0f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 2414
|
||
|
fn c870_l2414_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c870_l2414_action_invoke");
|
||
|
let result = instance.call("f64.contract2fma", &[Value::F64((1.0f64).to_bits()), Value::F64((1.0f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((0.0f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 2415
|
||
|
fn c871_l2415_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c871_l2415_action_invoke");
|
||
|
let result = instance.call("f64.contract2fma", &[Value::F64((1.1f64).to_bits()), Value::F64((1.1f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((0.0f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 2416
|
||
|
fn c872_l2416_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c872_l2416_action_invoke");
|
||
|
let result = instance.call("f64.contract2fma", &[Value::F64((1.2f64).to_bits()), Value::F64((1.2f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((0.0f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 2421
|
||
|
|
||
|
#[test]
|
||
|
fn test_module_90() {
|
||
|
let mut instance = create_module_90();
|
||
|
// We group the calls together
|
||
|
start_module_90(&mut instance);
|
||
|
c867_l2411_action_invoke(&mut instance);
|
||
|
c868_l2412_action_invoke(&mut instance);
|
||
|
c869_l2413_action_invoke(&mut instance);
|
||
|
c870_l2414_action_invoke(&mut instance);
|
||
|
c871_l2415_action_invoke(&mut instance);
|
||
|
c872_l2416_action_invoke(&mut instance);
|
||
|
}
|
||
|
fn create_module_91() -> Box<Instance> {
|
||
|
let module_str = "(module
|
||
|
(type (;0;) (func (param f32 f32 f32) (result f32)))
|
||
|
(type (;1;) (func (param f64 f64 f64) (result f64)))
|
||
|
(func (;0;) (type 0) (param f32 f32 f32) (result f32)
|
||
|
get_local 0
|
||
|
get_local 1
|
||
|
get_local 2
|
||
|
f32.div
|
||
|
f32.sub)
|
||
|
(func (;1;) (type 1) (param f64 f64 f64) (result f64)
|
||
|
get_local 0
|
||
|
get_local 1
|
||
|
get_local 2
|
||
|
f64.div
|
||
|
f64.sub)
|
||
|
(export \"f32.division_by_small_number\" (func 0))
|
||
|
(export \"f64.division_by_small_number\" (func 1)))
|
||
|
";
|
||
|
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_91(instance: &mut Instance) {
|
||
|
// TODO Review is explicit start needed? Start now called in runtime::Instance::new()
|
||
|
//instance.start();
|
||
|
}
|
||
|
|
||
|
// Line 2430
|
||
|
fn c874_l2430_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c874_l2430_action_invoke");
|
||
|
let result = instance.call("f32.division_by_small_number", &[Value::F32((112000000.0f32).to_bits()), Value::F32((100000.0f32).to_bits()), Value::F32((0.0009f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((888888.0f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 2431
|
||
|
fn c875_l2431_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c875_l2431_action_invoke");
|
||
|
let result = instance.call("f64.division_by_small_number", &[Value::F64((112000000.0f64).to_bits()), Value::F64((100000.0f64).to_bits()), Value::F64((0.0009f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((888888.8888888806f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 2436
|
||
|
|
||
|
#[test]
|
||
|
fn test_module_91() {
|
||
|
let mut instance = create_module_91();
|
||
|
// We group the calls together
|
||
|
start_module_91(&mut instance);
|
||
|
c874_l2430_action_invoke(&mut instance);
|
||
|
c875_l2431_action_invoke(&mut instance);
|
||
|
}
|
||
|
fn create_module_92() -> Box<Instance> {
|
||
|
let module_str = "(module
|
||
|
(type (;0;) (func (param f32 f32 f32) (result f32)))
|
||
|
(type (;1;) (func (param f64 f64 f64) (result f64)))
|
||
|
(func (;0;) (type 0) (param f32 f32 f32) (result f32)
|
||
|
get_local 0
|
||
|
get_local 1
|
||
|
get_local 2
|
||
|
f32.sqrt
|
||
|
f32.add
|
||
|
f32.mul)
|
||
|
(func (;1;) (type 1) (param f64 f64 f64) (result f64)
|
||
|
get_local 0
|
||
|
get_local 1
|
||
|
get_local 2
|
||
|
f64.sqrt
|
||
|
f64.add
|
||
|
f64.mul)
|
||
|
(export \"f32.golden_ratio\" (func 0))
|
||
|
(export \"f64.golden_ratio\" (func 1)))
|
||
|
";
|
||
|
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_92(instance: &mut Instance) {
|
||
|
// TODO Review is explicit start needed? Start now called in runtime::Instance::new()
|
||
|
//instance.start();
|
||
|
}
|
||
|
|
||
|
// Line 2443
|
||
|
fn c877_l2443_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c877_l2443_action_invoke");
|
||
|
let result = instance.call("f32.golden_ratio", &[Value::F32((0.5f32).to_bits()), Value::F32((1.0f32).to_bits()), Value::F32((5.0f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((1.618034f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 2444
|
||
|
fn c878_l2444_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c878_l2444_action_invoke");
|
||
|
let result = instance.call("f64.golden_ratio", &[Value::F64((0.5f64).to_bits()), Value::F64((1.0f64).to_bits()), Value::F64((5.0f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((1.618033988749895f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 2449
|
||
|
|
||
|
#[test]
|
||
|
fn test_module_92() {
|
||
|
let mut instance = create_module_92();
|
||
|
// We group the calls together
|
||
|
start_module_92(&mut instance);
|
||
|
c877_l2443_action_invoke(&mut instance);
|
||
|
c878_l2444_action_invoke(&mut instance);
|
||
|
}
|
||
|
fn create_module_93() -> Box<Instance> {
|
||
|
let module_str = "(module
|
||
|
(type (;0;) (func (param f32) (result f32)))
|
||
|
(type (;1;) (func (param f64) (result f64)))
|
||
|
(func (;0;) (type 0) (param f32) (result f32)
|
||
|
f32.const 0x1p-1 (;=0.5;)
|
||
|
get_local 0
|
||
|
get_local 0
|
||
|
get_local 0
|
||
|
f32.mul
|
||
|
f32.const 0x1p+2 (;=4;)
|
||
|
f32.add
|
||
|
f32.sqrt
|
||
|
f32.add
|
||
|
f32.mul)
|
||
|
(func (;1;) (type 1) (param f64) (result f64)
|
||
|
f64.const 0x1p-1 (;=0.5;)
|
||
|
get_local 0
|
||
|
get_local 0
|
||
|
get_local 0
|
||
|
f64.mul
|
||
|
f64.const 0x1p+2 (;=4;)
|
||
|
f64.add
|
||
|
f64.sqrt
|
||
|
f64.add
|
||
|
f64.mul)
|
||
|
(export \"f32.silver_means\" (func 0))
|
||
|
(export \"f64.silver_means\" (func 1)))
|
||
|
";
|
||
|
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_93(instance: &mut Instance) {
|
||
|
// TODO Review is explicit start needed? Start now called in runtime::Instance::new()
|
||
|
//instance.start();
|
||
|
}
|
||
|
|
||
|
// Line 2462
|
||
|
fn c880_l2462_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c880_l2462_action_invoke");
|
||
|
let result = instance.call("f32.silver_means", &[Value::F32((0.0f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((1.0f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 2463
|
||
|
fn c881_l2463_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c881_l2463_action_invoke");
|
||
|
let result = instance.call("f32.silver_means", &[Value::F32((1.0f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((1.618034f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 2464
|
||
|
fn c882_l2464_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c882_l2464_action_invoke");
|
||
|
let result = instance.call("f32.silver_means", &[Value::F32((2.0f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((2.4142137f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 2465
|
||
|
fn c883_l2465_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c883_l2465_action_invoke");
|
||
|
let result = instance.call("f32.silver_means", &[Value::F32((3.0f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((3.3027756f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 2466
|
||
|
fn c884_l2466_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c884_l2466_action_invoke");
|
||
|
let result = instance.call("f32.silver_means", &[Value::F32((4.0f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((4.236068f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 2467
|
||
|
fn c885_l2467_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c885_l2467_action_invoke");
|
||
|
let result = instance.call("f32.silver_means", &[Value::F32((5.0f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((5.192582f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 2468
|
||
|
fn c886_l2468_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c886_l2468_action_invoke");
|
||
|
let result = instance.call("f64.silver_means", &[Value::F64((0.0f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((1.0f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 2469
|
||
|
fn c887_l2469_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c887_l2469_action_invoke");
|
||
|
let result = instance.call("f64.silver_means", &[Value::F64((1.0f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((1.618033988749895f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 2470
|
||
|
fn c888_l2470_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c888_l2470_action_invoke");
|
||
|
let result = instance.call("f64.silver_means", &[Value::F64((2.0f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((2.414213562373095f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 2471
|
||
|
fn c889_l2471_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c889_l2471_action_invoke");
|
||
|
let result = instance.call("f64.silver_means", &[Value::F64((3.0f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((3.302775637731995f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 2472
|
||
|
fn c890_l2472_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c890_l2472_action_invoke");
|
||
|
let result = instance.call("f64.silver_means", &[Value::F64((4.0f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((4.23606797749979f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 2473
|
||
|
fn c891_l2473_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c891_l2473_action_invoke");
|
||
|
let result = instance.call("f64.silver_means", &[Value::F64((5.0f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((5.192582403567252f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 2478
|
||
|
|
||
|
#[test]
|
||
|
fn test_module_93() {
|
||
|
let mut instance = create_module_93();
|
||
|
// We group the calls together
|
||
|
start_module_93(&mut instance);
|
||
|
c880_l2462_action_invoke(&mut instance);
|
||
|
c881_l2463_action_invoke(&mut instance);
|
||
|
c882_l2464_action_invoke(&mut instance);
|
||
|
c883_l2465_action_invoke(&mut instance);
|
||
|
c884_l2466_action_invoke(&mut instance);
|
||
|
c885_l2467_action_invoke(&mut instance);
|
||
|
c886_l2468_action_invoke(&mut instance);
|
||
|
c887_l2469_action_invoke(&mut instance);
|
||
|
c888_l2470_action_invoke(&mut instance);
|
||
|
c889_l2471_action_invoke(&mut instance);
|
||
|
c890_l2472_action_invoke(&mut instance);
|
||
|
c891_l2473_action_invoke(&mut instance);
|
||
|
}
|
||
|
fn create_module_94() -> Box<Instance> {
|
||
|
let module_str = "(module
|
||
|
(type (;0;) (func (param f64 f64) (result i32)))
|
||
|
(func (;0;) (type 0) (param f64 f64) (result i32)
|
||
|
get_local 0
|
||
|
get_local 1
|
||
|
f64.div
|
||
|
f64.const 0x1.999999999999ap-2 (;=0.4;)
|
||
|
f64.lt)
|
||
|
(export \"point_four\" (func 0)))
|
||
|
";
|
||
|
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_94(instance: &mut Instance) {
|
||
|
// TODO Review is explicit start needed? Start now called in runtime::Instance::new()
|
||
|
//instance.start();
|
||
|
}
|
||
|
|
||
|
// Line 2483
|
||
|
fn c893_l2483_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c893_l2483_action_invoke");
|
||
|
let result = instance.call("point_four", &[Value::F64((4.0f64).to_bits()), Value::F64((10.0f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::I32(0 as i32))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 2488
|
||
|
|
||
|
#[test]
|
||
|
fn test_module_94() {
|
||
|
let mut instance = create_module_94();
|
||
|
// We group the calls together
|
||
|
start_module_94(&mut instance);
|
||
|
c893_l2483_action_invoke(&mut instance);
|
||
|
}
|
||
|
fn create_module_95() -> Box<Instance> {
|
||
|
let module_str = "(module
|
||
|
(type (;0;) (func (param i32) (result f64)))
|
||
|
(func (;0;) (type 0) (param i32) (result f64)
|
||
|
(local f64 f64 f64 f64)
|
||
|
f64.const 0x0p+0 (;=0;)
|
||
|
set_local 1
|
||
|
block ;; label = @1
|
||
|
get_local 0
|
||
|
i32.const 1
|
||
|
i32.lt_s
|
||
|
br_if 0 (;@1;)
|
||
|
f64.const 0x1p+0 (;=1;)
|
||
|
set_local 2
|
||
|
f64.const 0x0p+0 (;=0;)
|
||
|
set_local 3
|
||
|
loop ;; label = @2
|
||
|
get_local 1
|
||
|
get_local 2
|
||
|
f64.const 0x1p+3 (;=8;)
|
||
|
get_local 3
|
||
|
f64.const 0x1p+3 (;=8;)
|
||
|
f64.mul
|
||
|
tee_local 4
|
||
|
f64.const 0x1p+0 (;=1;)
|
||
|
f64.add
|
||
|
f64.div
|
||
|
f64.const 0x1p+2 (;=4;)
|
||
|
get_local 4
|
||
|
f64.const 0x1p+2 (;=4;)
|
||
|
f64.add
|
||
|
f64.div
|
||
|
f64.sub
|
||
|
f64.const 0x1p+1 (;=2;)
|
||
|
get_local 4
|
||
|
f64.const 0x1.4p+2 (;=5;)
|
||
|
f64.add
|
||
|
f64.div
|
||
|
f64.sub
|
||
|
f64.const 0x1p+1 (;=2;)
|
||
|
get_local 4
|
||
|
f64.const 0x1.8p+2 (;=6;)
|
||
|
f64.add
|
||
|
f64.div
|
||
|
f64.sub
|
||
|
f64.mul
|
||
|
f64.add
|
||
|
set_local 1
|
||
|
get_local 3
|
||
|
f64.const 0x1p+0 (;=1;)
|
||
|
f64.add
|
||
|
set_local 3
|
||
|
get_local 2
|
||
|
f64.const 0x1p-4 (;=0.0625;)
|
||
|
f64.mul
|
||
|
set_local 2
|
||
|
get_local 0
|
||
|
i32.const -1
|
||
|
i32.add
|
||
|
tee_local 0
|
||
|
br_if 0 (;@2;)
|
||
|
end
|
||
|
end
|
||
|
get_local 1)
|
||
|
(export \"tau\" (func 0)))
|
||
|
";
|
||
|
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_95(instance: &mut Instance) {
|
||
|
// TODO Review is explicit start needed? Start now called in runtime::Instance::new()
|
||
|
//instance.start();
|
||
|
}
|
||
|
|
||
|
// Line 2553
|
||
|
fn c895_l2553_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c895_l2553_action_invoke");
|
||
|
let result = instance.call("tau", &[Value::I32(10 as i32)]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((6.283185307179583f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 2554
|
||
|
fn c896_l2554_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c896_l2554_action_invoke");
|
||
|
let result = instance.call("tau", &[Value::I32(11 as i32)]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((6.283185307179586f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 2558
|
||
|
|
||
|
#[test]
|
||
|
fn test_module_95() {
|
||
|
let mut instance = create_module_95();
|
||
|
// We group the calls together
|
||
|
start_module_95(&mut instance);
|
||
|
c895_l2553_action_invoke(&mut instance);
|
||
|
c896_l2554_action_invoke(&mut instance);
|
||
|
}
|
||
|
fn create_module_96() -> Box<Instance> {
|
||
|
let module_str = "(module
|
||
|
(type (;0;) (func (param f32 f32) (result f32)))
|
||
|
(type (;1;) (func (param f64 f64) (result f64)))
|
||
|
(func (;0;) (type 0) (param f32 f32) (result f32)
|
||
|
get_local 0
|
||
|
get_local 0
|
||
|
f32.const 0x1p+0 (;=1;)
|
||
|
f32.add
|
||
|
get_local 1
|
||
|
f32.const 0x0p+0 (;=0;)
|
||
|
f32.lt
|
||
|
select)
|
||
|
(func (;1;) (type 1) (param f64 f64) (result f64)
|
||
|
get_local 0
|
||
|
get_local 0
|
||
|
f64.const 0x1p+0 (;=1;)
|
||
|
f64.add
|
||
|
get_local 1
|
||
|
f64.const 0x0p+0 (;=0;)
|
||
|
f64.lt
|
||
|
select)
|
||
|
(export \"f32.no_fold_conditional_inc\" (func 0))
|
||
|
(export \"f64.no_fold_conditional_inc\" (func 1)))
|
||
|
";
|
||
|
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_96(instance: &mut Instance) {
|
||
|
// TODO Review is explicit start needed? Start now called in runtime::Instance::new()
|
||
|
//instance.start();
|
||
|
}
|
||
|
|
||
|
// Line 2569
|
||
|
fn c898_l2569_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c898_l2569_action_invoke");
|
||
|
let result = instance.call("f32.no_fold_conditional_inc", &[Value::F32((-0.0f32).to_bits()), Value::F32((-1.0f32).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F32((-0.0f32).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
// Line 2570
|
||
|
fn c899_l2570_action_invoke(instance: &mut Instance) -> Result<(), String> {
|
||
|
println!("Executing function {}", "c899_l2570_action_invoke");
|
||
|
let result = instance.call("f64.no_fold_conditional_inc", &[Value::F64((-0.0f64).to_bits()), Value::F64((-1.0f64).to_bits())]);
|
||
|
assert_eq!(result, Ok(Some(Value::F64((-0.0f64).to_bits()))));
|
||
|
result.map(|_| ())
|
||
|
}
|
||
|
|
||
|
#[test]
|
||
|
fn test_module_96() {
|
||
|
let mut instance = create_module_96();
|
||
|
// We group the calls together
|
||
|
start_module_96(&mut instance);
|
||
|
c898_l2569_action_invoke(&mut instance);
|
||
|
c899_l2570_action_invoke(&mut instance);
|
||
|
}
|