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/t103.
28  * VM Testbase keywords: [jit, quick]
29  *
30  * @library /vmTestbase
31  *          /test/lib
32  * @run main/othervm jit.t.t103.t103
33  */
34 
35 package jit.t.t103;
36 
37 import nsk.share.TestFailure;
38 import nsk.share.GoldChecker;
39 
40 // Like t101.java except the short intege type is byte instead of char.
41 
42 public class t103
43 {
44     public static final GoldChecker goldChecker = new GoldChecker( "t103" );
45 
main(String[] argv)46     public static void main(String[] argv)
47     {
48         byte a[] = new byte[8];
49         byte x,x0,x1,x2,x3,x4,x5,x6,x7;
50         int i;
51         for(i=0; i<8; i+=1)
52             a[i] = (byte) (i - 1);
53         x = (byte) (
54             (x0=(byte)(int)a[0]) +
55             ((x1=(byte)(int)a[1]) +
56             ((x2=(byte)(int)a[2]) +
57             ((x3=(byte)(int)a[3]) +
58             ((x4=(byte)(int)a[4]) +
59             ((x5=(byte)(int)a[5]) +
60             ((x6=(byte)(int)a[6]) +
61             (x7=(byte)(int)a[7])))))))
62             );
63 
64         t103.goldChecker.println("... and the answer is " + (int) x);
65         t103.goldChecker.check();
66     }
67 }
68