676: Compare float bits in spectests assert return r=bjfish a=bjfish



Co-authored-by: Brandon Fish <brandon.j.fish@gmail.com>
This commit is contained in:
bors[bot] 2019-08-14 04:29:02 +00:00
commit 01f1c120d2
2 changed files with 59 additions and 23 deletions

View File

@ -23,14 +23,14 @@ clif:skip:simd_binaryen.wast:* # SIMD not implemented
# linking.wast:387,388 appear to be related to WABT issue: https://github.com/pepyakin/wabt-rs/issues/51
clif:fail:globals.wast:243 # AssertInvalid - Should be invalid
clif:fail:linking.wast:137 # AssertTrap - expected trap, got Runtime:Error "unknown trap at 0x1069f3062 - illegal instruction"
clif:fail:linking.wast:139 # AssertTrap - expected trap, got Runtime:Error "unknown trap at 0x1069f3062 - illegal instruction"
clif:fail:linking.wast:142 # AssertTrap - expected trap, got Runtime:Error "unknown trap at 0x1069f3062 - illegal instruction"
clif:fail:linking.wast:144 # AssertTrap - expected trap, got Runtime:Error "unknown trap at 0x1069f3062 - illegal instruction"
clif:fail:linking.wast:147 # AssertTrap - expected trap, got Runtime:Error "unknown trap at 0x1069f3037 - illegal instruction"
clif:fail:linking.wast:149 # AssertTrap - expected trap, got Runtime:Error "unknown trap at 0x1069f3037 - illegal instruction"
clif:fail:linking.wast:185 # AssertTrap - expected trap, got Runtime:Error "unknown trap at 0x1069f3062 - illegal instruction"
clif:fail:linking.wast:187 # AssertTrap - expected trap, got Runtime:Error "unknown trap at 0x1069f3062 - illegal instruction"
clif:fail:linking.wast:137 # AssertTrap - expected trap, got Runtime:Error "unknown trap at 0x106883062 - illegal instruction"
clif:fail:linking.wast:139 # AssertTrap - expected trap, got Runtime:Error "unknown trap at 0x106883062 - illegal instruction"
clif:fail:linking.wast:142 # AssertTrap - expected trap, got Runtime:Error "unknown trap at 0x106883062 - illegal instruction"
clif:fail:linking.wast:144 # AssertTrap - expected trap, got Runtime:Error "unknown trap at 0x106883062 - illegal instruction"
clif:fail:linking.wast:147 # AssertTrap - expected trap, got Runtime:Error "unknown trap at 0x106883037 - illegal instruction"
clif:fail:linking.wast:149 # AssertTrap - expected trap, got Runtime:Error "unknown trap at 0x106883037 - illegal instruction"
clif:fail:linking.wast:185 # AssertTrap - expected trap, got Runtime:Error "unknown trap at 0x106883062 - illegal instruction"
clif:fail:linking.wast:187 # AssertTrap - expected trap, got Runtime:Error "unknown trap at 0x106883062 - illegal instruction"
clif:fail:linking.wast:387 # AssertReturn - result I32(0) ("0x0") does not match expected I32(104) ("0x68")
clif:fail:linking.wast:388 # AssertReturn - Call failed RuntimeError: WebAssembly trap occurred during runtime: `call_indirect` out-of-bounds
@ -823,13 +823,17 @@ llvm:skip:skip-stack-guard-page.wast:* # Spec running forever or (signal: 4, SIG
llvm:skip:linking.wast:236 # terminating with uncaught exception of type WasmTrap
llvm:skip:linking.wast:248 # terminating with uncaught exception of type WasmTrap
llvm:fail:i32.wast:243 # AssertReturn - result I32(270618959) ("0x1021514f") does not match expected I32(32) ("0x20")
llvm:fail:i32.wast:252 # AssertReturn - result I32(270618976) ("0x10215160") does not match expected I32(32) ("0x20")
llvm:fail:i64.wast:243 # AssertReturn - result I64(4565586415) ("0x1102151ef") does not match expected I64(64) ("0x40")
llvm:fail:i64.wast:252 # AssertReturn - result I64(4565586400) ("0x1102151e0") does not match expected I64(64) ("0x40")
llvm:fail:f32.wast:1621 # AssertReturn - result F32(0) ("0x0") does not match expected F32(2147483648) ("0x80000000")
llvm:fail:f32.wast:2020 # AssertReturn - result F32(2147483648) ("0x80000000") does not match expected F32(0) ("0x0")
llvm:fail:f64.wast:1621 # AssertReturn - result F64(0) ("0x0") does not match expected F64(9223372036854775808) ("0x8000000000000000")
llvm:fail:f64.wast:2020 # AssertReturn - result F64(9223372036854775808) ("0x8000000000000000") does not match expected F64(0) ("0x0")
llvm:fail:i32.wast:243 # AssertReturn - result I32(283816271) ("0x10eab14f") does not match expected I32(32) ("0x20")
llvm:fail:i32.wast:252 # AssertReturn - result I32(283816288) ("0x10eab160") does not match expected I32(32) ("0x20")
llvm:fail:i64.wast:243 # AssertReturn - result I64(4578783727) ("0x110eab1ef") does not match expected I64(64) ("0x40")
llvm:fail:i64.wast:252 # AssertReturn - result I64(4578783712) ("0x110eab1e0") does not match expected I64(64) ("0x40")
llvm:fail:linking.wast:387 # AssertReturn - result I32(0) ("0x0") does not match expected I32(104) ("0x68")
llvm:fail:linking.wast:388 # AssertReturn - Call failed RuntimeError: WebAssembly trap occurred during runtime: incorrect `call_indirect` signature
llvm:fail:load.wast:201 # AssertReturn - result I32(272117791) ("0x1038301f") does not match expected I32(32) ("0x20")
llvm:fail:load.wast:201 # AssertReturn - result I32(285315103) ("0x1101901f") does not match expected I32(32) ("0x20")
# LLVM Windows
llvm:skip:address.wast:*:windows
@ -1102,6 +1106,7 @@ singlepass:fail:exports.wast:167 # Module - caught panic Any
singlepass:fail:exports.wast:168 # Module - caught panic Any
singlepass:fail:exports.wast:169 # Module - caught panic Any
singlepass:fail:exports.wast:170 # Module - caught panic Any
singlepass:fail:f32.wast:1620 # AssertReturn - result F32(0) ("0x0") does not match expected F32(2147483648) ("0x80000000")
singlepass:fail:f32.wast:1652 # "AssertReturnArithmeticNan" - value is not arithmetic nan F32(NaN)
singlepass:fail:f32.wast:1654 # "AssertReturnArithmeticNan" - value is not arithmetic nan F32(NaN)
singlepass:fail:f32.wast:1656 # "AssertReturnArithmeticNan" - value is not arithmetic nan F32(NaN)
@ -1206,6 +1211,7 @@ singlepass:fail:f32.wast:2013 # "AssertReturnArithmeticNan" - value is not arith
singlepass:fail:f32.wast:2014 # "AssertReturnArithmeticNan" - value is not arithmetic nan F32(NaN)
singlepass:fail:f32.wast:2017 # "AssertReturnArithmeticNan" - value is not arithmetic nan F32(NaN)
singlepass:fail:f32.wast:2018 # "AssertReturnArithmeticNan" - value is not arithmetic nan F32(NaN)
singlepass:fail:f32.wast:2021 # AssertReturn - result F32(2147483648) ("0x80000000") does not match expected F32(0) ("0x0")
singlepass:fail:f32.wast:2052 # "AssertReturnArithmeticNan" - value is not arithmetic nan F32(NaN)
singlepass:fail:f32.wast:2054 # "AssertReturnArithmeticNan" - value is not arithmetic nan F32(NaN)
singlepass:fail:f32.wast:2056 # "AssertReturnArithmeticNan" - value is not arithmetic nan F32(NaN)
@ -1310,6 +1316,7 @@ singlepass:fail:f32.wast:2413 # "AssertReturnArithmeticNan" - value is not arith
singlepass:fail:f32.wast:2414 # "AssertReturnArithmeticNan" - value is not arithmetic nan F32(NaN)
singlepass:fail:f32.wast:2417 # "AssertReturnArithmeticNan" - value is not arithmetic nan F32(NaN)
singlepass:fail:f32.wast:2418 # "AssertReturnArithmeticNan" - value is not arithmetic nan F32(NaN)
singlepass:fail:f64.wast:1620 # AssertReturn - result F64(0) ("0x0") does not match expected F64(9223372036854775808) ("0x8000000000000000")
singlepass:fail:f64.wast:1652 # "AssertReturnArithmeticNan" - value is not arithmetic nan F64(NaN)
singlepass:fail:f64.wast:1654 # "AssertReturnArithmeticNan" - value is not arithmetic nan F64(NaN)
singlepass:fail:f64.wast:1656 # "AssertReturnArithmeticNan" - value is not arithmetic nan F64(NaN)
@ -1414,6 +1421,7 @@ singlepass:fail:f64.wast:2013 # "AssertReturnArithmeticNan" - value is not arith
singlepass:fail:f64.wast:2014 # "AssertReturnArithmeticNan" - value is not arithmetic nan F64(NaN)
singlepass:fail:f64.wast:2017 # "AssertReturnArithmeticNan" - value is not arithmetic nan F64(NaN)
singlepass:fail:f64.wast:2018 # "AssertReturnArithmeticNan" - value is not arithmetic nan F64(NaN)
singlepass:fail:f64.wast:2021 # AssertReturn - result F64(9223372036854775808) ("0x8000000000000000") does not match expected F64(0) ("0x0")
singlepass:fail:f64.wast:2052 # "AssertReturnArithmeticNan" - value is not arithmetic nan F64(NaN)
singlepass:fail:f64.wast:2054 # "AssertReturnArithmeticNan" - value is not arithmetic nan F64(NaN)
singlepass:fail:f64.wast:2056 # "AssertReturnArithmeticNan" - value is not arithmetic nan F64(NaN)

