hotspot/test/compiler/7192963/TestByteVect.java
author zgu
Thu, 04 Sep 2014 14:50:31 -0400
changeset 26561 e104c9397ca1
parent 13490 d19348851d2e
permissions -rw-r--r--
8055289: Internal Error: mallocTracker.cpp:146 fatal error: Should not use malloc for big memory block, use virtual memory instead Summary: Return NULL if memory allocation size is bigger than MAX_MALLOC_SIZE when NMT is on Reviewed-by: coleenp, gtriantafill
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
13490
d19348851d2e 7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
diff changeset
     1
/*
d19348851d2e 7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
diff changeset
     2
 * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
d19348851d2e 7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
d19348851d2e 7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
diff changeset
     4
 *
d19348851d2e 7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
d19348851d2e 7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
d19348851d2e 7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
diff changeset
     7
 * published by the Free Software Foundation.
d19348851d2e 7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
diff changeset
     8
 *
d19348851d2e 7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
d19348851d2e 7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
d19348851d2e 7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
d19348851d2e 7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
d19348851d2e 7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
diff changeset
    13
 * accompanied this code).
d19348851d2e 7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
diff changeset
    14
 *
d19348851d2e 7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
d19348851d2e 7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
d19348851d2e 7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
d19348851d2e 7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
diff changeset
    18
 *
d19348851d2e 7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
d19348851d2e 7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
d19348851d2e 7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
diff changeset
    21
 * questions.
d19348851d2e 7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
diff changeset
    22
 *
d19348851d2e 7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
diff changeset
    23
 */
d19348851d2e 7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
diff changeset
    24
d19348851d2e 7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
diff changeset
    25
/**
d19348851d2e 7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
diff changeset
    26
 * @test
d19348851d2e 7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
diff changeset
    27
 * @bug 7192963
d19348851d2e 7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
diff changeset
    28
 * @summary assert(_in[req-1] == this) failed: Must pass arg count to 'new'
d19348851d2e 7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
diff changeset
    29
 *
d19348851d2e 7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
diff changeset
    30
 * @run main/othervm/timeout=400 -Xbatch -Xmx64m TestByteVect
d19348851d2e 7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
diff changeset
    31
 */
d19348851d2e 7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
diff changeset
    32
d19348851d2e 7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
diff changeset
    33
