test/compiler/6946040/TestCharShortByteSwap.java

Print this page
rev 4502 : 7115383: TEST_BUG: some jtreg tests fail because they explicitly specify -server option
Summary: Small changes to hotspot tests to remove  "-server" and replace with ${TESTVMOPTS}
Reviewed-by: kvn


   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 -server -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) { }




   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) { }