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