# HG changeset patch # User Jaroslav Tulach # Date 1452776967 -3600 # Node ID 17fe5ef92696fe217c4085a530e30bc634f6bb6f # Parent 9aded7e1e122cd12668e6a16ad1ccf3a00828667 More tests with doubles in the TCK to verify IEEE754 compliance diff -r 9aded7e1e122 -r 17fe5ef92696 truffle/com.oracle.truffle.tck/src/com/oracle/truffle/tck/TruffleTCK.java --- a/truffle/com.oracle.truffle.tck/src/com/oracle/truffle/tck/TruffleTCK.java Thu Jan 07 16:06:31 2016 +0100 +++ b/truffle/com.oracle.truffle.tck/src/com/oracle/truffle/tck/TruffleTCK.java Thu Jan 14 14:09:27 2016 +0100 @@ -581,6 +581,62 @@ doPlusWithDouble(a, b); } + @Test + public void testPlusWithDoubleMaxMinInt() throws Exception { + double a = Integer.MAX_VALUE; + double b = Integer.MIN_VALUE; + + doPlusWithDouble(a, b); + } + + @Test + public void testPlusWithDoubleMinIntMinusOne() throws Exception { + double a = -1; + double b = Integer.MIN_VALUE; + + doPlusWithDouble(a, b); + } + + @Test + public void testPlusWithDoubleMaxIntPlusOne() throws Exception { + double a = 1; + double b = Integer.MAX_VALUE; + + doPlusWithDouble(a, b); + } + + @Test + public void testPlusWithDoubleNaNPlusNegInf() throws Exception { + double a = Double.NaN; + double b = Double.NEGATIVE_INFINITY; + + doPlusWithDouble(a, b); + } + + @Test + public void testPlusWithDoubleNaNPlusPosInf() throws Exception { + double a = Double.NaN; + double b = Double.POSITIVE_INFINITY; + + doPlusWithDouble(a, b); + } + + @Test + public void testPlusWithDoubleMaxIntPlusPosInf() throws Exception { + double a = Integer.MAX_VALUE; + double b = Double.POSITIVE_INFINITY; + + doPlusWithDouble(a, b); + } + + @Test + public void testPlusWithDoubleMaxIntPlusNegInf() throws Exception { + double a = Integer.MAX_VALUE; + double b = Double.NEGATIVE_INFINITY; + + doPlusWithDouble(a, b); + } + private void doPlusWithDouble(double a, double b) throws Exception { PolyglotEngine.Value plus = findGlobalSymbol(plus(double.class, double.class));