Mercurial > hg > truffle
annotate test/runtime/8024804/RegisterNatives.java @ 13370:3e67710a6d08
SchedulePhase: remove old memory aware scheudling
author | Bernhard Urban <bernhard.urban@jku.at> |
---|---|
date | Tue, 17 Dec 2013 21:39:01 +0100 |
parents | d248425bcfe8 |
children | 7a58803b5069 |
rev | line source |
---|---|
12934
d248425bcfe8
8024804: Crash when InterfaceMethodref resolves to Object.registerNatives
hseigel
parents:
diff
changeset
|
1 /* |
d248425bcfe8
8024804: Crash when InterfaceMethodref resolves to Object.registerNatives
hseigel
parents:
diff
changeset
|
2 * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. |
d248425bcfe8
8024804: Crash when InterfaceMethodref resolves to Object.registerNatives
hseigel
parents:
diff
changeset
|
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
d248425bcfe8
8024804: Crash when InterfaceMethodref resolves to Object.registerNatives
hseigel
parents:
diff
changeset
|
4 * |
d248425bcfe8
8024804: Crash when InterfaceMethodref resolves to Object.registerNatives
hseigel
parents:
diff
changeset
|
5 * This code is free software; you can redistribute it and/or modify it |
d248425bcfe8
8024804: Crash when InterfaceMethodref resolves to Object.registerNatives
hseigel
parents:
diff
changeset
|
6 * under the terms of the GNU General Public License version 2 only, as |
d248425bcfe8
8024804: Crash when InterfaceMethodref resolves to Object.registerNatives
hseigel
parents:
diff
changeset
|
7 * published by the Free Software Foundation. |
d248425bcfe8
8024804: Crash when InterfaceMethodref resolves to Object.registerNatives
hseigel
parents:
diff
changeset
|
8 * |
d248425bcfe8
8024804: Crash when InterfaceMethodref resolves to Object.registerNatives
hseigel
parents:
diff
changeset
|
9 * This code is distributed in the hope that it will be useful, but WITHOUT |
d248425bcfe8
8024804: Crash when InterfaceMethodref resolves to Object.registerNatives
hseigel
parents:
diff
changeset
|
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
d248425bcfe8
8024804: Crash when InterfaceMethodref resolves to Object.registerNatives
hseigel
parents:
diff
changeset
|
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
d248425bcfe8
8024804: Crash when InterfaceMethodref resolves to Object.registerNatives
hseigel
parents:
diff
changeset
|
12 * version 2 for more details (a copy is included in the LICENSE file that |
d248425bcfe8
8024804: Crash when InterfaceMethodref resolves to Object.registerNatives
hseigel
parents:
diff
changeset
|
13 * accompanied this code). |
d248425bcfe8
8024804: Crash when InterfaceMethodref resolves to Object.registerNatives
hseigel
parents:
diff
changeset
|
14 * |
d248425bcfe8
8024804: Crash when InterfaceMethodref resolves to Object.registerNatives
hseigel
parents:
diff
changeset
|
15 * You should have received a copy of the GNU General Public License version |
d248425bcfe8
8024804: Crash when InterfaceMethodref resolves to Object.registerNatives
hseigel
parents:
diff
changeset
|
16 * 2 along with this work; if not, write to the Free Software Foundation, |
d248425bcfe8
8024804: Crash when InterfaceMethodref resolves to Object.registerNatives
hseigel
parents:
diff
changeset
|
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
d248425bcfe8
8024804: Crash when InterfaceMethodref resolves to Object.registerNatives
hseigel
parents:
diff
changeset
|
18 * |
d248425bcfe8
8024804: Crash when InterfaceMethodref resolves to Object.registerNatives
hseigel
parents:
diff
changeset
|
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
d248425bcfe8
8024804: Crash when InterfaceMethodref resolves to Object.registerNatives
hseigel
parents:
diff
changeset
|
20 * or visit www.oracle.com if you need additional information or have any |
d248425bcfe8
8024804: Crash when InterfaceMethodref resolves to Object.registerNatives
hseigel
parents:
diff
changeset
|
21 * questions. |
d248425bcfe8
8024804: Crash when InterfaceMethodref resolves to Object.registerNatives
hseigel
parents:
diff
changeset
|
22 */ |
d248425bcfe8
8024804: Crash when InterfaceMethodref resolves to Object.registerNatives
hseigel
parents:
diff
changeset
|
23 |
d248425bcfe8
8024804: Crash when InterfaceMethodref resolves to Object.registerNatives
hseigel
parents:
diff
changeset
|
24 /* |
d248425bcfe8
8024804: Crash when InterfaceMethodref resolves to Object.registerNatives
hseigel
parents:
diff
changeset
|
25 * @test |
d248425bcfe8
8024804: Crash when InterfaceMethodref resolves to Object.registerNatives
hseigel
parents:
diff
changeset
|
26 * @bug 8024804 |
d248425bcfe8
8024804: Crash when InterfaceMethodref resolves to Object.registerNatives
hseigel
parents:
diff
changeset
|
27 * @summary registerNatives() interface resolution should receive IAE |
d248425bcfe8
8024804: Crash when InterfaceMethodref resolves to Object.registerNatives
hseigel
parents:
diff
changeset
|
28 * @run main RegisterNatives |
d248425bcfe8
8024804: Crash when InterfaceMethodref resolves to Object.registerNatives
hseigel
parents:
diff
changeset
|
29 */ |
d248425bcfe8
8024804: Crash when InterfaceMethodref resolves to Object.registerNatives
hseigel
parents:
diff
changeset
|
30 public class RegisterNatives { |
d248425bcfe8
8024804: Crash when InterfaceMethodref resolves to Object.registerNatives
hseigel
parents:
diff
changeset
|
31 interface I { void registerNatives(); } |
d248425bcfe8
8024804: Crash when InterfaceMethodref resolves to Object.registerNatives
hseigel
parents:
diff
changeset
|
32 interface J extends I {} |
d248425bcfe8
8024804: Crash when InterfaceMethodref resolves to Object.registerNatives
hseigel
parents:
diff
changeset
|
33 static class B implements J { public void registerNatives() { System.out.println("B"); } } |
d248425bcfe8
8024804: Crash when InterfaceMethodref resolves to Object.registerNatives
hseigel
parents:
diff
changeset
|
34 public static void main(String... args) { |
d248425bcfe8
8024804: Crash when InterfaceMethodref resolves to Object.registerNatives
hseigel
parents:
diff
changeset
|
35 System.out.println("Regression test for JDK-8024804, crash when InterfaceMethodref resolves to Object.registerNatives\n"); |
d248425bcfe8
8024804: Crash when InterfaceMethodref resolves to Object.registerNatives
hseigel
parents:
diff
changeset
|
36 J val = new B(); |
d248425bcfe8
8024804: Crash when InterfaceMethodref resolves to Object.registerNatives
hseigel
parents:
diff
changeset
|
37 try { |
d248425bcfe8
8024804: Crash when InterfaceMethodref resolves to Object.registerNatives
hseigel
parents:
diff
changeset
|
38 val.registerNatives(); |
d248425bcfe8
8024804: Crash when InterfaceMethodref resolves to Object.registerNatives
hseigel
parents:
diff
changeset
|
39 } catch (IllegalAccessError e) { |
d248425bcfe8
8024804: Crash when InterfaceMethodref resolves to Object.registerNatives
hseigel
parents:
diff
changeset
|
40 System.out.println("TEST PASSES - according to current JVM spec, IAE expected\n"); |
d248425bcfe8
8024804: Crash when InterfaceMethodref resolves to Object.registerNatives
hseigel
parents:
diff
changeset
|
41 return; |
d248425bcfe8
8024804: Crash when InterfaceMethodref resolves to Object.registerNatives
hseigel
parents:
diff
changeset
|
42 } |
d248425bcfe8
8024804: Crash when InterfaceMethodref resolves to Object.registerNatives
hseigel
parents:
diff
changeset
|
43 System.out.println("TEST FAILS - no IAE resulted\n"); |
d248425bcfe8
8024804: Crash when InterfaceMethodref resolves to Object.registerNatives
hseigel
parents:
diff
changeset
|
44 System.exit(1); |
d248425bcfe8
8024804: Crash when InterfaceMethodref resolves to Object.registerNatives
hseigel
parents:
diff
changeset
|
45 } |
d248425bcfe8
8024804: Crash when InterfaceMethodref resolves to Object.registerNatives
hseigel
parents:
diff
changeset
|
46 } |