8155192: [TESTBUG] SHA tests assumes that x86 does not have SHA intrinsics
Reviewed-by: kvn, gromero
This commit is contained in:
parent
90c4e07b60
commit
6eeaab54a4
@ -74,8 +74,8 @@ public class SHAOptionsBase extends CommandLineOptionTest {
|
|||||||
* instructions required by the option are not supported.
|
* instructions required by the option are not supported.
|
||||||
*/
|
*/
|
||||||
public static String getWarningForUnsupportedCPU(String optionName) {
|
public static String getWarningForUnsupportedCPU(String optionName) {
|
||||||
if (Platform.isAArch64() || Platform.isS390x() || Platform.isSparc() ||
|
if (Platform.isAArch64() || Platform.isS390x() || Platform.isSparc()
|
||||||
Platform.isX64() || Platform.isX86()) {
|
|| Platform.isX64() || Platform.isX86() || Platform.isPPC()) {
|
||||||
switch (optionName) {
|
switch (optionName) {
|
||||||
case SHAOptionsBase.USE_SHA_OPTION:
|
case SHAOptionsBase.USE_SHA_OPTION:
|
||||||
return SHAOptionsBase.SHA_INSTRUCTIONS_ARE_NOT_AVAILABLE;
|
return SHAOptionsBase.SHA_INSTRUCTIONS_ARE_NOT_AVAILABLE;
|
||||||
@ -89,8 +89,8 @@ public class SHAOptionsBase extends CommandLineOptionTest {
|
|||||||
throw new Error("Unexpected option " + optionName);
|
throw new Error("Unexpected option " + optionName);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
throw new Error("Support for CPUs different fromn AARCH64, S390x, SPARC, and X86 "
|
throw new Error("Support for CPUs different from AARCH64, S390x,"
|
||||||
+ "is not implemented");
|
+ " SPARC, X86, and PPC is not implemented");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -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.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* 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;
|
import jdk.test.lib.cli.predicate.OrPredicate;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Generic test case for SHA-related options targeted to non-x86 and
|
* Generic test case for SHA-related options targeted to any CPU except
|
||||||
* non-SPARC CPUs.
|
* AArch64, S390x, SPARC and X86.
|
||||||
*/
|
*/
|
||||||
public class GenericTestCaseForOtherCPU extends
|
public class GenericTestCaseForOtherCPU extends
|
||||||
SHAOptionsBase.TestCase {
|
SHAOptionsBase.TestCase {
|
||||||
@ -43,7 +43,8 @@ public class GenericTestCaseForOtherCPU extends
|
|||||||
new OrPredicate(Platform::isS390x,
|
new OrPredicate(Platform::isS390x,
|
||||||
new OrPredicate(Platform::isSparc,
|
new OrPredicate(Platform::isSparc,
|
||||||
new OrPredicate(Platform::isPPC,
|
new OrPredicate(Platform::isPPC,
|
||||||
new OrPredicate(Platform::isX64, Platform::isX86)))))));
|
new OrPredicate(Platform::isX64,
|
||||||
|
Platform::isX86)))))));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -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.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* 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
|
public class GenericTestCaseForSupportedCPU extends
|
||||||
SHAOptionsBase.TestCase {
|
SHAOptionsBase.TestCase {
|
||||||
public GenericTestCaseForSupportedCPU(String optionName) {
|
public GenericTestCaseForSupportedCPU(String optionName) {
|
||||||
super(optionName,
|
super(optionName, SHAOptionsBase.getPredicateForOption(optionName));
|
||||||
new AndPredicate(
|
|
||||||
new OrPredicate(Platform::isSparc, Platform::isAArch64),
|
|
||||||
SHAOptionsBase.getPredicateForOption(optionName)));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -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.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* 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;
|
import jdk.test.lib.cli.predicate.OrPredicate;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Test case specific to UseSHA*Intrinsics options targeted to SPARC and AArch64
|
* Test case specific to UseSHA*Intrinsics options targeted to CPUs
|
||||||
* CPUs which don't support required instruction, but support other SHA-related
|
* which don't support required instruction, but support other SHA-related
|
||||||
* instructions.
|
* 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.
|
* sha512.
|
||||||
*/
|
*/
|
||||||
public class UseSHAIntrinsicsSpecificTestCaseForUnsupportedCPU
|
public class UseSHAIntrinsicsSpecificTestCaseForUnsupportedCPU
|
||||||
extends SHAOptionsBase.TestCase {
|
extends SHAOptionsBase.TestCase {
|
||||||
public UseSHAIntrinsicsSpecificTestCaseForUnsupportedCPU(
|
public UseSHAIntrinsicsSpecificTestCaseForUnsupportedCPU(
|
||||||
String optionName) {
|
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.
|
// but does not support sha* instruction required by the tested option.
|
||||||
super(optionName, new AndPredicate(
|
super(optionName, new AndPredicate(
|
||||||
new OrPredicate(Platform::isSparc, Platform::isAArch64),
|
IntrinsicPredicates.ANY_SHA_INSTRUCTION_AVAILABLE,
|
||||||
new AndPredicate(
|
new NotPredicate(SHAOptionsBase.getPredicateForOption(optionName))));
|
||||||
IntrinsicPredicates.ANY_SHA_INSTRUCTION_AVAILABLE,
|
|
||||||
new NotPredicate(SHAOptionsBase.getPredicateForOption(
|
|
||||||
optionName)))));
|
|
||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
protected void verifyWarnings() throws Throwable {
|
protected void verifyWarnings() throws Throwable {
|
||||||
|
@ -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.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* 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;
|
import jdk.test.lib.cli.predicate.OrPredicate;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* UseSHA specific test case targeted to SPARC and AArch64 CPUs which
|
* UseSHA specific test case targeted to CPUs which support any sha* instruction.
|
||||||
* support any sha* instruction.
|
|
||||||
*/
|
*/
|
||||||
public class UseSHASpecificTestCaseForSupportedCPU
|
public class UseSHASpecificTestCaseForSupportedCPU
|
||||||
extends SHAOptionsBase.TestCase {
|
extends SHAOptionsBase.TestCase {
|
||||||
public UseSHASpecificTestCaseForSupportedCPU(String optionName) {
|
public UseSHASpecificTestCaseForSupportedCPU(String optionName) {
|
||||||
super(SHAOptionsBase.USE_SHA_OPTION, new AndPredicate(
|
super(SHAOptionsBase.USE_SHA_OPTION,
|
||||||
new OrPredicate(Platform::isSparc, Platform::isAArch64),
|
IntrinsicPredicates.ANY_SHA_INSTRUCTION_AVAILABLE);
|
||||||
IntrinsicPredicates.ANY_SHA_INSTRUCTION_AVAILABLE));
|
|
||||||
|
|
||||||
Asserts.assertEQ(optionName, SHAOptionsBase.USE_SHA_OPTION,
|
Asserts.assertEQ(optionName, SHAOptionsBase.USE_SHA_OPTION,
|
||||||
String.format("Test case should be used for '%s' option only.",
|
String.format("Test case should be used for '%s' option only.",
|
||||||
|
@ -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.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* 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;
|
import jdk.test.lib.cli.predicate.OrPredicate;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* UseSHA specific test case targeted to SPARC and AArch64 CPUs which don't
|
* UseSHA specific test case targeted to CPUs which don't support all
|
||||||
* support all sha* instructions./
|
* sha* instructions.
|
||||||
*/
|
*/
|
||||||
public class UseSHASpecificTestCaseForUnsupportedCPU
|
public class UseSHASpecificTestCaseForUnsupportedCPU
|
||||||
extends SHAOptionsBase.TestCase {
|
extends SHAOptionsBase.TestCase {
|
||||||
public UseSHASpecificTestCaseForUnsupportedCPU(String optionName) {
|
public UseSHASpecificTestCaseForUnsupportedCPU(String optionName) {
|
||||||
super(SHAOptionsBase.USE_SHA_OPTION, new AndPredicate(
|
super(SHAOptionsBase.USE_SHA_OPTION, new NotPredicate(
|
||||||
new OrPredicate(Platform::isSparc, Platform::isAArch64),
|
IntrinsicPredicates.ANY_SHA_INSTRUCTION_AVAILABLE));
|
||||||
new NotPredicate(
|
|
||||||
IntrinsicPredicates.ANY_SHA_INSTRUCTION_AVAILABLE)));
|
|
||||||
|
|
||||||
Asserts.assertEQ(optionName, SHAOptionsBase.USE_SHA_OPTION,
|
Asserts.assertEQ(optionName, SHAOptionsBase.USE_SHA_OPTION,
|
||||||
"Test case should be used for " + SHAOptionsBase.USE_SHA_OPTION
|
"Test case should be used for " + SHAOptionsBase.USE_SHA_OPTION
|
||||||
|
Loading…
x
Reference in New Issue
Block a user