NaN is written in lowercase in Wasm text format.

This commit is contained in:
Volker Berlin 2019-07-14 17:24:39 +02:00
parent 588ac6db47
commit abeec6cca4
2 changed files with 14 additions and 2 deletions

View File

@ -386,10 +386,10 @@ public class TextModuleWriter extends ModuleWriter {
methodOutput.append( valueType ).append( ".const " );
switch( valueType ) {
case f32:
methodOutput.append( Float.toHexString( value.floatValue() ) ).append( " ;;" ).append( value );
methodOutput.append( Float.toHexString( value.floatValue() ).toLowerCase() ).append( " ;;" ).append( value );
break;
case f64:
methodOutput.append( Double.toHexString( value.doubleValue() ) ).append( " ;;" ).append( value );
methodOutput.append( Double.toHexString( value.doubleValue() ).toLowerCase() ).append( " ;;" ).append( value );
break;
default:
methodOutput.append( value );

View File

@ -64,6 +64,8 @@ public class MathOperations extends AbstractBaseTest {
addParam( list, script, "shortInc", (short)-32768 );
addParam( list, script, "charOp", (char)0xFFFF );
addParam( list, script, "castNumberOverflow" );
addParam( list, script, "doubleNaN" );
addParam( list, script, "floatNaN" );
}
rule.setTestParameters( list );
return list;
@ -291,5 +293,15 @@ public class MathOperations extends AbstractBaseTest {
return result;
}
@Export
static double doubleNaN() {
return Double.NaN;
}
@Export
static float floatNaN() {
return Float.NaN;
}
}
}