< prev index next >

test/compiler/c2/TestCharShortByteSwap.java

Print this page
rev 11557 : 8132919: use package in compiler tests
Reviewed-by: duke


   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 /*
  26  * @test
  27  * @bug 6946040
  28  * @summary Tests Character/Short.reverseBytes and their intrinsics implementation in the server compiler
  29  * @run main/othervm -Xbatch -XX:CompileOnly=.testChar,.testShort TestCharShortByteSwap




  30  */
  31 


  32 // This test must run without any command line arguments.
  33 
  34 public class TestCharShortByteSwap {
  35 
  36   private static short initShort(String[] args, short v) {
  37     if (args.length > 0) {
  38       try {
  39         return (short) Integer.valueOf(args[0]).intValue();
  40       } catch (NumberFormatException e) { }
  41     }
  42     return v;
  43   }
  44 
  45   private static char initChar(String[] args, char v) {
  46     if (args.length > 0) {
  47       try {
  48         return (char) Integer.valueOf(args[0]).intValue();
  49       } catch (NumberFormatException e) { }
  50     }
  51     return v;




   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 /*
  26  * @test
  27  * @bug 6946040
  28  * @summary Tests Character/Short.reverseBytes and their intrinsics implementation in the server compiler
  29  *
  30  * @run main/othervm -Xbatch
  31  *      -XX:CompileCommand=compileonly,compiler.c2.TestCharShortByteSwap::testChar
  32  *      -XX:CompileCommand=compileonly,compiler.c2.TestCharShortByteSwap::testShort
  33  *      compiler.c2.TestCharShortByteSwap
  34  */
  35 
  36 package compiler.c2;
  37 
  38 // This test must run without any command line arguments.
  39 
  40 public class TestCharShortByteSwap {
  41 
  42   private static short initShort(String[] args, short v) {
  43     if (args.length > 0) {
  44       try {
  45         return (short) Integer.valueOf(args[0]).intValue();
  46       } catch (NumberFormatException e) { }
  47     }
  48     return v;
  49   }
  50 
  51   private static char initChar(String[] args, char v) {
  52     if (args.length > 0) {
  53       try {
  54         return (char) Integer.valueOf(args[0]).intValue();
  55       } catch (NumberFormatException e) { }
  56     }
  57     return v;


< prev index next >