Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
PojavLauncherTeam
GitHub Repository: PojavLauncherTeam/mobile
Path: blob/master/test/hotspot/jtreg/vmTestbase/jit/t/t020/t020.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/t020.
28
* VM Testbase keywords: [jit, quick]
29
*
30
* @library /vmTestbase
31
* /test/lib
32
* @run main/othervm jit.t.t020.t020
33
*/
34
35
package jit.t.t020;
36
37
import nsk.share.TestFailure;
38
import nsk.share.GoldChecker;
39
40
// opc_checkcast, opc_instanceof, opc_ifnull, opc_ifnonnull
41
42
public class t020
43
{
44
public static final GoldChecker goldChecker = new GoldChecker( "t020" );
45
46
private static void show(t020 x)
47
{
48
try
49
{
50
t020.goldChecker.print(" is a t020");
51
if(x instanceof k)
52
t020.goldChecker.print(" and also a k");
53
if(x == null)
54
t020.goldChecker.print(" and also null");
55
if(x != null)
56
t020.goldChecker.print(" and also not null");
57
t020.goldChecker.println(".");
58
}
59
catch(Throwable e)
60
{
61
t020.goldChecker.println(" " + e.getMessage());
62
}
63
}
64
65
public static void main(String argv[])
66
{
67
t020 a[] = new t020[4];
68
t020 t = new k();
69
k u = null;
70
a[0] = new t020();
71
a[1] = t;
72
a[3] = u;
73
74
for(int i=0; i<4; i+=1)
75
{
76
t020.goldChecker.print("a[" + i + "]");
77
show(a[i]);
78
}
79
80
t020.goldChecker.println();
81
for(int i=0; i<4; i+=1)
82
{
83
try
84
{
85
t020.goldChecker.print("Assigning a[" + i + "] to u");
86
u = (k) a[i];
87
t020.goldChecker.print(" worked ok");
88
}
89
catch(Throwable x)
90
{
91
t020.goldChecker.print(" failed");
92
}
93
finally
94
{
95
t020.goldChecker.println(".");
96
}
97
}
98
t020.goldChecker.check();
99
}
100
101
}
102
103
class k extends t020
104
{
105
}
106
107