RFR: 8372941: Rework compiler/intrinsics/sha tests to use intrinsic availability [v2]

Hao Sun haosun at openjdk.org
Mon Dec 8 11:14:58 UTC 2025


On Fri, 5 Dec 2025 17:32:23 GMT, Ramkumar Sunderbabu <rsunderbabu at openjdk.org> wrote:

>> Ramkumar Sunderbabu has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   remove requires condition
>
> With `@requires os.arch == "aarch64"`, TestUseSHA3IntrinsicsOptionOnSupportedCPU is working.
> However, I don't understand why IntrinsicPredicates.isSHA3IntrinsicAvailable() is not enough in some cases.

Hi @rsunderbabu 

I'm afraid I cannot reproduce your failure in my environment.
In my local test, I completely removed `@requires os.arch == "aarch64" & os.family == "mac"` and ran the test on Nvidia Grace machine(with sha3 support), one Neoverse-N1 machine(without sha3 support) and one x86_64 machine. I found that the test case `TestUseSHA3IntrinsicsOptionOnSupportedCPU.java` can pass.

Another thing is that, `TestUseSHA3IntrinsicsOptionOnUnsupportedCPU.java` (note that the case is **Unsupported**) failed on Nvidia Grace machine. I checked that the initial commit and the latest one both failed. Here is the snippet of the error log


java.lang.AssertionError: Option 'UseSHA3Intrinsics' is expected to have 'false' value, but is 'UseSHA3Intrinsics                        = t'.
Option 'UseSHA3Intrinsics' should be off on unsupported CPU even if set to true directly
	at jdk.test.lib.cli.CommandLineOptionTest.verifyOptionValue(CommandLineOptionTest.java:312)
	at jdk.test.lib.cli.CommandLineOptionTest.verifyOptionValue(CommandLineOptionTest.java:282)
	at jdk.test.lib.cli.CommandLineOptionTest.verifyOptionValueForSameVM(CommandLineOptionTest.java:411)
	at compiler.intrinsics.sha.cli.testcases.GenericTestCaseForUnsupportedCPU.verifyOptionValues(GenericTestCaseForUnsupportedCPU.java:96)
	at compiler.intrinsics.sha.cli.DigestOptionsBase$TestCase.test(DigestOptionsBase.java:163)
	at compiler.intrinsics.sha.cli.DigestOptionsBase.runTestCases(DigestOptionsBase.java:139)
	at jdk.test.lib.cli.CommandLineOptionTest.test(CommandLineOptionTest.java:544)
	at compiler.intrinsics.sha.cli.TestUseSHA3IntrinsicsOptionOnUnsupportedCPU.main(TestUseSHA3IntrinsicsOptionOnUnsupportedCPU.java:50)
	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
	at java.base/java.lang.reflect.Method.invoke(Method.java:565)
	at com.sun.javatest.regtest.agent.MainWrapper$MainTask.run(MainWrapper.java:138)
	at java.base/java.lang.Thread.run(Thread.java:1516)
Caused by: java.lang.RuntimeException: 'UseSHA3Intrinsics\s*:?=\s*false' missing from stdout/stderr
	at jdk.test.lib.process.OutputAnalyzer.shouldMatch(OutputAnalyzer.java:407)
	at jdk.test.lib.cli.CommandLineOptionTest.verifyOptionValue(CommandLineOptionTest.java:301)
	... 11 more

JavaTest Message: Test threw exception: java.lang.AssertionError: Option 'UseSHA3Intrinsics' is expected to have 'false' value, but is 'UseSHA3Intrinsics

-------------

PR Comment: https://git.openjdk.org/jdk/pull/28634#issuecomment-3626380963


More information about the hotspot-compiler-dev mailing list