Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
PojavLauncherTeam
GitHub Repository: PojavLauncherTeam/mobile
Path: blob/master/test/hotspot/jtreg/vmTestbase/jit/t/t036/t036.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/t036.
28
* VM Testbase keywords: [jit, quick]
29
*
30
* @library /vmTestbase
31
* /test/lib
32
* @run main/othervm jit.t.t036.t036
33
*/
34
35
package jit.t.t036;
36
37
import nsk.share.TestFailure;
38
import nsk.share.GoldChecker;
39
40
// opc_int2byte, opc_int2char, opc_int2short
41
42
public class t036
43
{
44
public static final GoldChecker goldChecker = new GoldChecker( "t036" );
45
46
static void show(int i, byte b, char c, short s)
47
{
48
t036.goldChecker.println();
49
t036.goldChecker.println(i);
50
t036.goldChecker.println(b);
51
t036.goldChecker.println((int) c);
52
t036.goldChecker.println(s);
53
}
54
55
public static void main(String argv[])
56
{
57
int i;
58
char c;
59
short s;
60
byte b;
61
62
i = 39; b = (byte) i; c = (char) i; s = (short) i; show(i,b,c,s);
63
i = -1; b = (byte) i; c = (char) i; s = (short) i; show(i,b,c,s);
64
i = 127; b = (byte) i; c = (char) i; s = (short) i; show(i,b,c,s);
65
i = 128; b = (byte) i; c = (char) i; s = (short) i; show(i,b,c,s);
66
i = -128; b = (byte) i; c = (char) i; s = (short) i; show(i,b,c,s);
67
i = -129; b = (byte) i; c = (char) i; s = (short) i; show(i,b,c,s);
68
i = 32767; b = (byte) i; c = (char) i; s = (short) i; show(i,b,c,s);
69
i = 32768; b = (byte) i; c = (char) i; s = (short) i; show(i,b,c,s);
70
i = -32768; b = (byte) i; c = (char) i; s = (short) i; show(i,b,c,s);
71
i = -32769; b = (byte) i; c = (char) i; s = (short) i; show(i,b,c,s);
72
i = 65535; b = (byte) i; c = (char) i; s = (short) i; show(i,b,c,s);
73
i = 65536; b = (byte) i; c = (char) i; s = (short) i; show(i,b,c,s);
74
i = -65536; b = (byte) i; c = (char) i; s = (short) i; show(i,b,c,s);
75
i = -65537; b = (byte) i; c = (char) i; s = (short) i; show(i,b,c,s);
76
t036.goldChecker.check();
77
}
78
}
79
80