author | lana |
Thu, 23 Feb 2017 17:30:12 +0000 | |
changeset 44011 | 5eea3031ae7b |
parent 41705 | 332239c052cc |
permissions | -rw-r--r-- |
11635
5a16856f871f
7090976: Eclipse/CDT causes a JVM crash while indexing C++ code
roland
parents:
diff
changeset
|
1 |
/* |
5a16856f871f
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. |
5a16856f871f
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. |
5a16856f871f
7090976: Eclipse/CDT causes a JVM crash while indexing C++ code
roland
parents:
diff
changeset
|
4 |
* |
5a16856f871f
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 |
5a16856f871f
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 |
5a16856f871f
7090976: Eclipse/CDT causes a JVM crash while indexing C++ code
roland
parents:
diff
changeset
|
7 |
* published by the Free Software Foundation. |
5a16856f871f
7090976: Eclipse/CDT causes a JVM crash while indexing C++ code
roland
parents:
diff
changeset
|
8 |
* |
5a16856f871f
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 |
5a16856f871f
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 |
5a16856f871f
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 |
5a16856f871f
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 |
5a16856f871f
7090976: Eclipse/CDT causes a JVM crash while indexing C++ code
roland
parents:
diff
changeset
|
13 |
* accompanied this code). |
5a16856f871f
7090976: Eclipse/CDT causes a JVM crash while indexing C++ code
roland
parents:
diff
changeset
|
14 |
* |
5a16856f871f
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 |
5a16856f871f
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, |
5a16856f871f
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. |
5a16856f871f
7090976: Eclipse/CDT causes a JVM crash while indexing C++ code
roland
parents:
diff
changeset
|
18 |
* |
5a16856f871f
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 |
5a16856f871f
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 |
5a16856f871f
7090976: Eclipse/CDT causes a JVM crash while indexing C++ code
roland
parents:
diff
changeset
|
21 |
* questions. |
5a16856f871f
7090976: Eclipse/CDT causes a JVM crash while indexing C++ code
roland
parents:
diff
changeset
|
22 |
*/ |
5a16856f871f
7090976: Eclipse/CDT causes a JVM crash while indexing C++ code
roland
parents:
diff
changeset
|
23 |
|
5a16856f871f
7090976: Eclipse/CDT causes a JVM crash while indexing C++ code
roland
parents:
diff
changeset
|
24 |
/** |
5a16856f871f
7090976: Eclipse/CDT causes a JVM crash while indexing C++ code
roland
parents:
diff
changeset
|
25 |
* @test |
5a16856f871f
7090976: Eclipse/CDT causes a JVM crash while indexing C++ code
roland
parents:
diff
changeset
|
26 |
* @bug 7090976 |
5a16856f871f
7090976: Eclipse/CDT causes a JVM crash while indexing C++ code
roland
parents:
diff
changeset
|
27 |
* @summary Eclipse/CDT causes a JVM crash while indexing C++ code |
5a16856f871f
7090976: Eclipse/CDT causes a JVM crash while indexing C++ code
roland
parents:
diff
changeset
|
28 |
* |
40059 | 29 |
* @run main/othervm -XX:-BackgroundCompilation -XX:-UseOnStackReplacement |
30 |
* compiler.c1.Test7090976 |
|
11635
5a16856f871f
7090976: Eclipse/CDT causes a JVM crash while indexing C++ code
roland
parents:
diff
changeset
|
31 |
*/ |
5a16856f871f
7090976: Eclipse/CDT causes a JVM crash while indexing C++ code
roland
parents:
diff
changeset
|
32 |
|
40059 | 33 |
package compiler.c1; |
34 |
||
11635
5a16856f871f
7090976: Eclipse/CDT causes a JVM crash while indexing C++ code
roland
parents:
diff
changeset
|
35 |
public class Test7090976 { |
5a16856f871f
7090976: Eclipse/CDT causes a JVM crash while indexing C++ code
roland
parents:
diff
changeset
|
36 |
|
5a16856f871f
7090976: Eclipse/CDT causes a JVM crash while indexing C++ code
roland
parents:
diff
changeset
|
37 |
static interface I1 { |
5a16856f871f
7090976: Eclipse/CDT causes a JVM crash while indexing C++ code
roland
parents:
diff
changeset
|
38 |
public void m1(); |
5a16856f871f
7090976: Eclipse/CDT causes a JVM crash while indexing C++ code
roland
parents:
diff
changeset
|
39 |
}; |
5a16856f871f
7090976: Eclipse/CDT causes a JVM crash while indexing C++ code
roland
parents:
diff
changeset
|
40 |
|
5a16856f871f
7090976: Eclipse/CDT causes a JVM crash while indexing C++ code
roland
parents:
diff
changeset
|
41 |
static interface I2 { |
5a16856f871f
7090976: Eclipse/CDT causes a JVM crash while indexing C++ code
roland
parents:
diff
changeset
|
42 |
public void m2(); |
5a16856f871f
7090976: Eclipse/CDT causes a JVM crash while indexing C++ code
roland
parents:
diff
changeset
|
43 |
}; |
5a16856f871f
7090976: Eclipse/CDT causes a JVM crash while indexing C++ code
roland
parents:
diff
changeset
|
44 |
|
5a16856f871f
7090976: Eclipse/CDT causes a JVM crash while indexing C++ code
roland
parents:
diff
changeset
|
45 |
static interface I extends I1,I2 { |
5a16856f871f
7090976: Eclipse/CDT causes a JVM crash while indexing C++ code
roland
parents:
diff
changeset
|
46 |
} |
5a16856f871f
7090976: Eclipse/CDT causes a JVM crash while indexing C++ code
roland
parents:
diff
changeset
|
47 |
|
5a16856f871f
7090976: Eclipse/CDT causes a JVM crash while indexing C++ code
roland
parents:
diff
changeset
|
48 |
static class A implements I1 { |
5a16856f871f
7090976: Eclipse/CDT causes a JVM crash while indexing C++ code
roland
parents:
diff
changeset
|
49 |
int v = 0; |
5a16856f871f
7090976: Eclipse/CDT causes a JVM crash while indexing C++ code
roland
parents:
diff
changeset
|
50 |
int v2; |
5a16856f871f
7090976: Eclipse/CDT causes a JVM crash while indexing C++ code
roland
parents:
diff
changeset
|
51 |
|
5a16856f871f
7090976: Eclipse/CDT causes a JVM crash while indexing C++ code
roland
parents:
diff
changeset
|
52 |
public void m1() { |
5a16856f871f
7090976: Eclipse/CDT causes a JVM crash while indexing C++ code
roland
parents:
diff
changeset
|
53 |
v2 = v; |
5a16856f871f
7090976: Eclipse/CDT causes a JVM crash while indexing C++ code
roland
parents:
diff
changeset
|
54 |
} |
5a16856f871f
7090976: Eclipse/CDT causes a JVM crash while indexing C++ code
roland
parents:
diff
changeset
|
55 |
} |
5a16856f871f
7090976: Eclipse/CDT causes a JVM crash while indexing C++ code
roland
parents:
diff
changeset
|
56 |
|
5a16856f871f
7090976: Eclipse/CDT causes a JVM crash while indexing C++ code
roland
parents:
diff
changeset
|
57 |
static class B implements I2 { |
5a16856f871f
7090976: Eclipse/CDT causes a JVM crash while indexing C++ code
roland
parents:
diff
changeset
|
58 |
Object v = new Object(); |
5a16856f871f
7090976: Eclipse/CDT causes a JVM crash while indexing C++ code
roland
parents:
diff
changeset
|
59 |
Object v2; |
5a16856f871f
7090976: Eclipse/CDT causes a JVM crash while indexing C++ code
roland
parents:
diff
changeset
|
60 |
|
5a16856f871f
7090976: Eclipse/CDT causes a JVM crash while indexing C++ code
roland
parents:
diff
changeset
|
61 |
public void m2() { |
5a16856f871f
7090976: Eclipse/CDT causes a JVM crash while indexing C++ code
roland
parents:
diff
changeset
|
62 |
v2 = v; |
5a16856f871f
7090976: Eclipse/CDT causes a JVM crash while indexing C++ code
roland
parents:
diff
changeset
|
63 |
} |
5a16856f871f
7090976: Eclipse/CDT causes a JVM crash while indexing C++ code
roland
parents:
diff
changeset
|
64 |
} |
5a16856f871f
7090976: Eclipse/CDT causes a JVM crash while indexing C++ code
roland
parents:
diff
changeset
|
65 |
|
5a16856f871f
7090976: Eclipse/CDT causes a JVM crash while indexing C++ code
roland
parents:
diff
changeset
|
66 |
private void test(A a) |
5a16856f871f
7090976: Eclipse/CDT causes a JVM crash while indexing C++ code
roland
parents:
diff
changeset
|
67 |
{ |
5a16856f871f
7090976: Eclipse/CDT causes a JVM crash while indexing C++ code
roland
parents:
diff
changeset
|
68 |
if (a instanceof I) { |
5a16856f871f
7090976: Eclipse/CDT causes a JVM crash while indexing C++ code
roland
parents:
diff
changeset
|
69 |
I i = (I)a; |
5a16856f871f
7090976: Eclipse/CDT causes a JVM crash while indexing C++ code
roland
parents:
diff
changeset
|
70 |
i.m1(); |
5a16856f871f
7090976: Eclipse/CDT causes a JVM crash while indexing C++ code
roland
parents:
diff
changeset
|
71 |
i.m2(); |
5a16856f871f
7090976: Eclipse/CDT causes a JVM crash while indexing C++ code
roland
parents:
diff
changeset
|
72 |
} |
5a16856f871f
7090976: Eclipse/CDT causes a JVM crash while indexing C++ code
roland
parents:
diff
changeset
|
73 |
} |
5a16856f871f
7090976: Eclipse/CDT causes a JVM crash while indexing C++ code
roland
parents:
diff
changeset
|
74 |
|
5a16856f871f
7090976: Eclipse/CDT causes a JVM crash while indexing C++ code
roland
parents:
diff
changeset
|
75 |
public static void main(String[] args) |
5a16856f871f
7090976: Eclipse/CDT causes a JVM crash while indexing C++ code
roland
parents:
diff
changeset
|
76 |
{ |
5a16856f871f
7090976: Eclipse/CDT causes a JVM crash while indexing C++ code
roland
parents:
diff
changeset
|
77 |
Test7090976 t = new Test7090976(); |
5a16856f871f
7090976: Eclipse/CDT causes a JVM crash while indexing C++ code
roland
parents:
diff
changeset
|
78 |
A a = new A(); |
5a16856f871f
7090976: Eclipse/CDT causes a JVM crash while indexing C++ code
roland
parents:
diff
changeset
|
79 |
B b = new B(); |
5a16856f871f
7090976: Eclipse/CDT causes a JVM crash while indexing C++ code
roland
parents:
diff
changeset
|
80 |
for (int i = 0; i < 10000; i++) { |
5a16856f871f
7090976: Eclipse/CDT causes a JVM crash while indexing C++ code
roland
parents:
diff
changeset
|
81 |
t.test(a); |
5a16856f871f
7090976: Eclipse/CDT causes a JVM crash while indexing C++ code
roland
parents:
diff
changeset
|
82 |
} |
5a16856f871f
7090976: Eclipse/CDT causes a JVM crash while indexing C++ code
roland
parents:
diff
changeset
|
83 |
} |
5a16856f871f
7090976: Eclipse/CDT causes a JVM crash while indexing C++ code
roland
parents:
diff
changeset
|
84 |
} |