hannesw@1718: /* hannesw@1718: * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. hannesw@1718: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. hannesw@1718: * hannesw@1718: * This code is free software; you can redistribute it and/or modify it hannesw@1718: * under the terms of the GNU General Public License version 2 only, as hannesw@1718: * published by the Free Software Foundation. hannesw@1718: * hannesw@1718: * This code is distributed in the hope that it will be useful, but WITHOUT hannesw@1718: * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or hannesw@1718: * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License hannesw@1718: * version 2 for more details (a copy is included in the LICENSE file that hannesw@1718: * accompanied this code). hannesw@1718: * hannesw@1718: * You should have received a copy of the GNU General Public License version hannesw@1718: * 2 along with this work; if not, write to the Free Software Foundation, hannesw@1718: * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. hannesw@1718: * hannesw@1718: * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA hannesw@1718: * or visit www.oracle.com if you need additional information or have any hannesw@1718: * questions. hannesw@1718: */ hannesw@1718: hannesw@1718: /** hannesw@1718: * JDK-8144131: ArrayData.getInt implementations do not convert to int32 hannesw@1718: * hannesw@1718: * @test hannesw@1718: * @run hannesw@1718: */ hannesw@1718: hannesw@1718: var doubleArray = [97912312397.234, -182374983434.56]; hannesw@1718: var doubleArrayResults = [-871935411, -1986357002]; hannesw@1718: hannesw@1720: // Make sure array uses double array data hannesw@1718: Assert.assertEquals(doubleArray[0].getClass(), java.lang.Double.class); hannesw@1718: hannesw@1718: function testBinaryOp(array, index, expected) { hannesw@1718: Assert.assertEquals(array[index] & 0xffffffff, expected); hannesw@1718: } hannesw@1718: hannesw@1718: for (var i = 0; i < doubleArray.length; i++) { hannesw@1718: testBinaryOp(doubleArray, i, doubleArrayResults[i]); hannesw@1718: } hannesw@1718: