< prev index next >

test/compiler/tiered/NonTieredLevelsTest.java

Print this page
rev 11947 : 8173300: [TESTBUG]compiler/tiered/NonTieredLevelsTest.java fails with compiler.whitebox.SimpleTestCaseHelper(int) must be compiled
Summary: Corrected available compilation levels for client builds.
Reviewed-by: kvn


  29  * @build NonTieredLevelsTest
  30  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  31  * @run main/othervm -Xbootclasspath/a:. -XX:-TieredCompilation
  32  *                   -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
  33  *                   -XX:CompileCommand=compileonly,SimpleTestCase$Helper::*
  34  *                   NonTieredLevelsTest
  35  * @summary Verify that only one level can be used
  36  * @author igor.ignatyev@oracle.com
  37  */
  38 public class NonTieredLevelsTest extends CompLevelsTest {
  39     private static final int AVAILABLE_COMP_LEVEL;
  40     private static final IntPredicate IS_AVAILABLE_COMPLEVEL;
  41     static {
  42         String vmName = System.getProperty("java.vm.name");
  43         if (vmName.endsWith(" Server VM")) {
  44             AVAILABLE_COMP_LEVEL = COMP_LEVEL_FULL_OPTIMIZATION;
  45             IS_AVAILABLE_COMPLEVEL = x -> x == COMP_LEVEL_FULL_OPTIMIZATION;
  46         } else if (vmName.endsWith(" Client VM")
  47                 || vmName.endsWith(" Minimal VM")) {
  48             AVAILABLE_COMP_LEVEL = COMP_LEVEL_SIMPLE;
  49             IS_AVAILABLE_COMPLEVEL = x -> x >= COMP_LEVEL_SIMPLE
  50                     && x <= COMP_LEVEL_FULL_PROFILE;
  51         } else {
  52             throw new RuntimeException("Unknown VM: " + vmName);
  53         }
  54 
  55     }
  56     public static void main(String[] args) throws Exception {
  57         if (CompilerWhiteBoxTest.skipOnTieredCompilation(true)) {
  58             return;
  59         }
  60         CompilerWhiteBoxTest.main(NonTieredLevelsTest::new, args);
  61     }
  62 
  63     private NonTieredLevelsTest(TestCase testCase) {
  64         super(testCase);
  65         // to prevent inlining of #method
  66         WHITE_BOX.testSetDontInlineMethod(method, true);
  67     }
  68 
  69     @Override
  70     protected void test() throws Exception {




  29  * @build NonTieredLevelsTest
  30  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  31  * @run main/othervm -Xbootclasspath/a:. -XX:-TieredCompilation
  32  *                   -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
  33  *                   -XX:CompileCommand=compileonly,SimpleTestCase$Helper::*
  34  *                   NonTieredLevelsTest
  35  * @summary Verify that only one level can be used
  36  * @author igor.ignatyev@oracle.com
  37  */
  38 public class NonTieredLevelsTest extends CompLevelsTest {
  39     private static final int AVAILABLE_COMP_LEVEL;
  40     private static final IntPredicate IS_AVAILABLE_COMPLEVEL;
  41     static {
  42         String vmName = System.getProperty("java.vm.name");
  43         if (vmName.endsWith(" Server VM")) {
  44             AVAILABLE_COMP_LEVEL = COMP_LEVEL_FULL_OPTIMIZATION;
  45             IS_AVAILABLE_COMPLEVEL = x -> x == COMP_LEVEL_FULL_OPTIMIZATION;
  46         } else if (vmName.endsWith(" Client VM")
  47                 || vmName.endsWith(" Minimal VM")) {
  48             AVAILABLE_COMP_LEVEL = COMP_LEVEL_SIMPLE;
  49             IS_AVAILABLE_COMPLEVEL = x -> x == COMP_LEVEL_SIMPLE;

  50         } else {
  51             throw new RuntimeException("Unknown VM: " + vmName);
  52         }
  53 
  54     }
  55     public static void main(String[] args) throws Exception {
  56         if (CompilerWhiteBoxTest.skipOnTieredCompilation(true)) {
  57             return;
  58         }
  59         CompilerWhiteBoxTest.main(NonTieredLevelsTest::new, args);
  60     }
  61 
  62     private NonTieredLevelsTest(TestCase testCase) {
  63         super(testCase);
  64         // to prevent inlining of #method
  65         WHITE_BOX.testSetDontInlineMethod(method, true);
  66     }
  67 
  68     @Override
  69     protected void test() throws Exception {


< prev index next >