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 * @bug 6814842
27 * @summary Load shortening optimizations
28 *
29 * @run main/othervm -Xcomp -XX:CompileOnly=Test6814842.loadS2B,Test6814842.loadS2Bmask255,Test6814842.loadUS2B,Test6814842.loadUS2Bmask255,Test6814842.loadI2B,Test6814842.loadI2Bmask255,Test6814842.loadI2S,Test6814842.loadI2Smask255,Test6814842.loadI2Smask65535,Test6814842.loadI2US,Test6814842.loadI2USmask255,Test6814842.loadI2USmask65535 Test6814842
30 */
31
32 public class Test6814842 {
33 static final short[] sa = new short[] { (short) 0xF1F2 };
34 static final char[] ca = new char[] { (char) 0xF3F4 };
35 static final int[] ia = new int[] { 0xF1F2F3F4 };
36
37 public static void main(String[] args)
38 {
39 byte s2b = loadS2B(sa);
40 if (s2b != (byte) 0xF2)
41 throw new InternalError("loadS2B failed: " + s2b + " != " + (byte) 0xF2);
42
43 byte s2bmask255 = loadS2Bmask255(sa);
44 if (s2bmask255 != (byte) 0xF2)
45 throw new InternalError("loadS2Bmask255 failed: " + s2bmask255 + " != " + (byte) 0xF2);
46
47 byte us2b = loadUS2B(ca);
48 if (us2b != (byte) 0xF4)
49 throw new InternalError("loadUS2B failed: " + us2b + " != " + (byte) 0xF4);
50
|
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 * @bug 6814842
27 * @summary Load shortening optimizations
28 *
29 * @run main/othervm -Xcomp
30 * -XX:CompileCommand=compileonly,compiler.codegen.Test6814842::load*
31 * compiler.codegen.Test6814842
32 */
33
34 package compiler.codegen;
35
36 public class Test6814842 {
37 static final short[] sa = new short[] { (short) 0xF1F2 };
38 static final char[] ca = new char[] { (char) 0xF3F4 };
39 static final int[] ia = new int[] { 0xF1F2F3F4 };
40
41 public static void main(String[] args)
42 {
43 byte s2b = loadS2B(sa);
44 if (s2b != (byte) 0xF2)
45 throw new InternalError("loadS2B failed: " + s2b + " != " + (byte) 0xF2);
46
47 byte s2bmask255 = loadS2Bmask255(sa);
48 if (s2bmask255 != (byte) 0xF2)
49 throw new InternalError("loadS2Bmask255 failed: " + s2bmask255 + " != " + (byte) 0xF2);
50
51 byte us2b = loadUS2B(ca);
52 if (us2b != (byte) 0xF4)
53 throw new InternalError("loadUS2B failed: " + us2b + " != " + (byte) 0xF4);
54
|