Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8310533

[IR Framework] Add possibility to automatically verify that a test method always returns the same result

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Unresolved
    • Icon: P4 P4
    • tbd
    • 22, 23
    • hotspot

      With IR tests we ensure we get the IR nodes that we want.
      But often we combine it also with correctness tests. For that, we tend to use "gold" values that we generate in a first run where we do not yet have compilation. And later, when we have compiled we generate a new output and compare it to the "gold" value.

      As an alternative, the "runner" approach was implemented in a separate framework, in "compiler/vectorization/runner/".

      We should try to do automatic result verification to reduce boilerplate and the need for such additional frameworks.

      Details:

      Test methods can have a return value that is to be verified. We add a new annotation for such IR test methods, for example "@CheckReturnConsistency". Or one can just enable the verification at the "TestFramework" with "TestFramework.setCheckReturnConsistency(true)".

      This can only be done for methods that have no @Run method, because we need to be able to directly get the result from the method. @Run methods are responsible themselves for argument setting, and return verification, if they want to do that.

      One question is if we should always do the verification, or just on first and last run of the test method. Running it on every call could be beneficial to also catch wrong results from any previous compilation, C1 or C2, ORS or normal compilation.

        There are no Sub-Tasks for this issue.

            epeter Emanuel Peter
            epeter Emanuel Peter
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: