attila@446: /* attila@446: * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved. attila@446: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. attila@446: * attila@446: * This code is free software; you can redistribute it and/or modify it attila@446: * under the terms of the GNU General Public License version 2 only, as attila@446: * published by the Free Software Foundation. attila@446: * attila@446: * This code is distributed in the hope that it will be useful, but WITHOUT attila@446: * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or attila@446: * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License attila@446: * version 2 for more details (a copy is included in the LICENSE file that attila@446: * accompanied this code). attila@446: * attila@446: * You should have received a copy of the GNU General Public License version attila@446: * 2 along with this work; if not, write to the Free Software Foundation, attila@446: * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. attila@446: * attila@446: * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA attila@446: * or visit www.oracle.com if you need additional information or have any attila@446: * questions. attila@446: */ attila@446: attila@446: /** attila@446: * JDK-8020357: Return range error for too big native array buffers attila@446: * attila@446: * @test attila@446: * @run attila@446: */ attila@446: attila@446: var UNSIGNED_INT_BITS = 31 attila@446: var BYTES_PER_INT_32 = 4 attila@446: attila@446: var limit = Math.pow(2, UNSIGNED_INT_BITS)/BYTES_PER_INT_32 attila@446: attila@446: // A value over the limit should throw a RangeError. attila@446: try { attila@446: Int32Array(limit) attila@446: } catch(e) { attila@446: print(e) attila@446: }