annotate test/compiler/6832293/Test.java @ 3237:399aa66d375e

Fixed a bug in which the valueEquals method was misused. The method does only check the equality of the node data and not full GVN equality by taking inputs and successors into account.
author Thomas Wuerthinger <thomas@wuerthinger.net>
date Wed, 27 Jul 2011 14:16:38 -0700
parents c18cbe5936b8
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
783
a9e116455022 6832293: JIT compiler got wrong result in type checking with -server
kvn
parents:
diff changeset
1 /*
1552
c18cbe5936b8 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 844
diff changeset
2 * Copyright (c) 2008, 2009, Oracle and/or its affiliates. All rights reserved.
783
a9e116455022 6832293: JIT compiler got wrong result in type checking with -server
kvn
parents:
diff changeset
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
a9e116455022 6832293: JIT compiler got wrong result in type checking with -server
kvn
parents:
diff changeset
4 *
a9e116455022 6832293: JIT compiler got wrong result in type checking with -server
kvn
parents:
diff changeset
5 * This code is free software; you can redistribute it and/or modify it
a9e116455022 6832293: JIT compiler got wrong result in type checking with -server
kvn
parents:
diff changeset
6 * under the terms of the GNU General Public License version 2 only, as
a9e116455022 6832293: JIT compiler got wrong result in type checking with -server
kvn
parents:
diff changeset
7 * published by the Free Software Foundation.
a9e116455022 6832293: JIT compiler got wrong result in type checking with -server
kvn
parents:
diff changeset
8 *
a9e116455022 6832293: JIT compiler got wrong result in type checking with -server
kvn
parents:
diff changeset
9 * This code is distributed in the hope that it will be useful, but WITHOUT
a9e116455022 6832293: JIT compiler got wrong result in type checking with -server
kvn
parents:
diff changeset
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
a9e116455022 6832293: JIT compiler got wrong result in type checking with -server
kvn
parents:
diff changeset
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
a9e116455022 6832293: JIT compiler got wrong result in type checking with -server
kvn
parents:
diff changeset
12 * version 2 for more details (a copy is included in the LICENSE file that
a9e116455022 6832293: JIT compiler got wrong result in type checking with -server
kvn
parents:
diff changeset
13 * accompanied this code).
a9e116455022 6832293: JIT compiler got wrong result in type checking with -server
kvn
parents:
diff changeset
14 *
a9e116455022 6832293: JIT compiler got wrong result in type checking with -server
kvn
parents:
diff changeset
15 * You should have received a copy of the GNU General Public License version
a9e116455022 6832293: JIT compiler got wrong result in type checking with -server
kvn
parents:
diff changeset
16 * 2 along with this work; if not, write to the Free Software Foundation,
a9e116455022 6832293: JIT compiler got wrong result in type checking with -server
kvn
parents:
diff changeset
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
a9e116455022 6832293: JIT compiler got wrong result in type checking with -server
kvn
parents:
diff changeset
18 *
1552
c18cbe5936b8 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 844
diff changeset
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
c18cbe5936b8 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 844
diff changeset
20 * or visit www.oracle.com if you need additional information or have any
c18cbe5936b8 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 844
diff changeset
21 * questions.
783
a9e116455022 6832293: JIT compiler got wrong result in type checking with -server
kvn
parents:
diff changeset
22 *
a9e116455022 6832293: JIT compiler got wrong result in type checking with -server
kvn
parents:
diff changeset
23 */
a9e116455022 6832293: JIT compiler got wrong result in type checking with -server
kvn
parents:
diff changeset
24
a9e116455022 6832293: JIT compiler got wrong result in type checking with -server
kvn
parents:
diff changeset
25 /*
a9e116455022 6832293: JIT compiler got wrong result in type checking with -server
kvn
parents:
diff changeset
26 * @test
a9e116455022 6832293: JIT compiler got wrong result in type checking with -server
kvn
parents:
diff changeset
27 * @bug 6832293
a9e116455022 6832293: JIT compiler got wrong result in type checking with -server
kvn
parents:
diff changeset
28 * @summary JIT compiler got wrong result in type checking with -server
a9e116455022 6832293: JIT compiler got wrong result in type checking with -server
kvn
parents:
diff changeset
29 * @run main/othervm -Xcomp -XX:CompileOnly=Test.run Test
a9e116455022 6832293: JIT compiler got wrong result in type checking with -server
kvn
parents:
diff changeset
30 */
a9e116455022 6832293: JIT compiler got wrong result in type checking with -server
kvn
parents:
diff changeset
31
a9e116455022 6832293: JIT compiler got wrong result in type checking with -server
kvn
parents:
diff changeset
32 import java.io.PrintStream;
a9e116455022 6832293: JIT compiler got wrong result in type checking with -server
kvn
parents:
diff changeset
33
a9e116455022 6832293: JIT compiler got wrong result in type checking with -server
kvn
parents:
diff changeset
34 interface SomeInterface {
a9e116455022 6832293: JIT compiler got wrong result in type checking with -server
kvn
parents:
diff changeset
35 int SEVENS = 777;
a9e116455022 6832293: JIT compiler got wrong result in type checking with -server
kvn
parents:
diff changeset
36 }
a9e116455022 6832293: JIT compiler got wrong result in type checking with -server
kvn
parents:
diff changeset
37
a9e116455022 6832293: JIT compiler got wrong result in type checking with -server
kvn
parents:
diff changeset
38 interface AnotherInterface {
a9e116455022 6832293: JIT compiler got wrong result in type checking with -server
kvn
parents:
diff changeset
39 int THIRDS = 33;
a9e116455022 6832293: JIT compiler got wrong result in type checking with -server
kvn
parents:
diff changeset
40 }
a9e116455022 6832293: JIT compiler got wrong result in type checking with -server
kvn
parents:
diff changeset
41
a9e116455022 6832293: JIT compiler got wrong result in type checking with -server
kvn
parents:
diff changeset
42 class SomeClass implements SomeInterface {
a9e116455022 6832293: JIT compiler got wrong result in type checking with -server
kvn
parents:
diff changeset
43 int i;
a9e116455022 6832293: JIT compiler got wrong result in type checking with -server
kvn
parents:
diff changeset
44
a9e116455022 6832293: JIT compiler got wrong result in type checking with -server
kvn
parents:
diff changeset
45 SomeClass(int i) {
a9e116455022 6832293: JIT compiler got wrong result in type checking with -server
kvn
parents:
diff changeset
46 this.i = i;
a9e116455022 6832293: JIT compiler got wrong result in type checking with -server
kvn
parents:
diff changeset
47 }
a9e116455022 6832293: JIT compiler got wrong result in type checking with -server
kvn
parents:
diff changeset
48 }
a9e116455022 6832293: JIT compiler got wrong result in type checking with -server
kvn
parents:
diff changeset
49
a9e116455022 6832293: JIT compiler got wrong result in type checking with -server
kvn
parents:
diff changeset
50 class ImmediateSubclass extends SomeClass implements SomeInterface {
a9e116455022 6832293: JIT compiler got wrong result in type checking with -server
kvn
parents:
diff changeset
51 float f;
a9e116455022 6832293: JIT compiler got wrong result in type checking with -server
kvn
parents:
diff changeset
52
a9e116455022 6832293: JIT compiler got wrong result in type checking with -server
kvn
parents:
diff changeset
53 ImmediateSubclass(int i, float f) {
a9e116455022 6832293: JIT compiler got wrong result in type checking with -server
kvn
parents:
diff changeset
54 super(i);
a9e116455022 6832293: JIT compiler got wrong result in type checking with -server
kvn
parents:
diff changeset
55 this.f = f;
a9e116455022 6832293: JIT compiler got wrong result in type checking with -server
kvn
parents:
diff changeset
56 }
a9e116455022 6832293: JIT compiler got wrong result in type checking with -server
kvn
parents:
diff changeset
57 }
a9e116455022 6832293: JIT compiler got wrong result in type checking with -server
kvn
parents:
diff changeset
58
a9e116455022 6832293: JIT compiler got wrong result in type checking with -server
kvn
parents:
diff changeset
59 final class FinalSubclass extends ImmediateSubclass implements AnotherInterface {
a9e116455022 6832293: JIT compiler got wrong result in type checking with -server
kvn
parents:
diff changeset
60 double d;
a9e116455022 6832293: JIT compiler got wrong result in type checking with -server
kvn
parents:
diff changeset
61
a9e116455022 6832293: JIT compiler got wrong result in type checking with -server
kvn
parents:
diff changeset
62 FinalSubclass(int i, float f, double d) {
a9e116455022 6832293: JIT compiler got wrong result in type checking with -server
kvn
parents:
diff changeset
63 super(i, f);
a9e116455022 6832293: JIT compiler got wrong result in type checking with -server
kvn
parents:
diff changeset
64 this.d = d;
a9e116455022 6832293: JIT compiler got wrong result in type checking with -server
kvn
parents:
diff changeset
65 }
a9e116455022 6832293: JIT compiler got wrong result in type checking with -server
kvn
parents:
diff changeset
66 }
a9e116455022 6832293: JIT compiler got wrong result in type checking with -server
kvn
parents:
diff changeset
67
a9e116455022 6832293: JIT compiler got wrong result in type checking with -server
kvn
parents:
diff changeset
68 public class Test {
a9e116455022 6832293: JIT compiler got wrong result in type checking with -server
kvn
parents:
diff changeset
69
a9e116455022 6832293: JIT compiler got wrong result in type checking with -server
kvn
parents:
diff changeset
70 public static void main(String args[]) throws Exception{
a9e116455022 6832293: JIT compiler got wrong result in type checking with -server
kvn
parents:
diff changeset
71 /* try to pre initialize */
a9e116455022 6832293: JIT compiler got wrong result in type checking with -server
kvn
parents:
diff changeset
72 SomeClass[] a=new SomeClass[10];
a9e116455022 6832293: JIT compiler got wrong result in type checking with -server
kvn
parents:
diff changeset
73 Class.forName("ImmediateSubclass");
a9e116455022 6832293: JIT compiler got wrong result in type checking with -server
kvn
parents:
diff changeset
74 Class.forName("FinalSubclass");
a9e116455022 6832293: JIT compiler got wrong result in type checking with -server
kvn
parents:
diff changeset
75 System.exit(run(args, System.out) + 95/*STATUS_TEMP*/);
a9e116455022 6832293: JIT compiler got wrong result in type checking with -server
kvn
parents:
diff changeset
76 }
a9e116455022 6832293: JIT compiler got wrong result in type checking with -server
kvn
parents:
diff changeset
77
a9e116455022 6832293: JIT compiler got wrong result in type checking with -server
kvn
parents:
diff changeset
78 static int errorStatus = 0/*STATUS_PASSED*/;
a9e116455022 6832293: JIT compiler got wrong result in type checking with -server
kvn
parents:
diff changeset
79
a9e116455022 6832293: JIT compiler got wrong result in type checking with -server
kvn
parents:
diff changeset
80 static void errorAlert(PrintStream out, int errorLevel) {
a9e116455022 6832293: JIT compiler got wrong result in type checking with -server
kvn
parents:
diff changeset
81 out.println("Test: failure #" + errorLevel);
a9e116455022 6832293: JIT compiler got wrong result in type checking with -server
kvn
parents:
diff changeset
82 errorStatus = 2/*STATUS_FAILED*/;
a9e116455022 6832293: JIT compiler got wrong result in type checking with -server
kvn
parents:
diff changeset
83 }
a9e116455022 6832293: JIT compiler got wrong result in type checking with -server
kvn
parents:
diff changeset
84
a9e116455022 6832293: JIT compiler got wrong result in type checking with -server
kvn
parents:
diff changeset
85 static SomeClass[] v2 = new FinalSubclass[4];
a9e116455022 6832293: JIT compiler got wrong result in type checking with -server
kvn
parents:
diff changeset
86
a9e116455022 6832293: JIT compiler got wrong result in type checking with -server
kvn
parents:
diff changeset
87 public static int run(String args[],PrintStream out) {
a9e116455022 6832293: JIT compiler got wrong result in type checking with -server
kvn
parents:
diff changeset
88 int i [], j [];
a9e116455022 6832293: JIT compiler got wrong result in type checking with -server
kvn
parents:
diff changeset
89 SomeInterface u [], v[] [];
a9e116455022 6832293: JIT compiler got wrong result in type checking with -server
kvn
parents:
diff changeset
90 AnotherInterface w [];
a9e116455022 6832293: JIT compiler got wrong result in type checking with -server
kvn
parents:
diff changeset
91 SomeClass x [] [];
a9e116455022 6832293: JIT compiler got wrong result in type checking with -server
kvn
parents:
diff changeset
92
a9e116455022 6832293: JIT compiler got wrong result in type checking with -server
kvn
parents:
diff changeset
93 i = new int [10];
a9e116455022 6832293: JIT compiler got wrong result in type checking with -server
kvn
parents:
diff changeset
94 i[0] = 777;
a9e116455022 6832293: JIT compiler got wrong result in type checking with -server
kvn
parents:
diff changeset
95 j = (int []) i;
a9e116455022 6832293: JIT compiler got wrong result in type checking with -server
kvn
parents:
diff changeset
96 if (j != i)
a9e116455022 6832293: JIT compiler got wrong result in type checking with -server
kvn
parents:
diff changeset
97 errorAlert(out, 2);
a9e116455022 6832293: JIT compiler got wrong result in type checking with -server
kvn
parents:
diff changeset
98 else if (j.length != 10)
a9e116455022 6832293: JIT compiler got wrong result in type checking with -server
kvn
parents:
diff changeset
99 errorAlert(out, 3);
a9e116455022 6832293: JIT compiler got wrong result in type checking with -server
kvn
parents:
diff changeset
100 else if (j[0] != 777)
a9e116455022 6832293: JIT compiler got wrong result in type checking with -server
kvn
parents:
diff changeset
101 errorAlert(out, 4);
a9e116455022 6832293: JIT compiler got wrong result in type checking with -server
kvn
parents:
diff changeset
102
a9e116455022 6832293: JIT compiler got wrong result in type checking with -server
kvn
parents:
diff changeset
103 v = new SomeClass [3] [];
a9e116455022 6832293: JIT compiler got wrong result in type checking with -server
kvn
parents:
diff changeset
104 x = (SomeClass [] []) v;
a9e116455022 6832293: JIT compiler got wrong result in type checking with -server
kvn
parents:
diff changeset
105 if (! (x instanceof SomeInterface [] []))
a9e116455022 6832293: JIT compiler got wrong result in type checking with -server
kvn
parents:
diff changeset
106 errorAlert(out, 5);
a9e116455022 6832293: JIT compiler got wrong result in type checking with -server
kvn
parents:
diff changeset
107 else if (! (x instanceof SomeClass [] []))
a9e116455022 6832293: JIT compiler got wrong result in type checking with -server
kvn
parents:
diff changeset
108 errorAlert(out, 6);
a9e116455022 6832293: JIT compiler got wrong result in type checking with -server
kvn
parents:
diff changeset
109 else if (x != v)
a9e116455022 6832293: JIT compiler got wrong result in type checking with -server
kvn
parents:
diff changeset
110 errorAlert(out, 7);
a9e116455022 6832293: JIT compiler got wrong result in type checking with -server
kvn
parents:
diff changeset
111
a9e116455022 6832293: JIT compiler got wrong result in type checking with -server
kvn
parents:
diff changeset
112 x[0] = (SomeClass []) new ImmediateSubclass [4];
a9e116455022 6832293: JIT compiler got wrong result in type checking with -server
kvn
parents:
diff changeset
113 if (! (x[0] instanceof ImmediateSubclass []))
a9e116455022 6832293: JIT compiler got wrong result in type checking with -server
kvn
parents:
diff changeset
114 errorAlert(out, 8);
a9e116455022 6832293: JIT compiler got wrong result in type checking with -server
kvn
parents:
diff changeset
115 else if (x[0].length != 4)
a9e116455022 6832293: JIT compiler got wrong result in type checking with -server
kvn
parents:
diff changeset
116 errorAlert(out, 9);
a9e116455022 6832293: JIT compiler got wrong result in type checking with -server
kvn
parents:
diff changeset
117
a9e116455022 6832293: JIT compiler got wrong result in type checking with -server
kvn
parents:
diff changeset
118 x[1] = (SomeClass []) v2;
a9e116455022 6832293: JIT compiler got wrong result in type checking with -server
kvn
parents:
diff changeset
119 if (! (x[1] instanceof FinalSubclass []))
a9e116455022 6832293: JIT compiler got wrong result in type checking with -server
kvn
parents:
diff changeset
120 errorAlert(out, 10);
a9e116455022 6832293: JIT compiler got wrong result in type checking with -server
kvn
parents:
diff changeset
121 else if (x[1].length != 4)
a9e116455022 6832293: JIT compiler got wrong result in type checking with -server
kvn
parents:
diff changeset
122 errorAlert(out, 11);
a9e116455022 6832293: JIT compiler got wrong result in type checking with -server
kvn
parents:
diff changeset
123
a9e116455022 6832293: JIT compiler got wrong result in type checking with -server
kvn
parents:
diff changeset
124 w = (AnotherInterface []) x[1];
a9e116455022 6832293: JIT compiler got wrong result in type checking with -server
kvn
parents:
diff changeset
125 if (! (w instanceof FinalSubclass []))
a9e116455022 6832293: JIT compiler got wrong result in type checking with -server
kvn
parents:
diff changeset
126 errorAlert(out, 12);
a9e116455022 6832293: JIT compiler got wrong result in type checking with -server
kvn
parents:
diff changeset
127 else if (w != x[1])
a9e116455022 6832293: JIT compiler got wrong result in type checking with -server
kvn
parents:
diff changeset
128 errorAlert(out, 13);
a9e116455022 6832293: JIT compiler got wrong result in type checking with -server
kvn
parents:
diff changeset
129 else if (w.length != 4)
a9e116455022 6832293: JIT compiler got wrong result in type checking with -server
kvn
parents:
diff changeset
130 errorAlert(out, 14);
a9e116455022 6832293: JIT compiler got wrong result in type checking with -server
kvn
parents:
diff changeset
131
a9e116455022 6832293: JIT compiler got wrong result in type checking with -server
kvn
parents:
diff changeset
132 return errorStatus;
a9e116455022 6832293: JIT compiler got wrong result in type checking with -server
kvn
parents:
diff changeset
133 }
a9e116455022 6832293: JIT compiler got wrong result in type checking with -server
kvn
parents:
diff changeset
134 }
a9e116455022 6832293: JIT compiler got wrong result in type checking with -server
kvn
parents:
diff changeset
135