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

Vladimir Kozlov kvn at openjdk.org
Wed Oct 15 19:33:51 UTC 2025


On Wed, 15 Oct 2025 14:34:52 GMT, Emanuel Peter <epeter at openjdk.org> wrote:

> 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`.

Good.

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

Marked as reviewed by kvn (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/27824#pullrequestreview-3341954279


More information about the hotspot-compiler-dev mailing list