This commit is contained in:
Valerie Peng 2018-06-22 23:18:07 +00:00
commit b9bea93101
6 changed files with 27 additions and 36 deletions

View File

@ -74,8 +74,8 @@ public class SHAOptionsBase extends CommandLineOptionTest {
* instructions required by the option are not supported.
*/
public static String getWarningForUnsupportedCPU(String optionName) {
if (Platform.isAArch64() || Platform.isS390x() || Platform.isSparc() ||
Platform.isX64() || Platform.isX86()) {
if (Platform.isAArch64() || Platform.isS390x() || Platform.isSparc()
|| Platform.isX64() || Platform.isX86() || Platform.isPPC()) {
switch (optionName) {
case SHAOptionsBase.USE_SHA_OPTION:
return SHAOptionsBase.SHA_INSTRUCTIONS_ARE_NOT_AVAILABLE;
@ -89,8 +89,8 @@ public class SHAOptionsBase extends CommandLineOptionTest {
throw new Error("Unexpected option " + optionName);
}
} else {
throw new Error("Support for CPUs different fromn AARCH64, S390x, SPARC, and X86 "
+ "is not implemented");
throw new Error("Support for CPUs different from AARCH64, S390x,"
+ " SPARC, X86, and PPC is not implemented");
}
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2014, 2018, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -31,8 +31,8 @@ import jdk.test.lib.cli.predicate.NotPredicate;
import jdk.test.lib.cli.predicate.OrPredicate;
/**
* Generic test case for SHA-related options targeted to non-x86 and
* non-SPARC CPUs.
* Generic test case for SHA-related options targeted to any CPU except
* AArch64, S390x, SPARC and X86.
*/
public class GenericTestCaseForOtherCPU extends
SHAOptionsBase.TestCase {
@ -43,7 +43,8 @@ public class GenericTestCaseForOtherCPU extends
new OrPredicate(Platform::isS390x,
new OrPredicate(Platform::isSparc,
new OrPredicate(Platform::isPPC,
new OrPredicate(Platform::isX64, Platform::isX86)))))));
new OrPredicate(Platform::isX64,
Platform::isX86)))))));
}
@Override

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2014, 2018, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -37,10 +37,7 @@ import jdk.test.lib.cli.predicate.OrPredicate;
public class GenericTestCaseForSupportedCPU extends
SHAOptionsBase.TestCase {
public GenericTestCaseForSupportedCPU(String optionName) {
super(optionName,
new AndPredicate(
new OrPredicate(Platform::isSparc, Platform::isAArch64),
SHAOptionsBase.getPredicateForOption(optionName)));
super(optionName, SHAOptionsBase.getPredicateForOption(optionName));
}
@Override

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2014, 2018, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -33,25 +33,22 @@ import jdk.test.lib.cli.predicate.NotPredicate;
import jdk.test.lib.cli.predicate.OrPredicate;
/**
* Test case specific to UseSHA*Intrinsics options targeted to SPARC and AArch64
* CPUs which don't support required instruction, but support other SHA-related
* Test case specific to UseSHA*Intrinsics options targeted to CPUs
* which don't support required instruction, but support other SHA-related
* instructions.
*
* For example, CPU support sha1 instruction, but don't support sha256 or
* For example, CPU supports sha1 instruction, but doesn't support sha256 or
* sha512.
*/
public class UseSHAIntrinsicsSpecificTestCaseForUnsupportedCPU
extends SHAOptionsBase.TestCase {
public UseSHAIntrinsicsSpecificTestCaseForUnsupportedCPU(
String optionName) {
// execute test case on SPARC CPU that support any sha* instructions,
// execute test case on CPU that supports any sha* instructions,
// but does not support sha* instruction required by the tested option.
super(optionName, new AndPredicate(
new OrPredicate(Platform::isSparc, Platform::isAArch64),
new AndPredicate(
IntrinsicPredicates.ANY_SHA_INSTRUCTION_AVAILABLE,
new NotPredicate(SHAOptionsBase.getPredicateForOption(
optionName)))));
IntrinsicPredicates.ANY_SHA_INSTRUCTION_AVAILABLE,
new NotPredicate(SHAOptionsBase.getPredicateForOption(optionName))));
}
@Override
protected void verifyWarnings() throws Throwable {

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2014, 2018, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -33,15 +33,13 @@ import jdk.test.lib.cli.predicate.AndPredicate;
import jdk.test.lib.cli.predicate.OrPredicate;
/**
* UseSHA specific test case targeted to SPARC and AArch64 CPUs which
* support any sha* instruction.
* UseSHA specific test case targeted to CPUs which support any sha* instruction.
*/
public class UseSHASpecificTestCaseForSupportedCPU
extends SHAOptionsBase.TestCase {
public UseSHASpecificTestCaseForSupportedCPU(String optionName) {
super(SHAOptionsBase.USE_SHA_OPTION, new AndPredicate(
new OrPredicate(Platform::isSparc, Platform::isAArch64),
IntrinsicPredicates.ANY_SHA_INSTRUCTION_AVAILABLE));
super(SHAOptionsBase.USE_SHA_OPTION,
IntrinsicPredicates.ANY_SHA_INSTRUCTION_AVAILABLE);
Asserts.assertEQ(optionName, SHAOptionsBase.USE_SHA_OPTION,
String.format("Test case should be used for '%s' option only.",

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2014, 2018, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -34,16 +34,14 @@ import jdk.test.lib.cli.predicate.NotPredicate;
import jdk.test.lib.cli.predicate.OrPredicate;
/**
* UseSHA specific test case targeted to SPARC and AArch64 CPUs which don't
* support all sha* instructions./
* UseSHA specific test case targeted to CPUs which don't support all
* sha* instructions.
*/
public class UseSHASpecificTestCaseForUnsupportedCPU
extends SHAOptionsBase.TestCase {
public UseSHASpecificTestCaseForUnsupportedCPU(String optionName) {
super(SHAOptionsBase.USE_SHA_OPTION, new AndPredicate(
new OrPredicate(Platform::isSparc, Platform::isAArch64),
new NotPredicate(
IntrinsicPredicates.ANY_SHA_INSTRUCTION_AVAILABLE)));
super(SHAOptionsBase.USE_SHA_OPTION, new NotPredicate(
IntrinsicPredicates.ANY_SHA_INSTRUCTION_AVAILABLE));
Asserts.assertEQ(optionName, SHAOptionsBase.USE_SHA_OPTION,
"Test case should be used for " + SHAOptionsBase.USE_SHA_OPTION