< prev index next >

test/hotspot/jtreg/compiler/cpuflags/TestAESIntrinsicsOnSupportedConfig.java

Print this page
rev 59103 : imported patch hotspot


  31  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  32  * @run main/othervm/timeout=600 -Xbootclasspath/a:.
  33  *                   -XX:+UnlockDiagnosticVMOptions
  34  *                   -XX:+WhiteBoxAPI -Xbatch
  35  *                   compiler.cpuflags.TestAESIntrinsicsOnSupportedConfig
  36  */
  37 
  38 package compiler.cpuflags;
  39 
  40 import jdk.test.lib.process.OutputAnalyzer;
  41 import jdk.test.lib.Platform;
  42 import jdk.test.lib.process.ProcessTools;
  43 import sun.hotspot.WhiteBox;
  44 import static jdk.test.lib.cli.CommandLineOptionTest.*;
  45 
  46 public class TestAESIntrinsicsOnSupportedConfig extends AESIntrinsicsBase {
  47 
  48     protected void runTestCases() throws Throwable {
  49         testUseAES();
  50         testUseAESUseSSE2();
  51         testUseAESUseVIS2();
  52         testNoUseAES();
  53         testNoUseAESUseSSE2();
  54         testNoUseAESUseVIS2();
  55         testNoUseAESIntrinsic();
  56     }
  57 
  58     /**
  59      * Check if value of TieredStopAtLevel flag is greater than specified level.
  60      *
  61      * @param level tiered compilation level to compare with
  62      */
  63     private boolean isTieredLevelGreaterThan(int level) {
  64         Long val = WhiteBox.getWhiteBox().getIntxVMFlag("TieredStopAtLevel");
  65         return (val != null && val > level);
  66     }
  67 
  68     /**
  69      * Test checks following situation: <br/>
  70      * UseAES flag is set to true, TestAESMain is executed <br/>
  71      * Expected result: UseAESIntrinsics flag is set to true <br/>
  72      * If vm type is server then output should contain intrinsics usage <br/>
  73      *
  74      * @throws Throwable


 130      * Expected result: UseAESIntrinsics flag is set to false <br/>
 131      * Output shouldn't contain intrinsics usage <br/>
 132      *
 133      * @throws Throwable
 134      */
 135     private void testNoUseAESUseSSE2() throws Throwable {
 136         if (Platform.isX86() || Platform.isX64()) {
 137             OutputAnalyzer outputAnalyzer = ProcessTools.executeTestJvm(
 138                     prepareArguments(prepareBooleanFlag(AESIntrinsicsBase
 139                                     .USE_AES, false),
 140                             prepareNumericFlag(AESIntrinsicsBase.USE_SSE, 2)));
 141             final String errorMessage = "Case testNoUseAESUseSSE2 failed";
 142             verifyOutput(null, new String[]{AESIntrinsicsBase.CIPHER_INTRINSIC,
 143                             AESIntrinsicsBase.AES_INTRINSIC},
 144                     errorMessage, outputAnalyzer);
 145             verifyOptionValue(AESIntrinsicsBase.USE_AES, "false", errorMessage,
 146                     outputAnalyzer);
 147             verifyOptionValue(AESIntrinsicsBase.USE_AES_INTRINSICS, "false",
 148                     errorMessage, outputAnalyzer);
 149             verifyOptionValue(AESIntrinsicsBase.USE_SSE, "2", errorMessage,
 150                     outputAnalyzer);
 151         }
 152     }
 153 
 154     /**
 155      * Test checks following situation: <br/>
 156      * UseAES flag is set to true, UseVIS flag is set to 2,
 157      * Platform should support UseVIS (sparc) <br/>
 158      * TestAESMain is executed <br/>
 159      * Expected result: UseAESIntrinsics flag is set to false <br/>
 160      * Output shouldn't contain intrinsics usage <br/>
 161      *
 162      * @throws Throwable
 163      */
 164     private void testUseAESUseVIS2() throws Throwable {
 165         if (Platform.isSparc()) {
 166             OutputAnalyzer outputAnalyzer = ProcessTools.executeTestJvm(
 167                     prepareArguments(prepareBooleanFlag(AESIntrinsicsBase
 168                                     .USE_AES_INTRINSICS, true),
 169                             prepareNumericFlag(AESIntrinsicsBase.USE_VIS, 2)));
 170             final String errorMessage = "Case testUseAESUseVIS2 failed";
 171             verifyOutput(null, new String[]{AESIntrinsicsBase.CIPHER_INTRINSIC,
 172                             AESIntrinsicsBase.AES_INTRINSIC},
 173                     errorMessage, outputAnalyzer);
 174             verifyOptionValue(AESIntrinsicsBase.USE_AES, "true", errorMessage,
 175                     outputAnalyzer);
 176             verifyOptionValue(AESIntrinsicsBase.USE_AES_INTRINSICS, "false",
 177                     errorMessage, outputAnalyzer);
 178             verifyOptionValue(AESIntrinsicsBase.USE_VIS, "2", errorMessage,
 179                     outputAnalyzer);
 180         }
 181     }
 182 
 183 
 184     /**
 185      * Test checks following situation: <br/>
 186      * UseAES flag is set to false, UseVIS flag is set to 2,
 187      * Platform should support UseVIS (sparc) <br/>
 188      * TestAESMain is executed <br/>
 189      * Expected result: UseAESIntrinsics flag is set to false <br/>
 190      * Output shouldn't contain intrinsics usage <br/>
 191      *
 192      * @throws Throwable
 193      */
 194     private void testNoUseAESUseVIS2() throws Throwable {
 195         if (Platform.isSparc()) {
 196             OutputAnalyzer outputAnalyzer = ProcessTools.executeTestJvm(
 197                     prepareArguments(prepareBooleanFlag(AESIntrinsicsBase
 198                                     .USE_AES, false),
 199                             prepareNumericFlag(AESIntrinsicsBase.USE_VIS, 2)));
 200             final String errorMessage = "Case testNoUseAESUseVIS2 failed";
 201             verifyOutput(null, new String[]{AESIntrinsicsBase.CIPHER_INTRINSIC,
 202                             AESIntrinsicsBase.AES_INTRINSIC},
 203                     errorMessage, outputAnalyzer);
 204             verifyOptionValue(AESIntrinsicsBase.USE_AES, "false", errorMessage,
 205                     outputAnalyzer);
 206             verifyOptionValue(AESIntrinsicsBase.USE_AES_INTRINSICS, "false",
 207                     errorMessage, outputAnalyzer);
 208             verifyOptionValue(AESIntrinsicsBase.USE_VIS, "2", errorMessage,
 209                     outputAnalyzer);
 210         }
 211     }
 212 
 213     /**
 214      * Test checks following situation: <br/>
 215      * UseAES flag is set to false, TestAESMain is executed <br/>
 216      * Expected result: UseAESIntrinsics flag is set to false <br/>
 217      * Output shouldn't contain intrinsics usage <br/>
 218      *
 219      * @throws Throwable
 220      */
 221     private void testNoUseAES() throws Throwable {
 222         OutputAnalyzer outputAnalyzer = ProcessTools.executeTestJvm(
 223                 prepareArguments(prepareBooleanFlag(AESIntrinsicsBase
 224                         .USE_AES, false)));
 225         final String errorMessage = "Case testNoUseAES failed";
 226         verifyOutput(null, new String[]{AESIntrinsicsBase.CIPHER_INTRINSIC,
 227                         AESIntrinsicsBase.AES_INTRINSIC},
 228                 errorMessage, outputAnalyzer);




  31  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  32  * @run main/othervm/timeout=600 -Xbootclasspath/a:.
  33  *                   -XX:+UnlockDiagnosticVMOptions
  34  *                   -XX:+WhiteBoxAPI -Xbatch
  35  *                   compiler.cpuflags.TestAESIntrinsicsOnSupportedConfig
  36  */
  37 
  38 package compiler.cpuflags;
  39 
  40 import jdk.test.lib.process.OutputAnalyzer;
  41 import jdk.test.lib.Platform;
  42 import jdk.test.lib.process.ProcessTools;
  43 import sun.hotspot.WhiteBox;
  44 import static jdk.test.lib.cli.CommandLineOptionTest.*;
  45 
  46 public class TestAESIntrinsicsOnSupportedConfig extends AESIntrinsicsBase {
  47 
  48     protected void runTestCases() throws Throwable {
  49         testUseAES();
  50         testUseAESUseSSE2();

  51         testNoUseAES();
  52         testNoUseAESUseSSE2();

  53         testNoUseAESIntrinsic();
  54     }
  55 
  56     /**
  57      * Check if value of TieredStopAtLevel flag is greater than specified level.
  58      *
  59      * @param level tiered compilation level to compare with
  60      */
  61     private boolean isTieredLevelGreaterThan(int level) {
  62         Long val = WhiteBox.getWhiteBox().getIntxVMFlag("TieredStopAtLevel");
  63         return (val != null && val > level);
  64     }
  65 
  66     /**
  67      * Test checks following situation: <br/>
  68      * UseAES flag is set to true, TestAESMain is executed <br/>
  69      * Expected result: UseAESIntrinsics flag is set to true <br/>
  70      * If vm type is server then output should contain intrinsics usage <br/>
  71      *
  72      * @throws Throwable


 128      * Expected result: UseAESIntrinsics flag is set to false <br/>
 129      * Output shouldn't contain intrinsics usage <br/>
 130      *
 131      * @throws Throwable
 132      */
 133     private void testNoUseAESUseSSE2() throws Throwable {
 134         if (Platform.isX86() || Platform.isX64()) {
 135             OutputAnalyzer outputAnalyzer = ProcessTools.executeTestJvm(
 136                     prepareArguments(prepareBooleanFlag(AESIntrinsicsBase
 137                                     .USE_AES, false),
 138                             prepareNumericFlag(AESIntrinsicsBase.USE_SSE, 2)));
 139             final String errorMessage = "Case testNoUseAESUseSSE2 failed";
 140             verifyOutput(null, new String[]{AESIntrinsicsBase.CIPHER_INTRINSIC,
 141                             AESIntrinsicsBase.AES_INTRINSIC},
 142                     errorMessage, outputAnalyzer);
 143             verifyOptionValue(AESIntrinsicsBase.USE_AES, "false", errorMessage,
 144                     outputAnalyzer);
 145             verifyOptionValue(AESIntrinsicsBase.USE_AES_INTRINSICS, "false",
 146                     errorMessage, outputAnalyzer);
 147             verifyOptionValue(AESIntrinsicsBase.USE_SSE, "2", errorMessage,



























































 148                     outputAnalyzer);
 149         }
 150     }
 151 
 152     /**
 153      * Test checks following situation: <br/>
 154      * UseAES flag is set to false, TestAESMain is executed <br/>
 155      * Expected result: UseAESIntrinsics flag is set to false <br/>
 156      * Output shouldn't contain intrinsics usage <br/>
 157      *
 158      * @throws Throwable
 159      */
 160     private void testNoUseAES() throws Throwable {
 161         OutputAnalyzer outputAnalyzer = ProcessTools.executeTestJvm(
 162                 prepareArguments(prepareBooleanFlag(AESIntrinsicsBase
 163                         .USE_AES, false)));
 164         final String errorMessage = "Case testNoUseAES failed";
 165         verifyOutput(null, new String[]{AESIntrinsicsBase.CIPHER_INTRINSIC,
 166                         AESIntrinsicsBase.AES_INTRINSIC},
 167                 errorMessage, outputAnalyzer);


< prev index next >