summaryrefslogtreecommitdiff
path: root/test/files
diff options
context:
space:
mode:
authorJason Zaugg <jzaugg@gmail.com>2015-01-29 14:40:45 +1000
committerAdriaan Moors <adriaan.moors@typesafe.com>2015-05-26 18:04:55 -0700
commit8d2d3c702d2010d40ed6facb771add48999216c1 (patch)
tree7eb0868cbdde147d6ad0df41ab8a3666ab11819a /test/files
parent7b224c57c2712994c043c749028cb2589155358f (diff)
downloadscala-8d2d3c702d2010d40ed6facb771add48999216c1.tar.gz
scala-8d2d3c702d2010d40ed6facb771add48999216c1.tar.bz2
scala-8d2d3c702d2010d40ed6facb771add48999216c1.zip
Require and target Java 8
- Require Java 8 in ant build - use -source 1.8 and -target 1.8 for javac - Default scalac's -target to `jvm-1.8`, ignore and deprecate attempts to use `jvm-1.{6.7}` - Remove fragile javap-app test. The feature itself is slated for removal. - Remove obsolete Java6 checkfile - Adapt DCE tests - Remove deprecated/redundant -target:jvm-1.6 from flags where the intent was to trigger generation of stack map frames. - Remove tests with -target:jvm-1.5 that tested without stack map frames - Ignore OpenJDK JVM warnings (via test/[files|scaladoc]/filters).
Diffstat (limited to 'test/files')
-rw-r--r--test/files/filters1
-rw-r--r--test/files/neg/deprecated-target.check4
-rw-r--r--test/files/neg/deprecated-target.flags1
-rw-r--r--test/files/neg/deprecated-target.scala1
-rw-r--r--test/files/neg/t6289.check6
-rw-r--r--test/files/run/nothingTypeDce.flags2
-rw-r--r--test/files/run/nothingTypeDce.scala3
-rw-r--r--test/files/run/nothingTypeNoFramesNoDce.check1
-rw-r--r--test/files/run/nothingTypeNoFramesNoDce.flags1
-rw-r--r--test/files/run/nothingTypeNoFramesNoDce.scala61
-rw-r--r--test/files/run/nothingTypeNoOpt.flags2
-rw-r--r--test/files/run/repl-javap-app.check63
-rw-r--r--test/files/run/repl-javap-app.scala21
13 files changed, 10 insertions, 157 deletions
diff --git a/test/files/filters b/test/files/filters
index 51a7507848..e91ca0eb36 100644
--- a/test/files/filters
+++ b/test/files/filters
@@ -1,6 +1,7 @@
#
#Java HotSpot(TM) 64-Bit Server VM warning: Failed to reserve shared memory (errno = 28).
Java HotSpot\(TM\) .* warning:
+OpenJDK .* warning:
# Hotspot receiving VM options through the $_JAVA_OPTIONS
# env variable outputs them on stderr
Picked up _JAVA_OPTIONS:
diff --git a/test/files/neg/deprecated-target.check b/test/files/neg/deprecated-target.check
new file mode 100644
index 0000000000..307d3d25ab
--- /dev/null
+++ b/test/files/neg/deprecated-target.check
@@ -0,0 +1,4 @@
+warning: -target is deprecated: -target:jvm-1.7 is deprecated, forcing use of jvm-1.8
+error: No warnings can be incurred under -Xfatal-warnings.
+one warning found
+one error found
diff --git a/test/files/neg/deprecated-target.flags b/test/files/neg/deprecated-target.flags
new file mode 100644
index 0000000000..458ded8123
--- /dev/null
+++ b/test/files/neg/deprecated-target.flags
@@ -0,0 +1 @@
+-target:jvm-1.7 -deprecation -Xfatal-warnings
diff --git a/test/files/neg/deprecated-target.scala b/test/files/neg/deprecated-target.scala
new file mode 100644
index 0000000000..9dccdd5e59
--- /dev/null
+++ b/test/files/neg/deprecated-target.scala
@@ -0,0 +1 @@
+class C \ No newline at end of file
diff --git a/test/files/neg/t6289.check b/test/files/neg/t6289.check
index 989932750f..7b2b4b2d32 100644
--- a/test/files/neg/t6289.check
+++ b/test/files/neg/t6289.check
@@ -1,9 +1,3 @@
-#partest java6
-t6289/J.java:2: method does not override or implement a method from a supertype
- @Override public void foo() { }
- ^
-1 error
-#partest !java6
t6289/J.java:2: error: method does not override or implement a method from a supertype
@Override public void foo() { }
^
diff --git a/test/files/run/nothingTypeDce.flags b/test/files/run/nothingTypeDce.flags
index d85321ca0e..fde52cc7df 100644
--- a/test/files/run/nothingTypeDce.flags
+++ b/test/files/run/nothingTypeDce.flags
@@ -1 +1 @@
--target:jvm-1.6 -Ybackend:GenBCode -Yopt:unreachable-code
+-Ybackend:GenBCode -Yopt:unreachable-code
diff --git a/test/files/run/nothingTypeDce.scala b/test/files/run/nothingTypeDce.scala
index 5f3692fd33..92d3ca6f89 100644
--- a/test/files/run/nothingTypeDce.scala
+++ b/test/files/run/nothingTypeDce.scala
@@ -1,7 +1,6 @@
// See comment in BCodeBodyBuilder
-// -target:jvm-1.6 -Ybackend:GenBCode -Yopt:unreachable-code
-// target enables stack map frames generation
+// -Ybackend:GenBCode -Yopt:unreachable-code
class C {
// can't just emit a call to ???, that returns value of type Nothing$ (not Int).
diff --git a/test/files/run/nothingTypeNoFramesNoDce.check b/test/files/run/nothingTypeNoFramesNoDce.check
deleted file mode 100644
index b1d08b45ff..0000000000
--- a/test/files/run/nothingTypeNoFramesNoDce.check
+++ /dev/null
@@ -1 +0,0 @@
-warning: -target:jvm-1.5 is deprecated: use target for Java 1.6 or above.
diff --git a/test/files/run/nothingTypeNoFramesNoDce.flags b/test/files/run/nothingTypeNoFramesNoDce.flags
deleted file mode 100644
index a035c86179..0000000000
--- a/test/files/run/nothingTypeNoFramesNoDce.flags
+++ /dev/null
@@ -1 +0,0 @@
--target:jvm-1.5 -Ybackend:GenBCode -Yopt:l:none -deprecation
diff --git a/test/files/run/nothingTypeNoFramesNoDce.scala b/test/files/run/nothingTypeNoFramesNoDce.scala
deleted file mode 100644
index 3d1298303a..0000000000
--- a/test/files/run/nothingTypeNoFramesNoDce.scala
+++ /dev/null
@@ -1,61 +0,0 @@
-// See comment in BCodeBodyBuilder
-
-// -target:jvm-1.5 -Ybackend:GenBCode -Yopt:l:none
-// target disables stack map frame generation. in this mode, the ClssWriter just emits dead code as is.
-
-class C {
- // can't just emit a call to ???, that returns value of type Nothing$ (not Int).
- def f1: Int = ???
-
- def f2: Int = throw new Error("")
-
- def f3(x: Boolean) = {
- var y = 0
- // cannot assign an object of type Nothing$ to Int
- if (x) y = ???
- else y = 1
- y
- }
-
- def f4(x: Boolean) = {
- var y = 0
- // tests that whatever is emitted after the throw is valid (what? depends on opts, presence of stack map frames)
- if (x) y = throw new Error("")
- else y = 1
- y
- }
-
- def f5(x: Boolean) = {
- // stack heights need to be the smae. ??? looks to the jvm like returning a value of
- // type Nothing$, need to drop or throw it.
- println(
- if (x) { ???; 10 }
- else 20
- )
- }
-
- def f6(x: Boolean) = {
- println(
- if (x) { throw new Error(""); 10 }
- else 20
- )
- }
-
- def f7(x: Boolean) = {
- println(
- if (x) throw new Error("")
- else 20
- )
- }
-
- def f8(x: Boolean) = {
- println(
- if (x) throw new Error("")
- else 20
- )
- }
-}
-
-object Test extends App {
- new C()
-}
diff --git a/test/files/run/nothingTypeNoOpt.flags b/test/files/run/nothingTypeNoOpt.flags
index b3b518051b..d3e4d61e19 100644
--- a/test/files/run/nothingTypeNoOpt.flags
+++ b/test/files/run/nothingTypeNoOpt.flags
@@ -1 +1 @@
--target:jvm-1.6 -Ybackend:GenBCode -Yopt:l:none
+-Ybackend:GenBCode -Yopt:l:none
diff --git a/test/files/run/repl-javap-app.check b/test/files/run/repl-javap-app.check
deleted file mode 100644
index eb3718f44b..0000000000
--- a/test/files/run/repl-javap-app.check
+++ /dev/null
@@ -1,63 +0,0 @@
-#partest java6
-Welcome to Scala
-Type in expressions to have them evaluated.
-Type :help for more information.
-
-scala> :javap -app MyApp$
-public final void delayedEndpoint$MyApp$1();
- Code:
- Stack=2, Locals=1, Args_size=1
- 0: getstatic #XX; //Field scala/Console$.MODULE$:Lscala/Console$;
- 3: ldc #XX; //String Hello, delayed world.
- 5: invokevirtual #XX; //Method scala/Console$.println:(Ljava/lang/Object;)V
- 8: return
- LocalVariableTable:
- Start Length Slot Name Signature
- 0 9 0 this LMyApp$;
-
-scala> :quit
-#partest java7
-Welcome to Scala
-Type in expressions to have them evaluated.
-Type :help for more information.
-
-scala> :javap -app MyApp$
- public final void delayedEndpoint$MyApp$1();
- flags: ACC_PUBLIC, ACC_FINAL
- Code:
- stack=2, locals=1, args_size=1
- 0: getstatic #XX // Field scala/Console$.MODULE$:Lscala/Console$;
- 3: ldc #XX // String Hello, delayed world.
- 5: invokevirtual #XX // Method scala/Console$.println:(Ljava/lang/Object;)V
- 8: return
- LocalVariableTable:
- Start Length Slot Name Signature
- 0 9 0 this LMyApp$;
- LineNumberTable:
- line 5: 0
-}
-
-scala> :quit
-#partest java8
-Welcome to Scala
-Type in expressions to have them evaluated.
-Type :help for more information.
-
-scala> :javap -app MyApp$
- public final void delayedEndpoint$MyApp$1();
- descriptor: ()V
- flags: ACC_PUBLIC, ACC_FINAL
- Code:
- stack=2, locals=1, args_size=1
- 0: getstatic #XX // Field scala/Console$.MODULE$:Lscala/Console$;
- 3: ldc #XX // String Hello, delayed world.
- 5: invokevirtual #XX // Method scala/Console$.println:(Ljava/lang/Object;)V
- 8: return
- LocalVariableTable:
- Start Length Slot Name Signature
- 0 9 0 this LMyApp$;
- LineNumberTable:
- line 5: 0
-}
-
-scala> :quit
diff --git a/test/files/run/repl-javap-app.scala b/test/files/run/repl-javap-app.scala
deleted file mode 100644
index ad6076c2d5..0000000000
--- a/test/files/run/repl-javap-app.scala
+++ /dev/null
@@ -1,21 +0,0 @@
-
-import scala.tools.partest.ReplTest
-
-object MyApp extends App {
- Console println "Hello, delayed world."
-}
-
-object Test extends ReplTest {
- def code = ":javap -app MyApp$"
-
- override def welcoming = true
-
- // The constant pool indices are not the same for GenASM / GenBCode, so
- // replacing the exact numbers by XX.
- lazy val hasConstantPoolRef = """(.*)(#\d\d)(.*)""".r
-
- override def normalize(s: String) = s match {
- case hasConstantPoolRef(start, ref, end) => start + "#XX" + end
- case _ => super.normalize(s)
- }
-}