Skip to content

Commit 3b9732e

Browse files
committed
8345471: Clean up compiler/intrinsics/sha/cli tests
Reviewed-by: kvn
1 parent ed0b555 commit 3b9732e

10 files changed

+26
-409
lines changed

test/hotspot/jtreg/compiler/intrinsics/sha/cli/TestUseMD5IntrinsicsOptionOnUnsupportedCPU.java

+3-13
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2020, 2022, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2020, 2024, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -37,22 +37,12 @@
3737

3838
package compiler.intrinsics.sha.cli;
3939

40-
import compiler.intrinsics.sha.cli.testcases.GenericTestCaseForOtherCPU;
41-
import compiler.intrinsics.sha.cli.testcases.GenericTestCaseForUnsupportedAArch64CPU;
42-
import compiler.intrinsics.sha.cli.testcases.GenericTestCaseForUnsupportedRISCV64CPU;
43-
import compiler.intrinsics.sha.cli.testcases.GenericTestCaseForUnsupportedX86CPU;
44-
import compiler.intrinsics.sha.cli.testcases.UseSHAIntrinsicsSpecificTestCaseForUnsupportedCPU;
40+
import compiler.intrinsics.sha.cli.testcases.GenericTestCaseForUnsupportedCPU;
4541

4642
public class TestUseMD5IntrinsicsOptionOnUnsupportedCPU {
4743
public static void main(String args[]) throws Throwable {
4844
new DigestOptionsBase(
49-
new GenericTestCaseForUnsupportedX86CPU(
50-
DigestOptionsBase.USE_MD5_INTRINSICS_OPTION, /* checkUseSHA = */ false),
51-
new GenericTestCaseForUnsupportedAArch64CPU(
52-
DigestOptionsBase.USE_MD5_INTRINSICS_OPTION, /* checkUseSHA = */ false),
53-
new GenericTestCaseForUnsupportedRISCV64CPU(
54-
DigestOptionsBase.USE_MD5_INTRINSICS_OPTION, /* checkUseSHA = */ false),
55-
new GenericTestCaseForOtherCPU(
45+
new GenericTestCaseForUnsupportedCPU(
5646
DigestOptionsBase.USE_MD5_INTRINSICS_OPTION, /* checkUseSHA = */ false)).test();
5747
}
5848
}

test/hotspot/jtreg/compiler/intrinsics/sha/cli/TestUseSHA1IntrinsicsOptionOnUnsupportedCPU.java

+3-12
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2014, 2022, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2014, 2024, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -37,24 +37,15 @@
3737

3838
package compiler.intrinsics.sha.cli;
3939

40-
import compiler.intrinsics.sha.cli.testcases.GenericTestCaseForOtherCPU;
41-
import compiler.intrinsics.sha.cli.testcases.GenericTestCaseForUnsupportedAArch64CPU;
42-
import compiler.intrinsics.sha.cli.testcases.GenericTestCaseForUnsupportedRISCV64CPU;
43-
import compiler.intrinsics.sha.cli.testcases.GenericTestCaseForUnsupportedX86CPU;
40+
import compiler.intrinsics.sha.cli.testcases.GenericTestCaseForUnsupportedCPU;
4441
import compiler.intrinsics.sha.cli.testcases.UseSHAIntrinsicsSpecificTestCaseForUnsupportedCPU;
4542

4643
public class TestUseSHA1IntrinsicsOptionOnUnsupportedCPU {
4744
public static void main(String args[]) throws Throwable {
4845
new DigestOptionsBase(
49-
new GenericTestCaseForUnsupportedX86CPU(
50-
DigestOptionsBase.USE_SHA1_INTRINSICS_OPTION),
51-
new GenericTestCaseForUnsupportedAArch64CPU(
52-
DigestOptionsBase.USE_SHA1_INTRINSICS_OPTION),
53-
new GenericTestCaseForUnsupportedRISCV64CPU(
46+
new GenericTestCaseForUnsupportedCPU(
5447
DigestOptionsBase.USE_SHA1_INTRINSICS_OPTION),
5548
new UseSHAIntrinsicsSpecificTestCaseForUnsupportedCPU(
56-
DigestOptionsBase.USE_SHA1_INTRINSICS_OPTION),
57-
new GenericTestCaseForOtherCPU(
5849
DigestOptionsBase.USE_SHA1_INTRINSICS_OPTION)).test();
5950
}
6051
}

test/hotspot/jtreg/compiler/intrinsics/sha/cli/TestUseSHA256IntrinsicsOptionOnUnsupportedCPU.java

+3-12
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2014, 2022, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2014, 2024, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -37,24 +37,15 @@
3737

3838
package compiler.intrinsics.sha.cli;
3939

40-
import compiler.intrinsics.sha.cli.testcases.GenericTestCaseForOtherCPU;
41-
import compiler.intrinsics.sha.cli.testcases.GenericTestCaseForUnsupportedAArch64CPU;
42-
import compiler.intrinsics.sha.cli.testcases.GenericTestCaseForUnsupportedRISCV64CPU;
43-
import compiler.intrinsics.sha.cli.testcases.GenericTestCaseForUnsupportedX86CPU;
40+
import compiler.intrinsics.sha.cli.testcases.GenericTestCaseForUnsupportedCPU;
4441
import compiler.intrinsics.sha.cli.testcases.UseSHAIntrinsicsSpecificTestCaseForUnsupportedCPU;
4542

4643
public class TestUseSHA256IntrinsicsOptionOnUnsupportedCPU {
4744
public static void main(String args[]) throws Throwable {
4845
new DigestOptionsBase(
49-
new GenericTestCaseForUnsupportedX86CPU(
50-
DigestOptionsBase.USE_SHA256_INTRINSICS_OPTION),
51-
new GenericTestCaseForUnsupportedAArch64CPU(
52-
DigestOptionsBase.USE_SHA256_INTRINSICS_OPTION),
53-
new GenericTestCaseForUnsupportedRISCV64CPU(
46+
new GenericTestCaseForUnsupportedCPU(
5447
DigestOptionsBase.USE_SHA256_INTRINSICS_OPTION),
5548
new UseSHAIntrinsicsSpecificTestCaseForUnsupportedCPU(
56-
DigestOptionsBase.USE_SHA256_INTRINSICS_OPTION),
57-
new GenericTestCaseForOtherCPU(
5849
DigestOptionsBase.USE_SHA256_INTRINSICS_OPTION)).test();
5950
}
6051
}

test/hotspot/jtreg/compiler/intrinsics/sha/cli/TestUseSHA3IntrinsicsOptionOnUnsupportedCPU.java

+2-8
Original file line numberDiff line numberDiff line change
@@ -38,21 +38,15 @@
3838

3939
package compiler.intrinsics.sha.cli;
4040

41-
import compiler.intrinsics.sha.cli.testcases.GenericTestCaseForOtherCPU;
42-
import compiler.intrinsics.sha.cli.testcases.GenericTestCaseForUnsupportedAArch64CPU;
43-
import compiler.intrinsics.sha.cli.testcases.GenericTestCaseForUnsupportedX86CPU;
41+
import compiler.intrinsics.sha.cli.testcases.GenericTestCaseForUnsupportedCPU;
4442
import compiler.intrinsics.sha.cli.testcases.UseSHAIntrinsicsSpecificTestCaseForUnsupportedCPU;
4543

4644
public class TestUseSHA3IntrinsicsOptionOnUnsupportedCPU {
4745
public static void main(String args[]) throws Throwable {
4846
new DigestOptionsBase(
49-
new GenericTestCaseForUnsupportedX86CPU(
50-
DigestOptionsBase.USE_SHA3_INTRINSICS_OPTION),
51-
new GenericTestCaseForUnsupportedAArch64CPU(
47+
new GenericTestCaseForUnsupportedCPU(
5248
DigestOptionsBase.USE_SHA3_INTRINSICS_OPTION),
5349
new UseSHAIntrinsicsSpecificTestCaseForUnsupportedCPU(
54-
DigestOptionsBase.USE_SHA3_INTRINSICS_OPTION),
55-
new GenericTestCaseForOtherCPU(
5650
DigestOptionsBase.USE_SHA3_INTRINSICS_OPTION)).test();
5751
}
5852
}

test/hotspot/jtreg/compiler/intrinsics/sha/cli/TestUseSHA512IntrinsicsOptionOnUnsupportedCPU.java

+3-12
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2014, 2022, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2014, 2024, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -37,24 +37,15 @@
3737

3838
package compiler.intrinsics.sha.cli;
3939

40-
import compiler.intrinsics.sha.cli.testcases.GenericTestCaseForOtherCPU;
41-
import compiler.intrinsics.sha.cli.testcases.GenericTestCaseForUnsupportedAArch64CPU;
42-
import compiler.intrinsics.sha.cli.testcases.GenericTestCaseForUnsupportedRISCV64CPU;
43-
import compiler.intrinsics.sha.cli.testcases.GenericTestCaseForUnsupportedX86CPU;
40+
import compiler.intrinsics.sha.cli.testcases.GenericTestCaseForUnsupportedCPU;
4441
import compiler.intrinsics.sha.cli.testcases.UseSHAIntrinsicsSpecificTestCaseForUnsupportedCPU;
4542

4643
public class TestUseSHA512IntrinsicsOptionOnUnsupportedCPU {
4744
public static void main(String args[]) throws Throwable {
4845
new DigestOptionsBase(
49-
new GenericTestCaseForUnsupportedX86CPU(
50-
DigestOptionsBase.USE_SHA512_INTRINSICS_OPTION),
51-
new GenericTestCaseForUnsupportedAArch64CPU(
52-
DigestOptionsBase.USE_SHA512_INTRINSICS_OPTION),
53-
new GenericTestCaseForUnsupportedRISCV64CPU(
46+
new GenericTestCaseForUnsupportedCPU(
5447
DigestOptionsBase.USE_SHA512_INTRINSICS_OPTION),
5548
new UseSHAIntrinsicsSpecificTestCaseForUnsupportedCPU(
56-
DigestOptionsBase.USE_SHA512_INTRINSICS_OPTION),
57-
new GenericTestCaseForOtherCPU(
5849
DigestOptionsBase.USE_SHA512_INTRINSICS_OPTION)).test();
5950
}
6051
}

test/hotspot/jtreg/compiler/intrinsics/sha/cli/TestUseSHAOptionOnUnsupportedCPU.java

+3-12
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2014, 2022, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2014, 2024, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -37,24 +37,15 @@
3737

3838
package compiler.intrinsics.sha.cli;
3939

40-
import compiler.intrinsics.sha.cli.testcases.GenericTestCaseForOtherCPU;
41-
import compiler.intrinsics.sha.cli.testcases.GenericTestCaseForUnsupportedAArch64CPU;
42-
import compiler.intrinsics.sha.cli.testcases.GenericTestCaseForUnsupportedRISCV64CPU;
43-
import compiler.intrinsics.sha.cli.testcases.GenericTestCaseForUnsupportedX86CPU;
40+
import compiler.intrinsics.sha.cli.testcases.GenericTestCaseForUnsupportedCPU;
4441
import compiler.intrinsics.sha.cli.testcases.UseSHASpecificTestCaseForUnsupportedCPU;
4542

4643
public class TestUseSHAOptionOnUnsupportedCPU {
4744
public static void main(String args[]) throws Throwable {
4845
new DigestOptionsBase(
49-
new GenericTestCaseForUnsupportedX86CPU(
50-
DigestOptionsBase.USE_SHA_OPTION),
51-
new GenericTestCaseForUnsupportedAArch64CPU(
52-
DigestOptionsBase.USE_SHA_OPTION),
53-
new GenericTestCaseForUnsupportedRISCV64CPU(
46+
new GenericTestCaseForUnsupportedCPU(
5447
DigestOptionsBase.USE_SHA_OPTION),
5548
new UseSHASpecificTestCaseForUnsupportedCPU(
56-
DigestOptionsBase.USE_SHA_OPTION),
57-
new GenericTestCaseForOtherCPU(
5849
DigestOptionsBase.USE_SHA_OPTION)).test();
5950
}
6051
}

test/hotspot/jtreg/compiler/intrinsics/sha/cli/testcases/GenericTestCaseForOtherCPU.java

-106
This file was deleted.

test/hotspot/jtreg/compiler/intrinsics/sha/cli/testcases/GenericTestCaseForUnsupportedAArch64CPU.java test/hotspot/jtreg/compiler/intrinsics/sha/cli/testcases/GenericTestCaseForUnsupportedCPU.java

+9-9
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2014, 2020, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2014, 2024, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -31,22 +31,22 @@
3131
import jdk.test.lib.cli.predicate.NotPredicate;
3232

3333
/**
34-
* Generic test case for SHA-related options targeted to AArch64 CPUs
34+
* Generic test case for SHA-related options targeted to CPUs
3535
* which don't support instruction required by the tested option.
3636
*/
37-
public class GenericTestCaseForUnsupportedAArch64CPU extends
37+
public class GenericTestCaseForUnsupportedCPU extends
3838
DigestOptionsBase.TestCase {
3939

4040
final private boolean checkUseSHA;
4141

42-
public GenericTestCaseForUnsupportedAArch64CPU(String optionName) {
42+
public GenericTestCaseForUnsupportedCPU(String optionName) {
4343
this(optionName, true);
4444
}
4545

46-
public GenericTestCaseForUnsupportedAArch64CPU(String optionName, boolean checkUseSHA) {
47-
super(optionName, new AndPredicate(Platform::isAArch64,
46+
public GenericTestCaseForUnsupportedCPU(String optionName, boolean checkUseSHA) {
47+
super(optionName,
4848
new NotPredicate(DigestOptionsBase.getPredicateForOption(
49-
optionName))));
49+
optionName)));
5050

5151
this.checkUseSHA = checkUseSHA;
5252
}
@@ -95,15 +95,15 @@ protected void verifyOptionValues() throws Throwable {
9595
// using CLI options.
9696
CommandLineOptionTest.verifyOptionValueForSameVM(optionName, "false",
9797
String.format("Option '%s' should be off on unsupported "
98-
+ "AArch64CPU even if set to true directly", optionName),
98+
+ "CPU even if set to true directly", optionName),
9999
DigestOptionsBase.UNLOCK_DIAGNOSTIC_VM_OPTIONS,
100100
CommandLineOptionTest.prepareBooleanFlag(optionName, true));
101101

102102
if (checkUseSHA) {
103103
// Verify that option is disabled when +UseSHA was passed to JVM.
104104
CommandLineOptionTest.verifyOptionValueForSameVM(optionName, "false",
105105
String.format("Option '%s' should be off on unsupported "
106-
+ "AArch64CPU even if %s flag set to JVM",
106+
+ "CPU even if %s flag set to JVM",
107107
optionName, CommandLineOptionTest.prepareBooleanFlag(
108108
DigestOptionsBase.USE_SHA_OPTION, true)),
109109
DigestOptionsBase.UNLOCK_DIAGNOSTIC_VM_OPTIONS,

0 commit comments

Comments
 (0)