test/compiler/arguments/TestUseCountTrailingZerosInstructionOnSupportedCPU.java
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File 8038924 Sdiff test/compiler/arguments

test/compiler/arguments/TestUseCountTrailingZerosInstructionOnSupportedCPU.java

Print this page
rev 6404 : 8038924: Test bit-instructions fails with unexpected exit value on sparc
Reviewed-by: iignatyev
Contributed-by: filipp.zhinkin@oracle.com


  24 /**
  25  * @test
  26  * @bug 8031321
  27  * @summary Verify processing of UseCountTrailingZerosInstruction option
  28  *          on CPU with TZCNT (BMI1 feature) support.
  29  * @library /testlibrary /testlibrary/whitebox
  30  * @build TestUseCountTrailingZerosInstructionOnSupportedCPU
  31  *        BMISupportedCPUTest
  32  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  33  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
  34  *                   -XX:+WhiteBoxAPI
  35  *                   TestUseCountTrailingZerosInstructionOnSupportedCPU
  36  */
  37 
  38 import sun.hotspot.cpuinfo.CPUInfo;
  39 import com.oracle.java.testlibrary.*;
  40 import com.oracle.java.testlibrary.cli.*;
  41 
  42 public class TestUseCountTrailingZerosInstructionOnSupportedCPU
  43      extends BMISupportedCPUTest {

  44 
  45     public TestUseCountTrailingZerosInstructionOnSupportedCPU() {
  46         super("UseCountTrailingZerosInstruction", TZCNT_WARNING, "bmi1");
  47     }
  48 
  49     @Override
  50     public void runTestCases() throws Throwable {
  51 
  52         super.runTestCases();
  53 
  54         // verify that option will be disabled if all BMI1 instuctions
  55         // are explicitly disabled
  56         CommandLineOptionTest.
  57             verifyOptionValue("UseCountTrailingZerosInstruction", "false",
  58                               "-XX:-UseBMI1Instructions");
  59 
  60         // verify that option could be turned on even if other BMI1
  61         // instructions were turned off
  62         CommandLineOptionTest.
  63             verifyOptionValue("UseCountTrailingZerosInstruction", "true",
  64                               "-XX:-UseBMI1Instructions",
  65                               "-XX:+UseCountTrailingZerosInstruction");
  66     }
  67 
  68     public static void main(String args[]) throws Throwable {
  69         new TestUseCountTrailingZerosInstructionOnSupportedCPU().test();
  70     }
  71 }
  72 


  24 /**
  25  * @test
  26  * @bug 8031321
  27  * @summary Verify processing of UseCountTrailingZerosInstruction option
  28  *          on CPU with TZCNT (BMI1 feature) support.
  29  * @library /testlibrary /testlibrary/whitebox
  30  * @build TestUseCountTrailingZerosInstructionOnSupportedCPU
  31  *        BMISupportedCPUTest
  32  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  33  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
  34  *                   -XX:+WhiteBoxAPI
  35  *                   TestUseCountTrailingZerosInstructionOnSupportedCPU
  36  */
  37 
  38 import sun.hotspot.cpuinfo.CPUInfo;
  39 import com.oracle.java.testlibrary.*;
  40 import com.oracle.java.testlibrary.cli.*;
  41 
  42 public class TestUseCountTrailingZerosInstructionOnSupportedCPU
  43         extends BMISupportedCPUTest {
  44     private static final String DISABLE_BMI = "-XX:-UseBMI1Instructions";
  45 
  46     public TestUseCountTrailingZerosInstructionOnSupportedCPU() {
  47         super("UseCountTrailingZerosInstruction", TZCNT_WARNING, "bmi1");
  48     }
  49 
  50     @Override
  51     public void runTestCases() throws Throwable {
  52 
  53         super.runTestCases();
  54 
  55         // verify that option will be disabled if all BMI1 instructions
  56         // are explicitly disabled
  57         CommandLineOptionTest.verifyOptionValueForSameVM(optionName, "false",
  58                 TestUseCountTrailingZerosInstructionOnSupportedCPU.DISABLE_BMI);

  59 
  60         // verify that option could be turned on even if other BMI1
  61         // instructions were turned off
  62         CommandLineOptionTest.verifyOptionValueForSameVM(optionName, "true",
  63                 TestUseCountTrailingZerosInstructionOnSupportedCPU.DISABLE_BMI,
  64                 CommandLineOptionTest.prepareBooleanFlag(optionName, true));

  65     }
  66 
  67     public static void main(String args[]) throws Throwable {
  68         new TestUseCountTrailingZerosInstructionOnSupportedCPU().test();
  69     }
  70 }
  71 
test/compiler/arguments/TestUseCountTrailingZerosInstructionOnSupportedCPU.java
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File