23 |
23 |
24 /** |
24 /** |
25 * @test |
25 * @test |
26 * @bug 8031321 |
26 * @bug 8031321 |
27 * @summary Verify processing of UseCountTrailingZerosInstruction option |
27 * @summary Verify processing of UseCountTrailingZerosInstruction option |
28 * on CPU without TZCNT instuction (BMI1 feature) support. |
28 * on CPU without TZCNT instruction (BMI1 feature) support. |
29 * @library /testlibrary /testlibrary/whitebox |
29 * @library /testlibrary /testlibrary/whitebox |
30 * @build TestUseCountTrailingZerosInstructionOnUnsupportedCPU |
30 * @build TestUseCountTrailingZerosInstructionOnUnsupportedCPU |
31 * BMIUnsupportedCPUTest |
31 * BMIUnsupportedCPUTest |
32 * @run main ClassFileInstaller sun.hotspot.WhiteBox |
32 * @run main ClassFileInstaller sun.hotspot.WhiteBox |
33 * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions |
33 * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions |
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 TestUseCountTrailingZerosInstructionOnUnsupportedCPU |
42 public class TestUseCountTrailingZerosInstructionOnUnsupportedCPU |
43 extends BMIUnsupportedCPUTest { |
43 extends BMIUnsupportedCPUTest { |
|
44 private static final String ENABLE_BMI = "-XX:+UseBMI1Instructions"; |
44 |
45 |
45 public TestUseCountTrailingZerosInstructionOnUnsupportedCPU() { |
46 public TestUseCountTrailingZerosInstructionOnUnsupportedCPU() { |
46 super("UseCountTrailingZerosInstruction", TZCNT_WARNING, "bmi1"); |
47 super("UseCountTrailingZerosInstruction", TZCNT_WARNING, "bmi1"); |
47 } |
48 } |
48 |
49 |
49 @Override |
50 @Override |
50 public void unsupportedX86CPUTestCases() throws Throwable { |
51 public void unsupportedX86CPUTestCases() throws Throwable { |
51 |
52 |
52 super.unsupportedX86CPUTestCases(); |
53 super.unsupportedX86CPUTestCases(); |
53 |
54 |
54 // verify that option will not be turned on during |
55 /* |
55 // UseBMI1Instuctions processing |
56 Verify that option will not be turned on during UseBMI1Instructions |
56 CommandLineOptionTest. |
57 processing. 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 TestUseCountTrailingZerosInstructionOnUnsupportedCPU. |
|
62 ENABLE_BMI); |
59 |
63 |
60 CommandLineOptionTest. |
64 /* |
61 verifyOptionValue("UseCountTrailingZerosInstruction", "false", |
65 VM will be launched with following options: |
62 "-XX:+UseCountTrailingZerosInstruction", |
66 -XX:+UseCountTrailingZerosInstruction -XX:+UseBMI1Instructions |
63 "-XX:+UseBMI1Instructions"); |
67 -version |
|
68 */ |
|
69 CommandLineOptionTest.verifyOptionValueForSameVM(optionName, "false", |
|
70 CommandLineOptionTest.prepareBooleanFlag(optionName, true), |
|
71 TestUseCountTrailingZerosInstructionOnUnsupportedCPU. |
|
72 ENABLE_BMI); |
64 } |
73 } |
65 |
74 |
66 public static void main(String args[]) throws Throwable { |
75 public static void main(String args[]) throws Throwable { |
67 new TestUseCountTrailingZerosInstructionOnUnsupportedCPU().test(); |
76 new TestUseCountTrailingZerosInstructionOnUnsupportedCPU().test(); |
68 } |
77 } |