hotspot/test/compiler/codegen/Test6814842.java
author hseigel
Wed, 01 Mar 2017 08:00:02 -0500
changeset 46194 5596e6f63072
parent 40059 c2304140ed64
permissions -rw-r--r--
8172307: Remove ununsed JVM API JVM_GetModuleByPackageName() Summary: Remove get_module_by_package_name() etc., and unneeded test. Reviewed-by: sspitsyn, gtriantafill
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2872
93eb5ac6cfb0 6814842: Load shortening optimizations
twisti
parents:
diff changeset
     1
/*
5547
f4b087cbb361 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 2872
diff changeset
     2
 * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved.
2872
93eb5ac6cfb0 6814842: Load shortening optimizations
twisti
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
93eb5ac6cfb0 6814842: Load shortening optimizations
twisti
parents:
diff changeset
     4
 *
93eb5ac6cfb0 6814842: Load shortening optimizations
twisti
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
93eb5ac6cfb0 6814842: Load shortening optimizations
twisti
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
93eb5ac6cfb0 6814842: Load shortening optimizations
twisti
parents:
diff changeset
     7
 * published by the Free Software Foundation.
93eb5ac6cfb0 6814842: Load shortening optimizations
twisti
parents:
diff changeset
     8
 *
93eb5ac6cfb0 6814842: Load shortening optimizations
twisti
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
93eb5ac6cfb0 6814842: Load shortening optimizations
twisti
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
93eb5ac6cfb0 6814842: Load shortening optimizations
twisti
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
93eb5ac6cfb0 6814842: Load shortening optimizations
twisti
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
93eb5ac6cfb0 6814842: Load shortening optimizations
twisti
parents:
diff changeset
    13
 * accompanied this code).
93eb5ac6cfb0 6814842: Load shortening optimizations
twisti
parents:
diff changeset
    14
 *
93eb5ac6cfb0 6814842: Load shortening optimizations
twisti
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
93eb5ac6cfb0 6814842: Load shortening optimizations
twisti
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
93eb5ac6cfb0 6814842: Load shortening optimizations
twisti
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
93eb5ac6cfb0 6814842: Load shortening optimizations
twisti
parents:
diff changeset
    18
 *
5547
f4b087cbb361 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 2872
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
f4b087cbb361 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 2872
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
f4b087cbb361 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 2872
diff changeset
    21
 * questions.
2872
93eb5ac6cfb0 6814842: Load shortening optimizations
twisti
parents:
diff changeset
    22
 */
93eb5ac6cfb0 6814842: Load shortening optimizations
twisti
parents:
diff changeset
    23
93eb5ac6cfb0 6814842: Load shortening optimizations
twisti
parents:
diff changeset
    24
/**
93eb5ac6cfb0 6814842: Load shortening optimizations
twisti
parents:
diff changeset
    25
 * @test
93eb5ac6cfb0 6814842: Load shortening optimizations
twisti
parents:
diff changeset
    26
 * @bug 6814842
93eb5ac6cfb0 6814842: Load shortening optimizations
twisti
parents:
diff changeset
    27
 * @summary Load shortening optimizations
93eb5ac6cfb0 6814842: Load shortening optimizations
twisti
parents:
diff changeset
    28
 *
40059
c2304140ed64 8132919: Put compiler tests in packages
tpivovarova
parents: 27699
diff changeset
    29
 * @run main/othervm -Xcomp
c2304140ed64 8132919: Put compiler tests in packages
tpivovarova
parents: 27699
diff changeset
    30
 *      -XX:CompileCommand=compileonly,compiler.codegen.Test6814842::load*
c2304140ed64 8132919: Put compiler tests in packages
tpivovarova
parents: 27699
diff changeset
    31
 *      compiler.codegen.Test6814842
2872
93eb5ac6cfb0 6814842: Load shortening optimizations
twisti
parents:
diff changeset
    32
 */
93eb5ac6cfb0 6814842: Load shortening optimizations
twisti
parents:
diff changeset
    33
40059
c2304140ed64 8132919: Put compiler tests in packages
tpivovarova
parents: 27699
diff changeset
    34
