[jdk11u-dev] RFR: 8337102: JITTester: Fix breaks in static initialization blocks
Kirill Shirokov
duke at openjdk.org
Wed Oct 29 17:52:14 UTC 2025
On Sat, 13 Sep 2025 00:57:13 GMT, Kirill Shirokov <duke at openjdk.org> wrote:
> 8337102: JITTester: Fix breaks in static initialization blocks
Verified on Mac + Linux + Windows:
# Unfixed version:
% cd test/hotspot/jtreg/testlibrary/jittester
% sed -i '' '/disable-static/{s!true!false!;}' conf/default.properties
% make install JDK_HOME=$JAVA_HOME TESTS_NUMBER=1
Produces frequent failures in javac output files, like:
% grep -r break ws/hotspot/test/
...
ws/hotspot/test/aot_java_tests/Test_0.err:ws/hotspot/test/aot_java_tests/Test_0.java:61: error: break outside switch or loop
ws/hotspot/test/aot_java_tests/Test_0.err: break; /* 0 */
ws/hotspot/test/aot_java_tests/Test_0.err:ws/hotspot/test/aot_java_tests/Test_0.java:297: error: break outside switch or loop
ws/hotspot/test/aot_java_tests/Test_0.err: break; /* 0 */
...
```
...with generated .java files having 'break;' statements in static {...}
# Fixed version:
(no default.properties modification is needed, there is already disable-static=false)
% cd test/hotspot/jtreg/testlibrary/jittester
% make install JDK_HOME=$JAVA_HOME TESTS_NUMBER=500
Not getting any failures in general case:
Generating 500 tests...
start time | count | generat | running |
--- | --- | --- | --- |
[15:15:53.559049] | 0 | 3945 | 121109 |
[15:17:58.608076] | 1 | 1789 | 1076 |
[15:18:01.474781] | 2 | 1735 | 1058 |
[15:18:04.268104] | 3 | 1805 | 1021 |
[15:18:07.094167] | 4 | 1728 | 1074 |
[15:18:09.896595] | 5 | 1908 | 1030 |
[15:18:12.834347] | 6 | 495 | 984 |
...
% grep -r "error: break outside switch or loop" ws/hotspot/test/
%
-------------
PR Comment: https://git.openjdk.org/jdk11u-dev/pull/3094#issuecomment-3287309226
More information about the jdk-updates-dev
mailing list