1 /* |
1 /* |
2 * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 2014, 2018, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * |
4 * |
5 * This code is free software; you can redistribute it and/or modify it |
5 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as |
6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. |
7 * published by the Free Software Foundation. |
31 import jdk.test.lib.cli.predicate.AndPredicate; |
31 import jdk.test.lib.cli.predicate.AndPredicate; |
32 import jdk.test.lib.cli.predicate.NotPredicate; |
32 import jdk.test.lib.cli.predicate.NotPredicate; |
33 import jdk.test.lib.cli.predicate.OrPredicate; |
33 import jdk.test.lib.cli.predicate.OrPredicate; |
34 |
34 |
35 /** |
35 /** |
36 * Test case specific to UseSHA*Intrinsics options targeted to SPARC and AArch64 |
36 * Test case specific to UseSHA*Intrinsics options targeted to CPUs |
37 * CPUs which don't support required instruction, but support other SHA-related |
37 * which don't support required instruction, but support other SHA-related |
38 * instructions. |
38 * instructions. |
39 * |
39 * |
40 * For example, CPU support sha1 instruction, but don't support sha256 or |
40 * For example, CPU supports sha1 instruction, but doesn't support sha256 or |
41 * sha512. |
41 * sha512. |
42 */ |
42 */ |
43 public class UseSHAIntrinsicsSpecificTestCaseForUnsupportedCPU |
43 public class UseSHAIntrinsicsSpecificTestCaseForUnsupportedCPU |
44 extends SHAOptionsBase.TestCase { |
44 extends SHAOptionsBase.TestCase { |
45 public UseSHAIntrinsicsSpecificTestCaseForUnsupportedCPU( |
45 public UseSHAIntrinsicsSpecificTestCaseForUnsupportedCPU( |
46 String optionName) { |
46 String optionName) { |
47 // execute test case on SPARC CPU that support any sha* instructions, |
47 // execute test case on CPU that supports any sha* instructions, |
48 // but does not support sha* instruction required by the tested option. |
48 // but does not support sha* instruction required by the tested option. |
49 super(optionName, new AndPredicate( |
49 super(optionName, new AndPredicate( |
50 new OrPredicate(Platform::isSparc, Platform::isAArch64), |
50 IntrinsicPredicates.ANY_SHA_INSTRUCTION_AVAILABLE, |
51 new AndPredicate( |
51 new NotPredicate(SHAOptionsBase.getPredicateForOption(optionName)))); |
52 IntrinsicPredicates.ANY_SHA_INSTRUCTION_AVAILABLE, |
|
53 new NotPredicate(SHAOptionsBase.getPredicateForOption( |
|
54 optionName))))); |
|
55 } |
52 } |
56 @Override |
53 @Override |
57 protected void verifyWarnings() throws Throwable { |
54 protected void verifyWarnings() throws Throwable { |
58 String shouldPassMessage = String.format("JVM should start with " |
55 String shouldPassMessage = String.format("JVM should start with " |
59 + "'-XX:+%s' flag, but output should contain warning.", |
56 + "'-XX:+%s' flag, but output should contain warning.", |