<html><head><meta http-equiv="content-type" content="text/html; charset=us-ascii"></head><body style="overflow-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;"><div><blockquote type="cite"><div><div><p>You can satisfy your curiosity by looking the the javac
regressions tests in the OpenJDK repo. Under<br>
<br>
<a class="moz-txt-link-freetext" href="https://github.com/openjdk/jdk">https://github.com/openjdk/jdk</a><br>
<br>
see the test/langtools/tools/javac directory hierarchy.</p>
</div></div></blockquote></div><div>Thank you.</div><div><br></div><div>I took a quick look at the files in that directory. I found many examples of using -target (or --release). The negative tests are easy to understand. The feature tests less so, as apparently each individual test developer decides what releases to test.</div><div><br></div><div>The thoroughness of the tests varies considerably. A few tests use all of the supported releases (from 8 onward), but many just test one or two releases and the current release. I don't see any way to estimate the coverage of these tests.</div><div><br></div><div>Given that the byte code produced by javac is not examined, the best way to positively test the -target feature for a given target is to run tests that are compatible with that target, and I would think that the best source of such tests is the actual target release. It looks like jtreg could do this, using the -compilejdk and -javacoption options. Has anyone tried this?</div><div><br></div><div>The most comprehensive test would be to use the latest javac to build the target release and then run all of the normal pre-release tests. I'm guessing that could be done by making the latest JDK the boot JDK (although the documentation only mentions using older JDKs), setting COMPILER=bootjdk and JDK_SOURCE_TARGET_VERSION to the target release (if necessary). Not something to be done nightly, but perhaps a good idea shortly before blessing a new release.</div><div><br></div><div> Alan</div><div><br></div></body></html>