package compiler.codegen;
c2304140ed64 8132919: Put compiler tests in packages
tpivovarova
parents: 27699
diff changeset
    35
2872
93eb5ac6cfb0 6814842: Load shortening optimizations
twisti
parents:
diff changeset
    36
public class Test6814842 {
93eb5ac6cfb0 6814842: Load shortening optimizations
twisti
parents:
diff changeset
    37
    static final short[] sa = new short[] { (short) 0xF1F2 };
93eb5ac6cfb0 6814842: Load shortening optimizations
twisti
parents:
diff changeset
    38
    static final char[]  ca = new char[]  { (char) 0xF3F4  };
93eb5ac6cfb0 6814842: Load shortening optimizations
twisti
parents:
diff changeset
    39
    static final int[]   ia = new int[]   { 0xF1F2F3F4     };
93eb5ac6cfb0 6814842: Load shortening optimizations
twisti
parents:
diff changeset
    40
93eb5ac6cfb0 6814842: Load shortening optimizations
twisti
parents:
diff changeset
    41
    public static void main(String[] args)
93eb5ac6cfb0 6814842: Load shortening optimizations
twisti
parents:
diff changeset
    42
    {
93eb5ac6cfb0 6814842: Load shortening optimizations
twisti
parents:
diff changeset
    43
        byte s2b = loadS2B(sa);
93eb5ac6cfb0 6814842: Load shortening optimizations
twisti
parents:
diff changeset
    44
        if (s2b != (byte) 0xF2)
93eb5ac6cfb0 6814842: Load shortening optimizations
twisti
parents:
diff changeset
    45
            throw new InternalError("loadS2B failed: " + s2b + " != " + (byte) 0xF2);
93eb5ac6cfb0 6814842: Load shortening optimizations
twisti
parents:
diff changeset
    46
93eb5ac6cfb0 6814842: Load shortening optimizations
twisti
parents:
diff changeset
    47
        byte s2bmask255 = loadS2Bmask255(sa);
93eb5ac6cfb0 6814842: Load shortening optimizations
twisti
parents:
diff changeset
    48
        if (s2bmask255 != (byte) 0xF2)
93eb5ac6cfb0 6814842: Load shortening optimizations
twisti
parents:
diff changeset
    49
            throw new InternalError("loadS2Bmask255 failed: " + s2bmask255 + " != " + (byte) 0xF2);
93eb5ac6cfb0 6814842: Load shortening optimizations
twisti
parents:
diff changeset
    50
93eb5ac6cfb0 6814842: Load shortening optimizations
twisti
parents:
diff changeset
    51
        byte us2b = loadUS2B(ca);
93eb5ac6cfb0 6814842: Load shortening optimizations
twisti
parents:
diff changeset
    52
        if (us2b != (byte) 0xF4)
93eb5ac6cfb0 6814842: Load shortening optimizations
twisti
parents:
diff changeset
    53
            throw new InternalError("loadUS2B failed: " + us2b + " != " + (byte) 0xF4);
93eb5ac6cfb0 6814842: Load shortening optimizations
twisti
parents:
diff changeset
    54
93eb5ac6cfb0 6814842: Load shortening optimizations
twisti
parents:
diff changeset
    55
        byte us2bmask255 = loadUS2Bmask255(ca);
93eb5ac6cfb0 6814842: Load shortening optimizations
twisti
parents:
diff changeset
    56
        if (us2bmask255 != (byte) 0xF4)
93eb5ac6cfb0 6814842: Load shortening optimizations
twisti
parents:
diff changeset
    57
            throw new InternalError("loadUS2Bmask255 failed: " + us2bmask255 + " != " + (byte) 0xF4);
93eb5ac6cfb0 6814842: Load shortening optimizations
twisti
parents:
diff changeset
    58
93eb5ac6cfb0 6814842: Load shortening optimizations
twisti
parents:
diff changeset
    59
        byte i2b = loadI2B(ia);
93eb5ac6cfb0 6814842: Load shortening optimizations
twisti
parents:
diff changeset
    60
        if (i2b != (byte) 0xF4)
93eb5ac6cfb0 6814842: Load shortening optimizations
twisti
parents:
diff changeset
    61
            throw new InternalError("loadI2B failed: " + i2b + " != " + (byte) 0xF4);
93eb5ac6cfb0 6814842: Load shortening optimizations
twisti
parents:
diff changeset
    62
93eb5ac6cfb0 6814842: Load shortening optimizations
twisti
parents:
diff changeset
    63
        byte i2bmask255 = loadI2Bmask255(ia);
93eb5ac6cfb0 6814842: Load shortening optimizations
twisti
parents:
diff changeset
    64
        if (i2bmask255 != (byte) 0xF4)
93eb5ac6cfb0 6814842: Load shortening optimizations
twisti
parents:
diff changeset
    65
            throw new InternalError("loadI2Bmask255 failed: " + i2bmask255 + " != " + (byte) 0xF4);
93eb5ac6cfb0 6814842: Load shortening optimizations
twisti
parents:
diff changeset
    66
93eb5ac6cfb0 6814842: Load shortening optimizations
twisti
parents:
diff changeset
    67
        short i2s = loadI2S(ia);
93eb5ac6cfb0 6814842: Load shortening optimizations
twisti
parents:
diff changeset
    68
        if (i2s != (short) 0xF3F4)
93eb5ac6cfb0 6814842: Load shortening optimizations
twisti
parents:
diff changeset
    69
            throw new InternalError("loadI2S failed: " + i2s + " != " + (short) 0xF3F4);
93eb5ac6cfb0 6814842: Load shortening optimizations
twisti
parents:
diff changeset
    70
93eb5ac6cfb0 6814842: Load shortening optimizations
twisti
parents:
diff changeset
    71
        short i2smask255 = loadI2Smask255(ia);
93eb5ac6cfb0 6814842: Load shortening optimizations
twisti
parents:
diff changeset
    72
        if (i2smask255 != (short) 0xF4)
93eb5ac6cfb0 6814842: Load shortening optimizations
twisti
parents:
diff changeset
    73
            throw new InternalError("loadI2Smask255 failed: " + i2smask255 + " != " + (short) 0xF4);
93eb5ac6cfb0 6814842: Load shortening optimizations
twisti
parents:
diff changeset
    74
93eb5ac6cfb0 6814842: Load shortening optimizations
twisti
parents:
diff changeset
    75
        short i2smask65535 = loadI2Smask65535(ia);
93eb5ac6cfb0 6814842: Load shortening optimizations
twisti
parents:
diff changeset
    76
        if (i2smask65535 != (short) 0xF3F4)
93eb5ac6cfb0 6814842: Load shortening optimizations
twisti
parents:
diff changeset
    77
            throw new InternalError("loadI2Smask65535 failed: " + i2smask65535 + " != " + (short) 0xF3F4);
93eb5ac6cfb0 6814842: Load shortening optimizations
twisti
parents:
diff changeset
    78
93eb5ac6cfb0 6814842: Load shortening optimizations
twisti
parents:
diff changeset
    79
        char i2us = loadI2US(ia);
93eb5ac6cfb0 6814842: Load shortening optimizations
twisti
parents:
diff changeset
    80
        if (i2us != (char) 0xF3F4)
93eb5ac6cfb0 6814842: Load shortening optimizations
twisti
parents:
diff changeset
    81
            throw new InternalError("loadI2US failed: " + (int) i2us + " != " + (char) 0xF3F4);
93eb5ac6cfb0 6814842: Load shortening optimizations
twisti
parents:
diff changeset
    82
93eb5ac6cfb0 6814842: Load shortening optimizations
twisti
parents:
diff changeset
    83
        char i2usmask255 = loadI2USmask255(ia);
93eb5ac6cfb0 6814842: Load shortening optimizations
twisti
parents:
diff changeset
    84
        if (i2usmask255 != (char) 0xF4)
93eb5ac6cfb0 6814842: Load shortening optimizations
twisti
parents:
diff changeset
    85
            throw new InternalError("loadI2USmask255 failed: " + (int) i2usmask255 + " != " + (char) 0xF4);
93eb5ac6cfb0 6814842: Load shortening optimizations
twisti
parents:
diff changeset
    86
93eb5ac6cfb0 6814842: Load shortening optimizations
twisti
parents:
diff changeset
    87
        char i2usmask65535 = loadI2USmask65535(ia);
93eb5ac6cfb0 6814842: Load shortening optimizations
twisti
parents:
diff changeset
    88
        if (i2usmask65535 != (char) 0xF3F4)
93eb5ac6cfb0 6814842: Load shortening optimizations
twisti
parents:
diff changeset
    89
            throw new InternalError("loadI2USmask65535 failed: " + (int) i2usmask65535 + " != " + (char) 0xF3F4);
93eb5ac6cfb0 6814842: Load shortening optimizations
twisti
parents:
diff changeset
    90
    }
93eb5ac6cfb0 6814842: Load shortening optimizations
twisti
parents:
diff changeset
    91
93eb5ac6cfb0 6814842: Load shortening optimizations
twisti
parents:
diff changeset
    92
    static byte  loadS2B          (short[] sa) { return (byte)  (sa[0]         ); }
93eb5ac6cfb0 6814842: Load shortening optimizations
twisti
parents:
diff changeset
    93
    static byte  loadS2Bmask255   (short[] sa) { return (byte)  (sa[0] & 0xFF  ); }
93eb5ac6cfb0 6814842: Load shortening optimizations
twisti
parents:
diff changeset
    94
93eb5ac6cfb0 6814842: Load shortening optimizations
twisti
parents:
diff changeset
    95
    static byte  loadUS2B         (char[]  ca) { return (byte)  (ca[0]         ); }
93eb5ac6cfb0 6814842: Load shortening optimizations
twisti
parents:
diff changeset
    96
    static byte  loadUS2Bmask255  (char[]  ca) { return (byte)  (ca[0] & 0xFF  ); }
93eb5ac6cfb0 6814842: Load shortening optimizations
twisti
parents:
diff changeset
    97
93eb5ac6cfb0 6814842: Load shortening optimizations
twisti
parents:
diff changeset
    98
    static byte  loadI2B          (int[]   ia) { return (byte)  (ia[0]         ); }
93eb5ac6cfb0 6814842: Load shortening optimizations
twisti
parents:
diff changeset
    99
    static byte  loadI2Bmask255   (int[]   ia) { return (byte)  (ia[0] & 0xFF  ); }
93eb5ac6cfb0 6814842: Load shortening optimizations
twisti
parents:
diff changeset
   100
93eb5ac6cfb0 6814842: Load shortening optimizations
twisti
parents:
diff changeset
   101
    static short loadI2S          (int[]   ia) { return (short) (ia[0]         ); }
93eb5ac6cfb0 6814842: Load shortening optimizations
twisti
parents:
diff changeset
   102
    static short loadI2Smask255   (int[]   ia) { return (short) (ia[0] & 0xFF  ); }
93eb5ac6cfb0 6814842: Load shortening optimizations
twisti
parents:
diff changeset
   103
    static short loadI2Smask65535 (int[]   ia) { return (short) (ia[0] & 0xFFFF); }
93eb5ac6cfb0 6814842: Load shortening optimizations
twisti
parents:
diff changeset
   104
93eb5ac6cfb0 6814842: Load shortening optimizations
twisti
parents:
diff changeset
   105
    static char  loadI2US         (int[]   ia) { return (char)  (ia[0]         ); }
93eb5ac6cfb0 6814842: Load shortening optimizations
twisti
parents:
diff changeset
   106
    static char  loadI2USmask255  (int[]   ia) { return (char)  (ia[0] & 0xFF  ); }
93eb5ac6cfb0 6814842: Load shortening optimizations
twisti
parents:
diff changeset
   107
    static char  loadI2USmask65535(int[]   ia) { return (char)  (ia[0] & 0xFFFF); }
93eb5ac6cfb0 6814842: Load shortening optimizations
twisti
parents:
diff changeset
   108
}