View File

@ -291,10 +291,9 @@ mod tests {
Ok(values) => {
for (i, v) in values.iter().enumerate() {
let expected_value =
convert_value(*expected.get(i).unwrap());
if *v != expected_value
&& !(*v != *v && expected_value != expected_value)
{
convert_wabt_value(*expected.get(i).unwrap());
let v = convert_wasmer_value(v.clone());
if v != expected_value {
test_report.add_failure(SpecFailure {
file: filename.to_string(),
line,
@ -968,6 +967,35 @@ mod tests {
}
}
#[derive(Debug, Clone, Eq, PartialEq)]
pub enum SpectestValue {
I32(i32),
I64(i64),
F32(u32),
F64(u64),
V128(u128),
}
fn convert_wasmer_value(other: wasmer_runtime_core::types::Value) -> SpectestValue {
match other {
wasmer_runtime_core::types::Value::I32(v) => SpectestValue::I32(v),
wasmer_runtime_core::types::Value::I64(v) => SpectestValue::I64(v),
wasmer_runtime_core::types::Value::F32(v) => SpectestValue::F32(v.to_bits()),
wasmer_runtime_core::types::Value::F64(v) => SpectestValue::F64(v.to_bits()),
wasmer_runtime_core::types::Value::V128(v) => SpectestValue::V128(v),
}
}
fn convert_wabt_value(other: Value<f32, f64>) -> SpectestValue {
match other {
Value::I32(v) => SpectestValue::I32(v),
Value::I64(v) => SpectestValue::I64(v),
Value::F32(v) => SpectestValue::F32(v.to_bits()),
Value::F64(v) => SpectestValue::F64(v.to_bits()),
Value::V128(v) => SpectestValue::V128(v),
}
}
fn convert_value(other: Value<f32, f64>) -> wasmer_runtime_core::types::Value {
match other {
Value::I32(v) => wasmer_runtime_core::types::Value::I32(v),
@ -978,13 +1006,13 @@ mod tests {
}
}
fn to_hex(v: wasmer_runtime_core::types::Value) -> String {
fn to_hex(v: SpectestValue) -> String {
match v {
wasmer_runtime_core::types::Value::I32(v) => format!("{:#x}", v),
wasmer_runtime_core::types::Value::I64(v) => format!("{:#x}", v),
wasmer_runtime_core::types::Value::F32(v) => format!("{:#x}", v.to_bits()),
wasmer_runtime_core::types::Value::F64(v) => format!("{:#x}", v.to_bits()),
wasmer_runtime_core::types::Value::V128(v) => format!("{:#x}", v),
SpectestValue::I32(v) => format!("{:#x}", v),
SpectestValue::I64(v) => format!("{:#x}", v),
SpectestValue::F32(v) => format!("{:#x}", v),
SpectestValue::F64(v) => format!("{:#x}", v),
SpectestValue::V128(v) => format!("{:#x}", v),
}
}