Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
PojavLauncherTeam
GitHub Repository: PojavLauncherTeam/mobile
Path: blob/master/test/hotspot/jtreg/vmTestbase/jit/t/t042/t042.java
40948 views
1
/*
2
* Copyright (c) 2008, 2020, Oracle and/or its affiliates. All rights reserved.
3
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4
*
5
* This code is free software; you can redistribute it and/or modify it
6
* under the terms of the GNU General Public License version 2 only, as
7
* published by the Free Software Foundation.
8
*
9
* This code is distributed in the hope that it will be useful, but WITHOUT
10
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12
* version 2 for more details (a copy is included in the LICENSE file that
13
* accompanied this code).
14
*
15
* You should have received a copy of the GNU General Public License version
16
* 2 along with this work; if not, write to the Free Software Foundation,
17
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18
*
19
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20
* or visit www.oracle.com if you need additional information or have any
21
* questions.
22
*/
23
24
/*
25
* @test
26
*
27
* @summary converted from VM Testbase jit/t/t042.
28
* VM Testbase keywords: [jit, quick]
29
*
30
* @library /vmTestbase
31
* /test/lib
32
* @run main/othervm jit.t.t042.t042
33
*/
34
35
package jit.t.t042;
36
37
import nsk.share.TestFailure;
38
import nsk.share.GoldChecker;
39
40
// The special little twiddle that occurs when you invoke a method
41
// of an array.
42
43
public class t042
44
{
45
public static final GoldChecker goldChecker = new GoldChecker( "t042" );
46
47
static void sameAs(Object x, Object y, String call)
48
{
49
t042.goldChecker.print(call + ": ");
50
if(x == null)
51
t042.goldChecker.println("left object is null");
52
if(x != null)
53
t042.goldChecker.println(x.equals(y));
54
}
55
56
public static void main(String argv[])
57
{
58
int a[] = new int[3];
59
int b[] = null;
60
int c[] = a;
61
Object x = a;
62
Object y = new Object();
63
Object z = null;
64
65
sameAs(a, a, "sameAs(a, a)");
66
sameAs(a, b, "sameAs(a, b)");
67
sameAs(a, c, "sameAs(a, c)");
68
sameAs(a, x, "sameAs(a, x)");
69
sameAs(a, y, "sameAs(a, y)");
70
sameAs(a, z, "sameAs(a, z)");
71
72
t042.goldChecker.println();
73
sameAs(b, a, "sameAs(b, a)");
74
sameAs(b, b, "sameAs(b, b)");
75
sameAs(b, c, "sameAs(b, c)");
76
sameAs(b, x, "sameAs(b, x)");
77
sameAs(b, y, "sameAs(b, y)");
78
sameAs(b, z, "sameAs(b, z)");
79
80
t042.goldChecker.println();
81
sameAs(c, a, "sameAs(c, a)");
82
sameAs(c, b, "sameAs(c, b)");
83
sameAs(c, c, "sameAs(c, c)");
84
sameAs(c, x, "sameAs(c, x)");
85
sameAs(c, y, "sameAs(c, y)");
86
sameAs(c, z, "sameAs(c, z)");
87
88
t042.goldChecker.println();
89
sameAs(x, a, "sameAs(x, a)");
90
sameAs(x, b, "sameAs(x, b)");
91
sameAs(x, c, "sameAs(x, c)");
92
sameAs(x, x, "sameAs(x, x)");
93
sameAs(x, y, "sameAs(x, y)");
94
sameAs(x, z, "sameAs(x, z)");
95
96
t042.goldChecker.println();
97
sameAs(y, a, "sameAs(y, a)");
98
sameAs(y, b, "sameAs(y, b)");
99
sameAs(y, c, "sameAs(y, c)");
100
sameAs(y, x, "sameAs(y, x)");
101
sameAs(y, y, "sameAs(y, y)");
102
sameAs(y, z, "sameAs(y, z)");
103
104
t042.goldChecker.println();
105
sameAs(z, a, "sameAs(z, a)");
106
sameAs(z, b, "sameAs(z, b)");
107
sameAs(z, c, "sameAs(z, c)");
108
sameAs(z, x, "sameAs(z, x)");
109
sameAs(z, y, "sameAs(z, y)");
110
sameAs(z, z, "sameAs(z, z)");
111
t042.goldChecker.check();
112
}
113
}
114
115