Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
PojavLauncherTeam
GitHub Repository: PojavLauncherTeam/mobile
Path: blob/master/test/hotspot/jtreg/vmTestbase/jit/t/t048/t048.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/t048.
28
* VM Testbase keywords: [jit, quick]
29
*
30
* @library /vmTestbase
31
* /test/lib
32
* @run main/othervm jit.t.t048.t048
33
*/
34
35
package jit.t.t048;
36
37
import nsk.share.TestFailure;
38
import nsk.share.GoldChecker;
39
40
// Register jams and spills
41
42
public class t048
43
{
44
public static final GoldChecker goldChecker = new GoldChecker( "t048" );
45
46
static int idiv(int i, int j)
47
{
48
int res = i / j;
49
t048.goldChecker.println("i: " + i + ", j: " + j + ", res: " + res);
50
return res;
51
}
52
53
static void intDivs()
54
{
55
int a, b, c, d, e, f, g, h, i, j, k, l, z;
56
int t1, t2, t3, t4, t5, t6, t7;
57
58
a=13; b=12; c=11; d=10; e=9; f=8; g=7; h=6; i=5; j=4; k=3; l=2;
59
60
t1 = a/b;
61
t2 = c/d;
62
t3 = e/f;
63
t4 = g/h;
64
t5 = i/j;
65
t6 = k/l;
66
t048.goldChecker.println("t6 = " + t6);
67
t048.goldChecker.println("t5 = " + t5);
68
t5 /= t6;
69
t048.goldChecker.println("t5 = " + t5);
70
t048.goldChecker.println("t4 = " + t4);
71
t4 /= t5;
72
t3 /= t4;
73
t2 /= t3;
74
t1 /= t2;
75
76
t048.goldChecker.println("t1 == " + t1);
77
z = idiv
78
(
79
idiv(a,b),
80
idiv
81
(
82
idiv(c,d),
83
idiv
84
(
85
idiv(e,f),
86
idiv
87
(
88
idiv(g,h),
89
idiv
90
(
91
idiv(i,j),
92
idiv(k, l)
93
)
94
)
95
)
96
)
97
);
98
z = (a/b) /
99
((c/d) /
100
((e/f) /
101
((g/h) /
102
((i/j) / (k/l)))));
103
t048.goldChecker.println("Int: " + z);
104
}
105
106
static void longDivs()
107
{
108
long a, b, c, d, e, f, g, h, i, j, k, l, z;
109
110
a=13; b=12; c=11; d=10; e=9; f=8; g=7; h=6; i=5; j=4; k=3; l=2;
111
112
z = (a/b) / ((c/d) / ((e/f) / ((g/h) / ((i/j) / (k/l)))));
113
t048.goldChecker.println("Long: " + z);
114
}
115
116
static void floatDivs()
117
{
118
float a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, z;
119
120
a=1; b=2; c=3; d=4; e=5; f=6; g=7; h=8; i=9; j=10; k=11; l=12;
121
m=13; n=14; o=15; p=16; q=17; r=18; s=19; t=20;
122
z = (a/b) / ((c/d) / ((e/f) / ((g/h) / ((i/j) / ((k/l) / ((m/n) /
123
((o/p) / ((q/r) / (s/t)))))))));
124
t048.goldChecker.println("Float: " + z);
125
z /= (a/b) / ((c/d) / ((e/f) / ((g/h) / ((i/j) / ((k/l) / ((m/n) /
126
((o/p) / ((q/r) / (s/t)))))))));
127
t048.goldChecker.println("Float: " + z);
128
z /= (a/b) / ((c/d) / ((e/f) / ((g/h) / ((i/j) / ((k/l) / ((m/n) /
129
((o/p) / ((q/r) / (s/t)))))))));
130
t048.goldChecker.println("Float: " + z);
131
z /= (a/b) / ((c/d) / ((e/f) / ((g/h) / ((i/j) / ((k/l) / ((m/n) /
132
((o/p) / ((q/r) / (s/t)))))))));
133
t048.goldChecker.println("Float: " + z);
134
z /= (a/b) / ((c/d) / ((e/f) / ((g/h) / ((i/j) / ((k/l) / ((m/n) /
135
((o/p) / ((q/r) / (s/t)))))))));
136
t048.goldChecker.println("Float: " + z);
137
z /= (a/b) / ((c/d) / ((e/f) / ((g/h) / ((i/j) / ((k/l) / ((m/n) /
138
((o/p) / ((q/r) / (s/t)))))))));
139
t048.goldChecker.println("Float: " + z);
140
z /= (a/b) / ((c/d) / ((e/f) / ((g/h) / ((i/j) / ((k/l) / ((m/n) /
141
((o/p) / ((q/r) / (s/t)))))))));
142
t048.goldChecker.println("Float: " + z);
143
z /= (a/b) / ((c/d) / ((e/f) / ((g/h) / ((i/j) / ((k/l) / ((m/n) /
144
((o/p) / ((q/r) / (s/t)))))))));
145
t048.goldChecker.println("Float: " + z);
146
z /= (a/b) / ((c/d) / ((e/f) / ((g/h) / ((i/j) / ((k/l) / ((m/n) /
147
((o/p) / ((q/r) / (s/t)))))))));
148
t048.goldChecker.println("Float: " + z);
149
}
150
151
static void doubleDivs()
152
{
153
double a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, z;
154
155
a=1; b=2; c=3; d=4; e=5; f=6; g=7; h=8; i=9; j=10; k=11; l=12;
156
m=13; n=14; o=15; p=16; q=17; r=18; s=19; t=20;
157
z = (a/b) / ((c/d) / ((e/f) / ((g/h) / ((i/j) / ((k/l) / ((m/n) /
158
((o/p) / ((q/r) / (s/t)))))))));
159
t048.goldChecker.println("Double: " + z);
160
}
161
162
public static void main(String argv[])
163
{
164
intDivs();
165
longDivs();
166
floatDivs();
167
doubleDivs();
168
t048.goldChecker.check();
169
}
170
}
171
172