hotspot/test/compiler/arguments/TestUseCountTrailingZerosInstructionOnSupportedCPU.java
changeset 24674 dbf660a72081
parent 23501 ba4a33b2a569
child 25958 8dc85547d6d6
equal deleted inserted replaced
24673:2ec56802b829 24674:dbf660a72081
    38 import sun.hotspot.cpuinfo.CPUInfo;
    38 import sun.hotspot.cpuinfo.CPUInfo;
    39 import com.oracle.java.testlibrary.*;
    39 import com.oracle.java.testlibrary.*;
    40 import com.oracle.java.testlibrary.cli.*;
    40 import com.oracle.java.testlibrary.cli.*;
    41 
    41 
    42 public class TestUseCountTrailingZerosInstructionOnSupportedCPU
    42 public class TestUseCountTrailingZerosInstructionOnSupportedCPU
    43      extends BMISupportedCPUTest {
    43         extends BMISupportedCPUTest {
       
    44     private static final String DISABLE_BMI = "-XX:-UseBMI1Instructions";
    44 
    45 
    45     public TestUseCountTrailingZerosInstructionOnSupportedCPU() {
    46     public TestUseCountTrailingZerosInstructionOnSupportedCPU() {
    46         super("UseCountTrailingZerosInstruction", TZCNT_WARNING, "bmi1");
    47         super("UseCountTrailingZerosInstruction", TZCNT_WARNING, "bmi1");
    47     }
    48     }
    48 
    49 
    49     @Override
    50     @Override
    50     public void runTestCases() throws Throwable {
    51     public void runTestCases() throws Throwable {
    51 
    52 
    52         super.runTestCases();
    53         super.runTestCases();
    53 
    54 
    54         // verify that option will be disabled if all BMI1 instuctions
    55         /*
    55         // are explicitly disabled
    56           Verify that option will be disabled if all BMI1 instructions
    56         CommandLineOptionTest.
    57           are explicitly disabled. VM will be launched with following options:
    57             verifyOptionValue("UseCountTrailingZerosInstruction", "false",
    58           -XX:-UseBMI1Instructions -version
    58                               "-XX:-UseBMI1Instructions");
    59         */
       
    60         CommandLineOptionTest.verifyOptionValueForSameVM(optionName, "false",
       
    61                 TestUseCountTrailingZerosInstructionOnSupportedCPU.DISABLE_BMI);
    59 
    62 
    60         // verify that option could be turned on even if other BMI1
    63         /*
    61         // instructions were turned off
    64           Verify that option could be turned on even if other BMI1
    62         CommandLineOptionTest.
    65           instructions were turned off. VM will be launched with following
    63             verifyOptionValue("UseCountTrailingZerosInstruction", "true",
    66           options: -XX:-UseBMI1Instructions
    64                               "-XX:-UseBMI1Instructions",
    67           -XX:+UseCountTrailingZerosInstruction -version
    65                               "-XX:+UseCountTrailingZerosInstruction");
    68         */
       
    69         CommandLineOptionTest.verifyOptionValueForSameVM(optionName, "true",
       
    70                 TestUseCountTrailingZerosInstructionOnSupportedCPU.DISABLE_BMI,
       
    71                 CommandLineOptionTest.prepareBooleanFlag(optionName, true));
    66     }
    72     }
    67 
    73 
    68     public static void main(String args[]) throws Throwable {
    74     public static void main(String args[]) throws Throwable {
    69         new TestUseCountTrailingZerosInstructionOnSupportedCPU().test();
    75         new TestUseCountTrailingZerosInstructionOnSupportedCPU().test();
    70     }
    76     }