11 * This code is distributed in the hope that it will be useful, but WITHOUT 12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 * version 2 for more details (a copy is included in the LICENSE file that 15 * accompanied this code). 16 * 17 * You should have received a copy of the GNU General Public License version 18 * 2 along with this work; if not, write to the Free Software Foundation, 19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 * 21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 22 * or visit www.oracle.com if you need additional information or have any 23 * questions. 24 */ 25 26 /* 27 * @test 28 * @bug 8054307 29 * @summary Validates StringCoding.hasNegatives intrinsic with a small range of tests. 30 * @library /compiler/patches 31 * @build java.base/java.lang.Helper 32 * @build compiler.intrinsics.string.TestHasNegatives 33 * @run main compiler.intrinsics.string.TestHasNegatives 34 */ 35 package compiler.intrinsics.string; 36 37 import java.lang.Helper; 38 39 /* 40 * @summary Validates StringCoding.hasNegatives intrinsic with a small 41 * range of tests. 42 */ 43 public class TestHasNegatives { 44 45 private static byte[] tBa = new byte[4096 + 16]; 46 47 /** 48 * Completely initialize the test array, preparing it for tests of the 49 * StringCoding.hasNegatives method with a given array segment offset, 50 * length, and number of negative bytes. 51 */ 52 public static void initialize(int off, int len, int neg) { 53 assert (len + off <= tBa.length); 54 // insert "canary" (negative) values before offset 55 for (int i = 0; i < off; ++i) { 56 tBa[i] = (byte) (((i + 15) & 0x7F) | 0x80); 57 } | 11 * This code is distributed in the hope that it will be useful, but WITHOUT 12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 * version 2 for more details (a copy is included in the LICENSE file that 15 * accompanied this code). 16 * 17 * You should have received a copy of the GNU General Public License version 18 * 2 along with this work; if not, write to the Free Software Foundation, 19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 * 21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 22 * or visit www.oracle.com if you need additional information or have any 23 * questions. 24 */ 25 26 /* 27 * @test 28 * @bug 8054307 29 * @summary Validates StringCoding.hasNegatives intrinsic with a small range of tests. 30 * @library /compiler/patches 31 * 32 * @build java.base/java.lang.Helper 33 * @build compiler.intrinsics.string.TestHasNegatives 34 * @run main compiler.intrinsics.string.TestHasNegatives 35 */ 36 37 package compiler.intrinsics.string; 38 39 /* 40 * @summary Validates StringCoding.hasNegatives intrinsic with a small 41 * range of tests. 42 */ 43 public class TestHasNegatives { 44 45 private static byte[] tBa = new byte[4096 + 16]; 46 47 /** 48 * Completely initialize the test array, preparing it for tests of the 49 * StringCoding.hasNegatives method with a given array segment offset, 50 * length, and number of negative bytes. 51 */ 52 public static void initialize(int off, int len, int neg) { 53 assert (len + off <= tBa.length); 54 // insert "canary" (negative) values before offset 55 for (int i = 0; i < off; ++i) { 56 tBa[i] = (byte) (((i + 15) & 0x7F) | 0x80); 57 } |