提交 cab72098 编写于 作者: J jjg

6843648: tools/javac/versions/check.sh is broken

Reviewed-by: darcy
上级 1d24e071
...@@ -27,7 +27,7 @@ import javax.lang.model.*; ...@@ -27,7 +27,7 @@ import javax.lang.model.*;
import javax.lang.model.element.*; import javax.lang.model.element.*;
@SupportedAnnotationTypes("*") @SupportedAnnotationTypes("*")
@SupportedSourceVersion(SourceVersion.RELEASE_6) @SupportedSourceVersion(SourceVersion.RELEASE_7)
public class Anno extends AbstractProcessor { public class Anno extends AbstractProcessor {
public boolean process(Set<? extends TypeElement> annotations, public boolean process(Set<? extends TypeElement> annotations,
RoundEnvironment roundEnv) { RoundEnvironment roundEnv) {
......
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
* @bug 6464451 * @bug 6464451
* @summary javac in 5.0ux can not compile try-finally block which has a lot of "return" * @summary javac in 5.0ux can not compile try-finally block which has a lot of "return"
* @author Wei Tao * @author Wei Tao
* @compile -target 5 BigFinally.java * @compile -source 5 -target 5 BigFinally.java
* @clean BigFinally * @clean BigFinally
* @compile/fail BigFinally.java * @compile/fail BigFinally.java
*/ */
......
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
* @bug 6464451 * @bug 6464451
* @summary javac in 5.0ux can not compile try-finally block which has a lot of "return" * @summary javac in 5.0ux can not compile try-finally block which has a lot of "return"
* @author Wei Tao * @author Wei Tao
* @compile -target 5 DeepNestedFinally.java * @compile -source 5 -target 5 DeepNestedFinally.java
* @clean DeepNestedFinally * @clean DeepNestedFinally
* @compile/fail DeepNestedFinally.java * @compile/fail DeepNestedFinally.java
*/ */
......
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
* @bug 6464451 * @bug 6464451
* @summary javac in 5.0ux can not compile try-finally block which has a lot of "return" * @summary javac in 5.0ux can not compile try-finally block which has a lot of "return"
* @author Wei Tao * @author Wei Tao
* @compile -target 5 ManyExitsInTry.java * @compile -source 5 -target 5 ManyExitsInTry.java
* @clean ManyExitsInTry * @clean ManyExitsInTry
* @compile/fail ManyExitsInTry.java * @compile/fail ManyExitsInTry.java
*/ */
......
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
* @summary Use ldc instruction for class literals * @summary Use ldc instruction for class literals
* @author gafter * @author gafter
* *
* @compile -target 1.5 ClassLit.java * @compile -source 1.5 -target 1.5 ClassLit.java
* @run main ClassLit * @run main ClassLit
*/ */
......
...@@ -24,10 +24,10 @@ ...@@ -24,10 +24,10 @@
/* /*
* @test * @test
* @bug 6557865 * @bug 6557865
* @summary -target 5 should not put ACC_SYNTHETIC on package-info * @summary -source 5 -target 5 should not put ACC_SYNTHETIC on package-info
* @author Wei Tao * @author Wei Tao
* @compile T6557865.java * @compile T6557865.java
* @compile -target 5 T6232928/package-info.java * @compile -source 5 -target 5 T6232928/package-info.java
* @run main T6557865 * @run main T6557865
*/ */
......
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
* @bug 6682380 6679509 * @bug 6682380 6679509
* @summary Foreach loop with generics inside finally block crashes javac with -target 1.5 * @summary Foreach loop with generics inside finally block crashes javac with -target 1.5
* @author Jan Lahoda, Maurizio Cimadamore * @author Jan Lahoda, Maurizio Cimadamore
* @compile -target 1.5 T6682380.java * @compile -source 1.5 -target 1.5 T6682380.java
*/ */
import java.util.List; import java.util.List;
......
...@@ -28,7 +28,7 @@ import javax.lang.model.*; ...@@ -28,7 +28,7 @@ import javax.lang.model.*;
import javax.lang.model.element.*; import javax.lang.model.element.*;
@SupportedAnnotationTypes("*") @SupportedAnnotationTypes("*")
@SupportedSourceVersion(SourceVersion.RELEASE_6) @SupportedSourceVersion(SourceVersion.RELEASE_7)
public class A extends AbstractProcessor { public class A extends AbstractProcessor {
public boolean process(Set<? extends TypeElement> tes, RoundEnvironment renv) { public boolean process(Set<? extends TypeElement> tes, RoundEnvironment renv) {
Filer filer = processingEnv.getFiler(); Filer filer = processingEnv.getFiler();
......
...@@ -30,7 +30,7 @@ import javax.lang.model.element.*; ...@@ -30,7 +30,7 @@ import javax.lang.model.element.*;
import javax.tools.*; import javax.tools.*;
@SupportedAnnotationTypes("*") @SupportedAnnotationTypes("*")
@SupportedSourceVersion(SourceVersion.RELEASE_6) @SupportedSourceVersion(SourceVersion.RELEASE_7)
public class A extends AbstractProcessor { public class A extends AbstractProcessor {
public boolean process(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv) { public boolean process(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv) {
......
...@@ -30,7 +30,7 @@ import java.util.*; ...@@ -30,7 +30,7 @@ import java.util.*;
import java.util.Set; import java.util.Set;
@SupportedAnnotationTypes({"*"}) @SupportedAnnotationTypes({"*"})
@SupportedSourceVersion(javax.lang.model.SourceVersion.RELEASE_6) @SupportedSourceVersion(javax.lang.model.SourceVersion.RELEASE_7)
public class b6341534 extends AbstractProcessor { public class b6341534 extends AbstractProcessor {
static int r = 0; static int r = 0;
static Elements E = null; static Elements E = null;
......
...@@ -39,7 +39,7 @@ import static javax.lang.model.util.ElementFilter.*; ...@@ -39,7 +39,7 @@ import static javax.lang.model.util.ElementFilter.*;
@SupportedAnnotationTypes("*") @SupportedAnnotationTypes("*")
@SupportedSourceVersion(SourceVersion.RELEASE_6 ) @SupportedSourceVersion(SourceVersion.RELEASE_7 )
public class T6439826 extends AbstractProcessor { public class T6439826 extends AbstractProcessor {
public static void main(String... args) { public static void main(String... args) {
String testSrc = System.getProperty("test.src", "."); String testSrc = System.getProperty("test.src", ".");
......
...@@ -56,7 +56,7 @@ esac ...@@ -56,7 +56,7 @@ esac
TMP1=T4955930.javap TMP1=T4955930.javap
cp "${TESTSRC}${FS}T4955930.java" . cp "${TESTSRC}${FS}T4955930.java" .
"${TESTJAVA}${FS}bin${FS}javac" ${TESTTOOLVMOPTS} -target 6 T4955930.java "${TESTJAVA}${FS}bin${FS}javac" ${TESTTOOLVMOPTS} -source 6 -target 6 T4955930.java
result=$? result=$?
if [ $result -ne 0 ] if [ $result -ne 0 ]
then then
......
...@@ -24,9 +24,8 @@ ...@@ -24,9 +24,8 @@
# @test # @test
# @bug 4981566 5028634 5094412 6304984 # @bug 4981566 5028634 5094412 6304984
# @summary Check interpretation of -target and -source options # @summary Check interpretation of -target and -source options
#
# @build CheckClassFileVersion # @build CheckClassFileVersion
# @run shell check.sh # @run shell check.sh
TESTJAVA=${TESTJAVA:?} TESTJAVA=${TESTJAVA:?}
TC=${TESTCLASSES-.} TC=${TESTCLASSES-.}
...@@ -48,19 +47,26 @@ check() { ...@@ -48,19 +47,26 @@ check() {
$JC ${TESTTOOLVMOPTS} -d $TC $* $TC/X.java && $CFV $TC/X.class $V || exit 2 $JC ${TESTTOOLVMOPTS} -d $TC $* $TC/X.java && $CFV $TC/X.class $V || exit 2
} }
check 50.0
check 48.0 -source 1.4 check 48.0 -source 1.4
check 49.0 -source 1.4 -target 1.5 check 49.0 -source 1.4 -target 1.5
check 49.0 -target 1.5 check 49.0 -source 1.5 -target 1.5
check 50.0 -source 1.5
check 50.0 -target 1.6 check 50.0 -source 1.4 -target 1.6
check 50.0 -target 6 check 50.0 -source 1.5 -target 1.6
check 50.0 -source 1.6 check 50.0 -source 1.6 -target 1.6
check 50.0 -source 6 check 50.0 -source 1.6 -target 6
check 51.0 -target 1.7 check 50.0 -source 6 -target 1.6
check 51.0 -target 7 check 50.0 -source 6 -target 6
check 51.0
check 51.0 -source 1.5
check 51.0 -source 1.6
check 51.0 -source 6
check 51.0 -source 1.7 check 51.0 -source 1.7
check 51.0 -source 7 check 51.0 -source 7
check 51.0 -target 1.7
check 51.0 -target 7
# Check source versions # Check source versions
...@@ -85,21 +91,30 @@ pass() { ...@@ -85,21 +91,30 @@ pass() {
fi fi
} }
# the following need to be updated when -source 7 features are available
checksrc14() { pass $* $TC/X.java; fail $* $TC/Y.java; } checksrc14() { pass $* $TC/X.java; fail $* $TC/Y.java; }
checksrc15() { pass $* $TC/X.java; pass $* $TC/Y.java; } checksrc15() { pass $* $TC/X.java; pass $* $TC/Y.java; }
checksrc16() { checksrc15 $* ; } checksrc16() { checksrc15 $* ; }
checksrc17() { checksrc15 $* ; }
checksrc14 -source 1.4 checksrc14 -source 1.4
checksrc14 -source 1.4 -target 1.5 checksrc14 -source 1.4 -target 1.5
checksrc15
checksrc15 -target 1.5
checksrc15 -source 1.5 checksrc15 -source 1.5
checksrc15 -source 1.5 -target 1.5
checksrc16 -target 1.6
checksrc16 -target 6
checksrc16 -source 1.6 checksrc16 -source 1.6
checksrc16 -source 6 checksrc16 -source 6
checksrc16 -source 1.6 -target 1.6
checksrc16 -source 6 -target 6
checksrc17
checksrc17 -target 1.7
checksrc17 -target 7
checksrc17 -source 1.7
checksrc17 -source 7
checksrc17 -source 1.7 -target 1.7
checksrc17 -source 7 -target 7
fail -source 1.5 -target 1.4 $TC/X.java fail -source 1.5 -target 1.4 $TC/X.java
fail -source 1.6 -target 1.4 $TC/X.java fail -source 1.6 -target 1.4 $TC/X.java
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册