annotate test/compiler/7090976/Test7090976.java @ 21188:2acf1d23d3af

Move PhiResolver from c.o.g.compiler.gen to c.o.g.lir.gen.
author Josef Eisl <josef.eisl@jku.at>
date Mon, 20 Apr 2015 14:24:55 +0200
parents f067b4e0e04b
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
4871
f067b4e0e04b 7090976: Eclipse/CDT causes a JVM crash while indexing C++ code
roland
parents:
diff changeset
1 /*
f067b4e0e04b 7090976: Eclipse/CDT causes a JVM crash while indexing C++ code
roland
parents:
diff changeset
2 * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
f067b4e0e04b 7090976: Eclipse/CDT causes a JVM crash while indexing C++ code
roland
parents:
diff changeset
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
f067b4e0e04b 7090976: Eclipse/CDT causes a JVM crash while indexing C++ code
roland
parents:
diff changeset
4 *
f067b4e0e04b 7090976: Eclipse/CDT causes a JVM crash while indexing C++ code
roland
parents:
diff changeset
5 * This code is free software; you can redistribute it and/or modify it
f067b4e0e04b 7090976: Eclipse/CDT causes a JVM crash while indexing C++ code
roland
parents:
diff changeset
6 * under the terms of the GNU General Public License version 2 only, as
f067b4e0e04b 7090976: Eclipse/CDT causes a JVM crash while indexing C++ code
roland
parents:
diff changeset
7 * published by the Free Software Foundation.
f067b4e0e04b 7090976: Eclipse/CDT causes a JVM crash while indexing C++ code
roland
parents:
diff changeset
8 *
f067b4e0e04b 7090976: Eclipse/CDT causes a JVM crash while indexing C++ code
roland
parents:
diff changeset
9 * This code is distributed in the hope that it will be useful, but WITHOUT
f067b4e0e04b 7090976: Eclipse/CDT causes a JVM crash while indexing C++ code
roland
parents:
diff changeset
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
f067b4e0e04b 7090976: Eclipse/CDT causes a JVM crash while indexing C++ code
roland
parents:
diff changeset
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
f067b4e0e04b 7090976: Eclipse/CDT causes a JVM crash while indexing C++ code
roland
parents:
diff changeset
12 * version 2 for more details (a copy is included in the LICENSE file that
f067b4e0e04b 7090976: Eclipse/CDT causes a JVM crash while indexing C++ code
roland
parents:
diff changeset
13 * accompanied this code).
f067b4e0e04b 7090976: Eclipse/CDT causes a JVM crash while indexing C++ code
roland
parents:
diff changeset
14 *
f067b4e0e04b 7090976: Eclipse/CDT causes a JVM crash while indexing C++ code
roland
parents:
diff changeset
15 * You should have received a copy of the GNU General Public License version
f067b4e0e04b 7090976: Eclipse/CDT causes a JVM crash while indexing C++ code
roland
parents:
diff changeset
16 * 2 along with this work; if not, write to the Free Software Foundation,
f067b4e0e04b 7090976: Eclipse/CDT causes a JVM crash while indexing C++ code
roland
parents:
diff changeset
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
f067b4e0e04b 7090976: Eclipse/CDT causes a JVM crash while indexing C++ code
roland
parents:
diff changeset
18 *
f067b4e0e04b 7090976: Eclipse/CDT causes a JVM crash while indexing C++ code
roland
parents:
diff changeset
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
f067b4e0e04b 7090976: Eclipse/CDT causes a JVM crash while indexing C++ code
roland
parents:
diff changeset
20 * or visit www.oracle.com if you need additional information or have any
f067b4e0e04b 7090976: Eclipse/CDT causes a JVM crash while indexing C++ code
roland
parents:
diff changeset
21 * questions.
f067b4e0e04b 7090976: Eclipse/CDT causes a JVM crash while indexing C++ code
roland
parents:
diff changeset
22 *
f067b4e0e04b 7090976: Eclipse/CDT causes a JVM crash while indexing C++ code
roland
parents:
diff changeset
23 */
f067b4e0e04b 7090976: Eclipse/CDT causes a JVM crash while indexing C++ code
roland
parents:
diff changeset
24
f067b4e0e04b 7090976: Eclipse/CDT causes a JVM crash while indexing C++ code
roland
parents:
diff changeset
25 /**
f067b4e0e04b 7090976: Eclipse/CDT causes a JVM crash while indexing C++ code
roland
parents:
diff changeset
26 * @test
f067b4e0e04b 7090976: Eclipse/CDT causes a JVM crash while indexing C++ code
roland
parents:
diff changeset
27 * @bug 7090976
f067b4e0e04b 7090976: Eclipse/CDT causes a JVM crash while indexing C++ code
roland
parents:
diff changeset
28 * @summary Eclipse/CDT causes a JVM crash while indexing C++ code
f067b4e0e04b 7090976: Eclipse/CDT causes a JVM crash while indexing C++ code
roland
parents:
diff changeset
29 *
f067b4e0e04b 7090976: Eclipse/CDT causes a JVM crash while indexing C++ code
roland
parents:
diff changeset
30 * @run main/othervm -XX:-BackgroundCompilation -XX:-UseOnStackReplacement Test7090976
f067b4e0e04b 7090976: Eclipse/CDT causes a JVM crash while indexing C++ code
roland
parents:
diff changeset
31 */
f067b4e0e04b 7090976: Eclipse/CDT causes a JVM crash while indexing C++ code
roland
parents:
diff changeset
32
f067b4e0e04b 7090976: Eclipse/CDT causes a JVM crash while indexing C++ code
roland
parents:
diff changeset
33 public class Test7090976 {
f067b4e0e04b 7090976: Eclipse/CDT causes a JVM crash while indexing C++ code
roland
parents:
diff changeset
34
f067b4e0e04b 7090976: Eclipse/CDT causes a JVM crash while indexing C++ code
roland
parents:
diff changeset
35 static interface I1 {
f067b4e0e04b 7090976: Eclipse/CDT causes a JVM crash while indexing C++ code
roland
parents:
diff changeset
36 public void m1();
f067b4e0e04b 7090976: Eclipse/CDT causes a JVM crash while indexing C++ code
roland
parents:
diff changeset
37 };
f067b4e0e04b 7090976: Eclipse/CDT causes a JVM crash while indexing C++ code
roland
parents:
diff changeset
38
f067b4e0e04b 7090976: Eclipse/CDT causes a JVM crash while indexing C++ code
roland
parents:
diff changeset
39 static interface I2 {
f067b4e0e04b 7090976: Eclipse/CDT causes a JVM crash while indexing C++ code
roland
parents:
diff changeset
40 public void m2();
f067b4e0e04b 7090976: Eclipse/CDT causes a JVM crash while indexing C++ code
roland
parents:
diff changeset
41 };
f067b4e0e04b 7090976: Eclipse/CDT causes a JVM crash while indexing C++ code
roland
parents:
diff changeset
42
f067b4e0e04b 7090976: Eclipse/CDT causes a JVM crash while indexing C++ code
roland
parents:
diff changeset
43 static interface I extends I1,I2 {
f067b4e0e04b 7090976: Eclipse/CDT causes a JVM crash while indexing C++ code
roland
parents:
diff changeset
44 }
f067b4e0e04b 7090976: Eclipse/CDT causes a JVM crash while indexing C++ code
roland
parents:
diff changeset
45
f067b4e0e04b 7090976: Eclipse/CDT causes a JVM crash while indexing C++ code
roland
parents:
diff changeset
46 static class A implements I1 {
f067b4e0e04b 7090976: Eclipse/CDT causes a JVM crash while indexing C++ code
roland
parents:
diff changeset
47 int v = 0;
f067b4e0e04b 7090976: Eclipse/CDT causes a JVM crash while indexing C++ code
roland
parents:
diff changeset
48 int v2;
f067b4e0e04b 7090976: Eclipse/CDT causes a JVM crash while indexing C++ code
roland
parents:
diff changeset
49
f067b4e0e04b 7090976: Eclipse/CDT causes a JVM crash while indexing C++ code
roland
parents:
diff changeset
50 public void m1() {
f067b4e0e04b 7090976: Eclipse/CDT causes a JVM crash while indexing C++ code
roland
parents:
diff changeset
51 v2 = v;
f067b4e0e04b 7090976: Eclipse/CDT causes a JVM crash while indexing C++ code
roland
parents:
diff changeset
52 }
f067b4e0e04b 7090976: Eclipse/CDT causes a JVM crash while indexing C++ code
roland
parents:
diff changeset
53 }
f067b4e0e04b 7090976: Eclipse/CDT causes a JVM crash while indexing C++ code
roland
parents:
diff changeset
54
f067b4e0e04b 7090976: Eclipse/CDT causes a JVM crash while indexing C++ code
roland
parents:
diff changeset
55 static class B implements I2 {
f067b4e0e04b 7090976: Eclipse/CDT causes a JVM crash while indexing C++ code
roland
parents:
diff changeset
56 Object v = new Object();
f067b4e0e04b 7090976: Eclipse/CDT causes a JVM crash while indexing C++ code
roland
parents:
diff changeset
57 Object v2;
f067b4e0e04b 7090976: Eclipse/CDT causes a JVM crash while indexing C++ code
roland
parents:
diff changeset
58
f067b4e0e04b 7090976: Eclipse/CDT causes a JVM crash while indexing C++ code
roland
parents:
diff changeset
59 public void m2() {
f067b4e0e04b 7090976: Eclipse/CDT causes a JVM crash while indexing C++ code
roland
parents:
diff changeset
60 v2 = v;
f067b4e0e04b 7090976: Eclipse/CDT causes a JVM crash while indexing C++ code
roland
parents:
diff changeset
61 }
f067b4e0e04b 7090976: Eclipse/CDT causes a JVM crash while indexing C++ code
roland
parents:
diff changeset
62 }
f067b4e0e04b 7090976: Eclipse/CDT causes a JVM crash while indexing C++ code
roland
parents:
diff changeset
63
f067b4e0e04b 7090976: Eclipse/CDT causes a JVM crash while indexing C++ code
roland
parents:
diff changeset
64 private void test(A a)
f067b4e0e04b 7090976: Eclipse/CDT causes a JVM crash while indexing C++ code
roland
parents:
diff changeset
65 {
f067b4e0e04b 7090976: Eclipse/CDT causes a JVM crash while indexing C++ code
roland
parents:
diff changeset
66 if (a instanceof I) {
f067b4e0e04b 7090976: Eclipse/CDT causes a JVM crash while indexing C++ code
roland
parents:
diff changeset
67 I i = (I)a;
f067b4e0e04b 7090976: Eclipse/CDT causes a JVM crash while indexing C++ code
roland
parents:
diff changeset
68 i.m1();
f067b4e0e04b 7090976: Eclipse/CDT causes a JVM crash while indexing C++ code
roland
parents:
diff changeset
69 i.m2();
f067b4e0e04b 7090976: Eclipse/CDT causes a JVM crash while indexing C++ code
roland
parents:
diff changeset
70 }
f067b4e0e04b 7090976: Eclipse/CDT causes a JVM crash while indexing C++ code
roland
parents:
diff changeset
71 }
f067b4e0e04b 7090976: Eclipse/CDT causes a JVM crash while indexing C++ code
roland
parents:
diff changeset
72
f067b4e0e04b 7090976: Eclipse/CDT causes a JVM crash while indexing C++ code
roland
parents:
diff changeset
73 public static void main(String[] args)
f067b4e0e04b 7090976: Eclipse/CDT causes a JVM crash while indexing C++ code
roland
parents:
diff changeset
74 {
f067b4e0e04b 7090976: Eclipse/CDT causes a JVM crash while indexing C++ code
roland
parents:
diff changeset
75 Test7090976 t = new Test7090976();
f067b4e0e04b 7090976: Eclipse/CDT causes a JVM crash while indexing C++ code
roland
parents:
diff changeset
76 A a = new A();
f067b4e0e04b 7090976: Eclipse/CDT causes a JVM crash while indexing C++ code
roland
parents:
diff changeset
77 B b = new B();
f067b4e0e04b 7090976: Eclipse/CDT causes a JVM crash while indexing C++ code
roland
parents:
diff changeset
78 for (int i = 0; i < 10000; i++) {
f067b4e0e04b 7090976: Eclipse/CDT causes a JVM crash while indexing C++ code
roland
parents:
diff changeset
79 t.test(a);
f067b4e0e04b 7090976: Eclipse/CDT causes a JVM crash while indexing C++ code
roland
parents:
diff changeset
80 }
f067b4e0e04b 7090976: Eclipse/CDT causes a JVM crash while indexing C++ code
roland
parents:
diff changeset
81 }
f067b4e0e04b 7090976: Eclipse/CDT causes a JVM crash while indexing C++ code
roland
parents:
diff changeset
82 }