RFR: 8369912: [TESTBUG] testlibrary_tests/template_framework/examples/TestExpressions.java fails with ArithmeticException: / by zero - forgot to respect Expression.info

Emanuel Peter epeter at openjdk.org
Wed Oct 15 14:44:29 UTC 2025


The test generates a test for each operator, like this:

public static int primitiveConTest_185_compiled() {
    return (989451435 % 0);
}

However, some operators throw exceptions, just like here the `%`, when given a zero rhs argument. The expression already knows about that, we just need to generate try-catch statements in the code.

Similarly, some operators do not always return deterministic results (different Nan, or precision). So we need to handle that too.

Note: we already do all of that in the `test/hotspot/jtreg/compiler/igvn/ExpressionFuzzer.java`.

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

Commit messages:
 - JDK-8369912

Changes: https://git.openjdk.org/jdk/pull/27824/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=27824&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8369912
  Stats: 30 lines in 1 file changed: 23 ins; 0 del; 7 mod
  Patch: https://git.openjdk.org/jdk/pull/27824.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/27824/head:pull/27824

PR: https://git.openjdk.org/jdk/pull/27824


More information about the hotspot-compiler-dev mailing list