1/* 2 * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved. 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 * 5 * This code is free software; you can redistribute it and/or modify it 6 * under the terms of the GNU General Public License version 2 only, as 7 * published by the Free Software Foundation. 8 * 9 * This code is distributed in the hope that it will be useful, but WITHOUT 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 12 * version 2 for more details (a copy is included in the LICENSE file that 13 * accompanied this code). 14 * 15 * You should have received a copy of the GNU General Public License version 16 * 2 along with this work; if not, write to the Free Software Foundation, 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 18 * 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 20 * or visit www.oracle.com if you need additional information or have any 21 * questions. 22 */ 23 24/** 25 * JDK-8012334: ToUint32, ToInt32, and ToUint16 don't conform to spec 26 * 27 * @test 28 * @run 29 */ 30 31 32function test(val) { 33 print(val | 0); 34 print(val >> 0); 35 print(val >>> 0); 36 print(1 >>> val); 37 print(parseInt("10", val)); 38} 39 40test(0); 41test(-0); 42test('Infinity'); 43test('+Infinity'); 44test('-Infinity'); 45test(Number.POSITIVE_INFINITY); 46test(Number.NEGATIVE_INFINITY); 47test(Number.NaN); 48test(Number.MIN_VALUE); 49test(-Number.MIN_VALUE); 50test(1); 51test(-1); 52test(0.1); 53test(-0.1); 54test(1.1); 55test(-1.1); 56test(9223372036854775807); 57test(-9223372036854775808); 58test('9223372036854775807'); 59test('-9223372036854775808'); 60test(2147483647); 61test(2147483648); 62test(2147483649); 63test(-2147483647); 64test(-2147483648); 65test(-2147483649); 66test(4294967295); 67test(4294967296); 68test(4294967297); 69test(-4294967295); 70test(-4294967296); 71test(-4294967297); 72test(1e23); 73test(-1e23); 74test(1e24); 75test(-1e24); 76test(1e25); 77test(-1e25); 78test(1e26); 79test(-1e26); 80 81