test/compiler/6895383/Test.java

Wed, 09 Dec 2009 16:40:45 -0800

author
kvn
date
Wed, 09 Dec 2009 16:40:45 -0800
changeset 1535
f96a1a986f7b
child 1612
acebf2655d3a
permissions
-rw-r--r--

6895383: JCK test throws NPE for method compiled with Escape Analysis
Summary: Add missing checks for MemBar nodes in EA.
Reviewed-by: never

kvn@1535 1 /*
kvn@1535 2 * Copyright 2009 Sun Microsystems, Inc. All Rights Reserved.
kvn@1535 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
kvn@1535 4 *
kvn@1535 5 * This code is free software; you can redistribute it and/or modify it
kvn@1535 6 * under the terms of the GNU General Public License version 2 only, as
kvn@1535 7 * published by the Free Software Foundation.
kvn@1535 8 *
kvn@1535 9 * This code is distributed in the hope that it will be useful, but WITHOUT
kvn@1535 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
kvn@1535 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
kvn@1535 12 * version 2 for more details (a copy is included in the LICENSE file that
kvn@1535 13 * accompanied this code).
kvn@1535 14 *
kvn@1535 15 * You should have received a copy of the GNU General Public License version
kvn@1535 16 * 2 along with this work; if not, write to the Free Software Foundation,
kvn@1535 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
kvn@1535 18 *
kvn@1535 19 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
kvn@1535 20 * CA 95054 USA or visit www.sun.com if you need additional information or
kvn@1535 21 * have any questions.
kvn@1535 22 *
kvn@1535 23 */
kvn@1535 24
kvn@1535 25 /**
kvn@1535 26 * @test
kvn@1535 27 * @bug 6895383
kvn@1535 28 * @summary JCK test throws NPE for method compiled with Escape Analysis
kvn@1535 29 *
kvn@1535 30 * @run main/othervm -Xcomp Test
kvn@1535 31 */
kvn@1535 32
kvn@1535 33 public class Test {
kvn@1535 34 public static void main(String argv[]) {
kvn@1535 35 Test test = new Test();
kvn@1535 36 test.testRemove1_IndexOutOfBounds();
kvn@1535 37 test.testAddAll1_IndexOutOfBoundsException();
kvn@1535 38 }
kvn@1535 39
kvn@1535 40 public void testRemove1_IndexOutOfBounds() {
kvn@1535 41 CopyOnWriteArrayList c = new CopyOnWriteArrayList();
kvn@1535 42 }
kvn@1535 43
kvn@1535 44 public void testAddAll1_IndexOutOfBoundsException() {
kvn@1535 45 try {
kvn@1535 46 CopyOnWriteArrayList c = new CopyOnWriteArrayList();
kvn@1535 47 c.addAll(-1, new LinkedList()); // should throw IndexOutOfBoundsException
kvn@1535 48 } catch (IndexOutOfBoundsException e) {
kvn@1535 49 }
kvn@1535 50 }
kvn@1535 51 }

mercurial