< prev index next >

test/compiler/c2/Test6603011.java

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

*** 25,54 **** * @test * @bug 6603011 * @summary long/int division by constant * @modules java.base/jdk.internal.misc * @library /testlibrary ! * @run main/othervm -Xcomp -Xbatch -XX:-Inline Test */ // // -XX:-Inline is essential to this test so that verification functions // divi, modi, divl and modl generate "plain" divides. // -Xcomp -Xbatch are also useful to ensure the full range of // dividend and divisor combinations are tested // import jdk.test.lib.Utils; ! class s { static int divi(int dividend, int divisor) { return dividend / divisor; } static int modi(int dividend, int divisor) { return dividend % divisor; } static long divl(long dividend, long divisor) { return dividend / divisor; } static long modl(long dividend, long divisor) { return dividend % divisor; } ! } ! ! public class Test implements Runnable { // Report verbose messages on failure; turn off to suppress // too much output with gross numbers of failures. static final boolean VERBOSE = true; // Initailize DIVISOR so that it is final in this class. --- 25,56 ---- * @test * @bug 6603011 * @summary long/int division by constant * @modules java.base/jdk.internal.misc * @library /testlibrary ! * ! * @run main/othervm -Xcomp -Xbatch -XX:-Inline compiler.c2.Test6603011 */ // // -XX:-Inline is essential to this test so that verification functions // divi, modi, divl and modl generate "plain" divides. // -Xcomp -Xbatch are also useful to ensure the full range of // dividend and divisor combinations are tested // + package compiler.c2; + import jdk.test.lib.Utils; ! public class Test6603011 implements Runnable { ! static class s { static int divi(int dividend, int divisor) { return dividend / divisor; } static int modi(int dividend, int divisor) { return dividend % divisor; } static long divl(long dividend, long divisor) { return dividend / divisor; } static long modl(long dividend, long divisor) { return dividend % divisor; } ! } // Report verbose messages on failure; turn off to suppress // too much output with gross numbers of failures. static final boolean VERBOSE = true; // Initailize DIVISOR so that it is final in this class.
*** 192,208 **** public static void test_divisor(int divisor, ClassLoader apploader) throws Exception { System.setProperty("divisor", "" + divisor); ClassLoader loader = Utils.getTestClassPathURLClassLoader(apploader.getParent()); ! Class c = loader.loadClass("Test"); Runnable r = (Runnable)c.newInstance(); r.run(); } public static void main(String[] args) throws Exception { ! Class cl = Class.forName("Test"); ClassLoader apploader = cl.getClassLoader(); // Test every divisor between -100 and 100. for (int i = -100; i <= 100; i++) { --- 194,210 ---- public static void test_divisor(int divisor, ClassLoader apploader) throws Exception { System.setProperty("divisor", "" + divisor); ClassLoader loader = Utils.getTestClassPathURLClassLoader(apploader.getParent()); ! Class c = loader.loadClass(Test6603011.class.getName()); Runnable r = (Runnable)c.newInstance(); r.run(); } public static void main(String[] args) throws Exception { ! Class cl = Test6603011.class; ClassLoader apploader = cl.getClassLoader(); // Test every divisor between -100 and 100. for (int i = -100; i <= 100; i++) {
< prev index next >