--- old/test/compiler/cpuflags/TestAESIntrinsicsOnSupportedConfig.java 2017-05-25 18:12:46.951157419 -0700 +++ new/test/compiler/cpuflags/TestAESIntrinsicsOnSupportedConfig.java 2017-05-25 18:12:46.819157426 -0700 @@ -26,6 +26,7 @@ * @library /test/lib / * @modules java.base/jdk.internal.misc * java.management + * @requires vm.cpu.features ~= ".*aes.*" * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission @@ -40,18 +41,11 @@ import jdk.test.lib.process.OutputAnalyzer; import jdk.test.lib.Platform; import jdk.test.lib.process.ProcessTools; +import sun.hotspot.WhiteBox; +import static jdk.test.lib.cli.CommandLineOptionTest.*; public class TestAESIntrinsicsOnSupportedConfig extends AESIntrinsicsBase { - /** - * Constructs new TestAESIntrinsicsOnSupportedConfig that will be executed - * only if AESSupportPredicate returns true - */ - private TestAESIntrinsicsOnSupportedConfig() { - super(AESIntrinsicsBase.AES_SUPPORTED_PREDICATE); - } - - @Override protected void runTestCases() throws Throwable { testUseAES(); testUseAESUseSSE2(); @@ -63,6 +57,16 @@ } /** + * Check if value of TieredStopAtLevel flag is greater than specified level. + * + * @param level tiered compilation level to compare with + */ + private boolean isTieredLevelGreaterThan(int level) { + Long val = WhiteBox.getWhiteBox().getIntxVMFlag("TieredStopAtLevel"); + return (val != null && val > level); + } + + /** * Test checks following situation:
* UseAES flag is set to true, TestAESMain is executed
* Expected result: UseAESIntrinsics flag is set to true
@@ -75,7 +79,7 @@ prepareArguments(prepareBooleanFlag(AESIntrinsicsBase .USE_AES, true))); final String errorMessage = "Case testUseAES failed"; - if (Platform.isServer() && !Platform.isEmulatedClient()) { + if (Platform.isServer() && !Platform.isEmulatedClient() && isTieredLevelGreaterThan(3)) { verifyOutput(new String[]{AESIntrinsicsBase.CIPHER_INTRINSIC, AESIntrinsicsBase.AES_INTRINSIC}, null, errorMessage, outputAnalyzer); @@ -252,6 +256,6 @@ } public static void main(String args[]) throws Throwable { - new TestAESIntrinsicsOnSupportedConfig().test(); + new TestAESIntrinsicsOnSupportedConfig().runTestCases(); } }