public class TestByteVect {
d19348851d2e 7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
diff changeset
    34
  private static final int ARRLEN = 997;
d19348851d2e 7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
diff changeset
    35
  private static final int ITERS  = 11000;
d19348851d2e 7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
diff changeset
    36
  public static void main(String args[]) {
d19348851d2e 7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
diff changeset
    37
    System.out.println("Testing Byte vectors");
d19348851d2e 7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
diff changeset
    38
    int errn = test();
d19348851d2e 7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
diff changeset
    39
    if (errn > 0) {
d19348851d2e 7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
diff changeset
    40
      System.err.println("FAILED: " + errn + " errors");
d19348851d2e 7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
diff changeset
    41
      System.exit(97);
d19348851d2e 7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
diff changeset
    42
    }
d19348851d2e 7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
diff changeset
    43
    System.out.println("PASSED");
d19348851d2e 7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
diff changeset
    44
  }
d19348851d2e 7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
diff changeset
    45
d19348851d2e 7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
diff changeset
    46
  static int test() {
d19348851d2e 7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
diff changeset
    47
    byte[] a0 = new byte[ARRLEN];
d19348851d2e 7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
diff changeset
    48
    byte[] a1 = new byte[ARRLEN];
d19348851d2e 7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
diff changeset
    49
    // Initialize
d19348851d2e 7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
diff changeset
    50
    for (int i=0; i<ARRLEN; i++) {
d19348851d2e 7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
diff changeset
    51
      a1[i] = (byte)i;
d19348851d2e 7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
diff changeset
    52
    }
d19348851d2e 7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
diff changeset
    53
    System.out.println("Warmup");
d19348851d2e 7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
diff changeset
    54
    for (int i=0; i<ITERS; i++) {
d19348851d2e 7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
diff changeset
    55
      test_init(a0);
d19348851d2e 7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
diff changeset
    56
      test_addi(a0, a1);
d19348851d2e 7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
diff changeset
    57
      test_lsai(a0, a1);
d19348851d2e 7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
diff changeset
    58
      test_unrl_init(a0);
d19348851d2e 7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
diff changeset
    59
      test_unrl_addi(a0, a1);
d19348851d2e 7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
diff changeset
    60
      test_unrl_lsai(a0, a1);
d19348851d2e 7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
diff changeset
    61
    }
d19348851d2e 7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
diff changeset
    62
    // Test and verify results
d19348851d2e 7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
diff changeset
    63
    System.out.println("Verification");
d19348851d2e 7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
diff changeset
    64
    int errn = 0;
d19348851d2e 7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
diff changeset
    65
    {
d19348851d2e 7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
diff changeset
    66
      test_init(a0);
d19348851d2e 7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
diff changeset
    67
      for (int i=0; i<ARRLEN; i++) {
d19348851d2e 7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
diff changeset
    68
        errn += verify("test_init: ", i, a0[i], (byte)(i&3));
d19348851d2e 7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
diff changeset
    69
      }
d19348851d2e 7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
diff changeset
    70
      test_addi(a0, a1);
d19348851d2e 7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
diff changeset
    71
      for (int i=0; i<ARRLEN; i++) {
d19348851d2e 7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
diff changeset
    72
        errn += verify("test_addi: ", i, a0[i], (byte)(i+(i&3)));
d19348851d2e 7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
diff changeset
    73
      }
d19348851d2e 7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
diff changeset
    74
      test_lsai(a0, a1);
d19348851d2e 7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
diff changeset
    75
      for (int i=0; i<ARRLEN; i++) {
d19348851d2e 7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
diff changeset
    76
        errn += verify("test_lsai: ", i, a0[i], (byte)(i<<(i&3)));
d19348851d2e 7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
diff changeset
    77
      }
d19348851d2e 7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
diff changeset
    78
      test_unrl_init(a0);
d19348851d2e 7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
diff changeset
    79
      for (int i=0; i<ARRLEN; i++) {
d19348851d2e 7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
diff changeset
    80
        errn += verify("test_unrl_init: ", i, a0[i], (byte)(i&3));
d19348851d2e 7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
diff changeset
    81
      }
d19348851d2e 7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
diff changeset
    82
      test_unrl_addi(a0, a1);
d19348851d2e 7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
diff changeset
    83
      for (int i=0; i<ARRLEN; i++) {
d19348851d2e 7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
diff changeset
    84
        errn += verify("test_unrl_addi: ", i, a0[i], (byte)(i+(i&3)));
d19348851d2e 7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
diff changeset
    85
      }
d19348851d2e 7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
diff changeset
    86
      test_unrl_lsai(a0, a1);
d19348851d2e 7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
diff changeset
    87
      for (int i=0; i<ARRLEN; i++) {
d19348851d2e 7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
diff changeset
    88
        errn += verify("test_unrl_lsai: ", i, a0[i], (byte)(i<<(i&3)));
d19348851d2e 7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
diff changeset
    89
      }
d19348851d2e 7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
diff changeset
    90
    }
d19348851d2e 7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
diff changeset
    91
d19348851d2e 7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
diff changeset
    92
    if (errn > 0)
d19348851d2e 7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
diff changeset
    93
      return errn;
d19348851d2e 7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
diff changeset
    94
d19348851d2e 7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
diff changeset
    95
    System.out.println("Time");
d19348851d2e 7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
diff changeset
    96
    long start, end;
d19348851d2e 7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
diff changeset
    97
d19348851d2e 7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
diff changeset
    98
    start = System.currentTimeMillis();
d19348851d2e 7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
diff changeset
    99
    for (int i=0; i<ITERS; i++) {
d19348851d2e 7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
diff changeset
   100
      test_init(a0);
d19348851d2e 7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
diff changeset
   101
    }
d19348851d2e 7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
diff changeset
   102
    end = System.currentTimeMillis();
d19348851d2e 7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
diff changeset
   103
    System.out.println("test_init: " + (end - start));
d19348851d2e 7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
diff changeset
   104
d19348851d2e 7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
diff changeset
   105
    start = System.currentTimeMillis();
d19348851d2e 7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
diff changeset
   106
    for (int i=0; i<ITERS; i++) {
d19348851d2e 7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
diff changeset
   107
      test_addi(a0, a1);
d19348851d2e 7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
diff changeset
   108
    }
d19348851d2e 7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
diff changeset
   109
    end = System.currentTimeMillis();
d19348851d2e 7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
diff changeset
   110
    System.out.println("test_addi: " + (end - start));
d19348851d2e 7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
diff changeset
   111
d19348851d2e 7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
diff changeset
   112
    start = System.currentTimeMillis();
d19348851d2e 7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
diff changeset
   113
    for (int i=0; i<ITERS; i++) {
d19348851d2e 7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
diff changeset
   114
      test_lsai(a0, a1);
d19348851d2e 7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
diff changeset
   115
    }
d19348851d2e 7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
diff changeset
   116
    end = System.currentTimeMillis();
d19348851d2e 7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
diff changeset
   117
    System.out.println("test_lsai: " + (end - start));
d19348851d2e 7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
diff changeset
   118
d19348851d2e 7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
diff changeset
   119
    start = System.currentTimeMillis();
d19348851d2e 7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
diff changeset
   120
    for (int i=0; i<ITERS; i++) {
d19348851d2e 7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
diff changeset
   121
      test_unrl_init(a0);
d19348851d2e 7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
diff changeset
   122
    }
d19348851d2e 7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
diff changeset
   123
    end = System.currentTimeMillis();
d19348851d2e 7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
diff changeset
   124
    System.out.println("test_unrl_init: " + (end - start));
d19348851d2e 7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
diff changeset
   125
d19348851d2e 7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
diff changeset
   126
    start = System.currentTimeMillis();
d19348851d2e 7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
diff changeset
   127
    for (int i=0; i<ITERS; i++) {
d19348851d2e 7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
diff changeset
   128
      test_unrl_addi(a0, a1);
d19348851d2e 7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
diff changeset
   129
    }
d19348851d2e 7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
diff changeset
   130
    end = System.currentTimeMillis();
d19348851d2e 7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
diff changeset
   131
    System.out.println("test_unrl_addi: " + (end - start));
d19348851d2e 7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
diff changeset
   132
d19348851d2e 7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
diff changeset
   133
    start = System.currentTimeMillis();
d19348851d2e 7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
diff changeset
   134
    for (int i=0; i<ITERS; i++) {
d19348851d2e 7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
diff changeset
   135
      test_unrl_lsai(a0, a1);
d19348851d2e 7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
diff changeset
   136
    }
d19348851d2e 7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
diff changeset
   137
    end = System.currentTimeMillis();
d19348851d2e 7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
diff changeset
   138
    System.out.println("test_unrl_lsai: " + (end - start));
d19348851d2e 7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
diff changeset
   139
d19348851d2e 7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
diff changeset
   140
    return errn;
d19348851d2e 7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
diff changeset
   141
  }
d19348851d2e 7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
diff changeset
   142
d19348851d2e 7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
diff changeset
   143
  static void test_init(byte[] a0) {
d19348851d2e 7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
diff changeset
   144
    for (int i = 0; i < a0.length; i+=1) {
d19348851d2e 7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
diff changeset
   145
      a0[i] = (byte)(i&3);
d19348851d2e 7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
diff changeset
   146
    }
d19348851d2e 7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
diff changeset
   147
  }
d19348851d2e 7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
diff changeset
   148
  static void test_addi(byte[] a0, byte[] a1) {
d19348851d2e 7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
diff changeset
   149
    for (int i = 0; i < a0.length; i+=1) {
d19348851d2e 7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
diff changeset
   150
      a0[i] = (byte)(a1[i]+(i&3));
d19348851d2e 7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
diff changeset
   151
    }
d19348851d2e 7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
diff changeset
   152
  }
d19348851d2e 7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
diff changeset
   153
  static void test_lsai(byte[] a0, byte[] a1) {
d19348851d2e 7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
diff changeset
   154
    for (int i = 0; i < a0.length; i+=1) {
d19348851d2e 7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
diff changeset
   155
      a0[i] = (byte)(a1[i]<<(i&3));
d19348851d2e 7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
diff changeset
   156
    }
d19348851d2e 7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
diff changeset
   157
  }
d19348851d2e 7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
diff changeset
   158
  static void test_unrl_init(byte[] a0) {
d19348851d2e 7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
diff changeset
   159
    int i = 0;
d19348851d2e 7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
diff changeset
   160
    for (; i < a0.length-4; i+=4) {
d19348851d2e 7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
diff changeset
   161
      a0[i+0] = 0;
d19348851d2e 7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
diff changeset
   162
      a0[i+1] = 1;
d19348851d2e 7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
diff changeset
   163
      a0[i+2] = 2;
d19348851d2e 7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
diff changeset
   164
      a0[i+3] = 3;
d19348851d2e 7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
diff changeset
   165
    }
d19348851d2e 7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
diff changeset
   166
    for (; i < a0.length; i++) {
d19348851d2e 7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
diff changeset
   167
      a0[i] = (byte)(i&3);
d19348851d2e 7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
diff changeset
   168
    }
d19348851d2e 7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
diff changeset
   169
  }
d19348851d2e 7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
diff changeset
   170
  static void test_unrl_addi(byte[] a0, byte[] a1) {
d19348851d2e 7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
diff changeset
   171
    int i = 0;
d19348851d2e 7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
diff changeset
   172
    for (; i < a0.length-4; i+=4) {
d19348851d2e 7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
diff changeset
   173
      a0[i+0] = (byte)(a1[i+0]+0);
d19348851d2e 7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
diff changeset
   174
      a0[i+1] = (byte)(a1[i+1]+1);
d19348851d2e 7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
diff changeset
   175
      a0[i+2] = (byte)(a1[i+2]+2);
d19348851d2e 7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
diff changeset
   176
      a0[i+3] = (byte)(a1[i+3]+3);
d19348851d2e 7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
diff changeset
   177
    }
d19348851d2e 7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
diff changeset
   178
    for (; i < a0.length; i++) {
d19348851d2e 7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
diff changeset
   179
      a0[i] = (byte)(a1[i]+(i&3));
d19348851d2e 7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
diff changeset
   180
    }
d19348851d2e 7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
diff changeset
   181
  }
d19348851d2e 7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
diff changeset
   182
  static void test_unrl_lsai(byte[] a0, byte[] a1) {
d19348851d2e 7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
diff changeset
   183
    int i = 0;
d19348851d2e 7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
diff changeset
   184
    for (; i < a0.length-4; i+=4) {
d19348851d2e 7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
diff changeset
   185
      a0[i+0] = (byte)(a1[i+0]<<0);
d19348851d2e 7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
diff changeset
   186
      a0[i+1] = (byte)(a1[i+1]<<1);
d19348851d2e 7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
diff changeset
   187
      a0[i+2] = (byte)(a1[i+2]<<2);
d19348851d2e 7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
diff changeset
   188
      a0[i+3] = (byte)(a1[i+3]<<3);
d19348851d2e 7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
diff changeset
   189
    }
d19348851d2e 7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
diff changeset
   190
    for (; i < a0.length; i++) {
d19348851d2e 7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
diff changeset
   191
      a0[i] = (byte)(a1[i]<<(i&3));
d19348851d2e 7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
diff changeset
   192
    }
d19348851d2e 7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
diff changeset
   193
  }
d19348851d2e 7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
diff changeset
   194
d19348851d2e 7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
diff changeset
   195
  static int verify(String text, int i, byte elem, byte val) {
d19348851d2e 7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
diff changeset
   196
    if (elem != val) {
d19348851d2e 7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
diff changeset
   197
      System.err.println(text + "[" + i + "] = " + elem + " != " + val);
d19348851d2e 7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
diff changeset
   198
      return 1;
d19348851d2e 7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
diff changeset
   199
    }
d19348851d2e 7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
diff changeset
   200
    return 0;
d19348851d2e 7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
diff changeset
   201
  }
d19348851d2e 7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
diff changeset
   202
}
d19348851d2e 7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
diff changeset
   203