summaryrefslogtreecommitdiff
path: root/test/files/neg
diff options
context:
space:
mode:
authorGrzegorz Kossakowski <grzegorz.kossakowski@gmail.com>2013-09-12 10:26:46 -0700
committerGrzegorz Kossakowski <grzegorz.kossakowski@gmail.com>2013-09-12 10:26:46 -0700
commit33a819f61b8b9c19708e8ae22bf25adf6cc7ac24 (patch)
tree30fb8d7295f359aca662eb3fb96bc9f9a0646f1f /test/files/neg
parente748f2ed8fda553fd8fe36499bac63aa115a82a9 (diff)
parentdfe3fe335bf7358e04e7f422fecf16f445c14f2b (diff)
downloadscala-33a819f61b8b9c19708e8ae22bf25adf6cc7ac24.tar.gz
scala-33a819f61b8b9c19708e8ae22bf25adf6cc7ac24.tar.bz2
scala-33a819f61b8b9c19708e8ae22bf25adf6cc7ac24.zip
Merge pull request #2859 from som-snytt/issue/7622-phaser
SI-7622 Clean Up Phase Assembly
Diffstat (limited to 'test/files/neg')
-rwxr-xr-xtest/files/neg/t6446-additional.check8
-rwxr-xr-xtest/files/neg/t6446-missing.check7
-rw-r--r--test/files/neg/t6446-show-phases.check7
-rw-r--r--test/files/neg/t7494-multi-right-after.check4
-rw-r--r--test/files/neg/t7494-no-options.check10
-rw-r--r--test/files/neg/t7494-right-after-before.check2
-rw-r--r--test/files/neg/t7622-cyclic-dependency.check1
-rw-r--r--test/files/neg/t7622-cyclic-dependency/ThePlugin.scala40
-rw-r--r--test/files/neg/t7622-cyclic-dependency/sample_2.flags1
-rw-r--r--test/files/neg/t7622-cyclic-dependency/sample_2.scala6
-rw-r--r--test/files/neg/t7622-cyclic-dependency/scalac-plugin.xml5
-rw-r--r--test/files/neg/t7622-missing-dependency.check2
-rw-r--r--test/files/neg/t7622-missing-dependency/ThePlugin.scala33
-rw-r--r--test/files/neg/t7622-missing-dependency/sample_2.flags1
-rw-r--r--test/files/neg/t7622-missing-dependency/sample_2.scala6
-rw-r--r--test/files/neg/t7622-missing-dependency/scalac-plugin.xml5
-rw-r--r--test/files/neg/t7622-missing-required.check2
-rw-r--r--test/files/neg/t7622-missing-required.flags1
-rw-r--r--test/files/neg/t7622-missing-required.scala4
-rw-r--r--test/files/neg/t7622-multi-followers.check1
-rw-r--r--test/files/neg/t7622-multi-followers/ThePlugin.scala44
-rw-r--r--test/files/neg/t7622-multi-followers/sample_2.flags1
-rw-r--r--test/files/neg/t7622-multi-followers/sample_2.scala6
-rw-r--r--test/files/neg/t7622-multi-followers/scalac-plugin.xml5
24 files changed, 193 insertions, 9 deletions
diff --git a/test/files/neg/t6446-additional.check b/test/files/neg/t6446-additional.check
index 24201c07c2..6dfe072913 100755
--- a/test/files/neg/t6446-additional.check
+++ b/test/files/neg/t6446-additional.check
@@ -22,6 +22,7 @@ superaccessors 6 add super accessors in traits and nested classes
mixin 20 mixin composition
cleanup 21 platform-specific cleanups, generate reflective calls
icode 22 generate portable intermediate code
+#partest -optimise
inliner 23 optimization: do inlining
inlinehandlers 24 optimization: inline exception handlers
closelim 25 optimization: eliminate uncalled closures
@@ -29,4 +30,9 @@ inlinehandlers 24 optimization: inline exception handlers
dce 27 optimization: eliminate dead code
jvm 28 generate JVM bytecode
ploogin 29 A sample phase that does so many things it's kind of hard...
- terminal 30 The last phase in the compiler chain
+ terminal 30 the last phase during a compilation run
+#partest !-optimise
+ jvm 23 generate JVM bytecode
+ ploogin 24 A sample phase that does so many things it's kind of hard...
+ terminal 25 the last phase during a compilation run
+#partest
diff --git a/test/files/neg/t6446-missing.check b/test/files/neg/t6446-missing.check
index 6e5bdcf07c..d4afa9b630 100755
--- a/test/files/neg/t6446-missing.check
+++ b/test/files/neg/t6446-missing.check
@@ -23,10 +23,15 @@ superaccessors 6 add super accessors in traits and nested classes
mixin 20 mixin composition
cleanup 21 platform-specific cleanups, generate reflective calls
icode 22 generate portable intermediate code
+#partest !-optimise
+ jvm 23 generate JVM bytecode
+ terminal 24 the last phase during a compilation run
+#partest -optimise
inliner 23 optimization: do inlining
inlinehandlers 24 optimization: inline exception handlers
closelim 25 optimization: eliminate uncalled closures
constopt 26 optimization: optimize null and other constants
dce 27 optimization: eliminate dead code
jvm 28 generate JVM bytecode
- terminal 29 The last phase in the compiler chain
+ terminal 29 the last phase during a compilation run
+#partest
diff --git a/test/files/neg/t6446-show-phases.check b/test/files/neg/t6446-show-phases.check
index a1bf408506..10a9e08b86 100644
--- a/test/files/neg/t6446-show-phases.check
+++ b/test/files/neg/t6446-show-phases.check
@@ -22,10 +22,15 @@ superaccessors 6 add super accessors in traits and nested classes
mixin 20 mixin composition
cleanup 21 platform-specific cleanups, generate reflective calls
icode 22 generate portable intermediate code
+#partest !-optimise
+ jvm 23 generate JVM bytecode
+ terminal 24 the last phase during a compilation run
+#partest -optimise
inliner 23 optimization: do inlining
inlinehandlers 24 optimization: inline exception handlers
closelim 25 optimization: eliminate uncalled closures
constopt 26 optimization: optimize null and other constants
dce 27 optimization: eliminate dead code
jvm 28 generate JVM bytecode
- terminal 29 The last phase in the compiler chain
+ terminal 29 the last phase during a compilation run
+#partest
diff --git a/test/files/neg/t7494-multi-right-after.check b/test/files/neg/t7494-multi-right-after.check
index 9c6fdbe91f..151d177414 100644
--- a/test/files/neg/t7494-multi-right-after.check
+++ b/test/files/neg/t7494-multi-right-after.check
@@ -1,3 +1 @@
-error: Multiple phases want to run right after the phase explicitouter
-Phases: erasure, multi-rafter,
-Re-run with -Xgenerate-phase-graph <filename> to better see the problem.
+error: Multiple phases want to run right after explicitouter; followers: erasure,multi-rafter; created phase-order.dot
diff --git a/test/files/neg/t7494-no-options.check b/test/files/neg/t7494-no-options.check
index c197d2a671..0bde84c96c 100644
--- a/test/files/neg/t7494-no-options.check
+++ b/test/files/neg/t7494-no-options.check
@@ -1,4 +1,4 @@
-error: Error: ploogin has no options
+error: Error: ploogin takes no options
phase name id description
---------- -- -----------
parser 1 parse source into ASTs, perform simple desugaring
@@ -23,6 +23,11 @@ superaccessors 6 add super accessors in traits and nested classes
mixin 20 mixin composition
cleanup 21 platform-specific cleanups, generate reflective calls
icode 22 generate portable intermediate code
+#partest !-optimise
+ jvm 23 generate JVM bytecode
+ ploogin 24 A sample phase that does so many things it's kind of hard...
+ terminal 25 the last phase during a compilation run
+#partest -optimise
inliner 23 optimization: do inlining
inlinehandlers 24 optimization: inline exception handlers
closelim 25 optimization: eliminate uncalled closures
@@ -30,4 +35,5 @@ inlinehandlers 24 optimization: inline exception handlers
dce 27 optimization: eliminate dead code
jvm 28 generate JVM bytecode
ploogin 29 A sample phase that does so many things it's kind of hard...
- terminal 30 The last phase in the compiler chain
+ terminal 30 the last phase during a compilation run
+#partest
diff --git a/test/files/neg/t7494-right-after-before.check b/test/files/neg/t7494-right-after-before.check
index 9b57a7711b..7e83daab4a 100644
--- a/test/files/neg/t7494-right-after-before.check
+++ b/test/files/neg/t7494-right-after-before.check
@@ -1 +1 @@
-error: phase erasure want to run right after explicitouter, but some phase has declared to run before erasure. Re-run with -Xgenerate-phase-graph <filename> to better see the problem.
+error: Phase erasure can't follow explicitouter, created phase-order.dot
diff --git a/test/files/neg/t7622-cyclic-dependency.check b/test/files/neg/t7622-cyclic-dependency.check
new file mode 100644
index 0000000000..3546964f5f
--- /dev/null
+++ b/test/files/neg/t7622-cyclic-dependency.check
@@ -0,0 +1 @@
+error: Cycle in phase dependencies detected at cyclicdependency1, created phase-cycle.dot
diff --git a/test/files/neg/t7622-cyclic-dependency/ThePlugin.scala b/test/files/neg/t7622-cyclic-dependency/ThePlugin.scala
new file mode 100644
index 0000000000..7a905ae32d
--- /dev/null
+++ b/test/files/neg/t7622-cyclic-dependency/ThePlugin.scala
@@ -0,0 +1,40 @@
+package scala.test.plugins
+
+import scala.tools.nsc
+import nsc.Global
+import nsc.Phase
+import nsc.plugins.Plugin
+import nsc.plugins.PluginComponent
+
+class ThePlugin(val global: Global) extends Plugin {
+ import global._
+
+ val name = "cyclicdependency"
+ val description = "Declares two phases that have a cyclic dependency"
+ val components = List[PluginComponent](thePhase1,thePhase2)
+
+ private object thePhase1 extends PluginComponent {
+ val global = ThePlugin.this.global
+
+ val runsAfter = List[String]("tailcalls","cyclicdependency2")
+
+ val phaseName = ThePlugin.this.name + "1"
+
+ def newPhase(prev: Phase) = new ThePhase(prev, phaseName)
+ }
+
+ private object thePhase2 extends PluginComponent {
+ val global = ThePlugin.this.global
+
+ val runsAfter = List[String]("dce","cyclicdependency1")
+
+ val phaseName = ThePlugin.this.name + "2"
+
+ def newPhase(prev: Phase) = new ThePhase(prev, phaseName)
+ }
+
+ private class ThePhase(prev: Phase, val name: String) extends Phase(prev) {
+ def run {}
+ }
+}
+
diff --git a/test/files/neg/t7622-cyclic-dependency/sample_2.flags b/test/files/neg/t7622-cyclic-dependency/sample_2.flags
new file mode 100644
index 0000000000..db25b88a12
--- /dev/null
+++ b/test/files/neg/t7622-cyclic-dependency/sample_2.flags
@@ -0,0 +1 @@
+-Xplugin:. -Xplugin-require:cyclicdependency
diff --git a/test/files/neg/t7622-cyclic-dependency/sample_2.scala b/test/files/neg/t7622-cyclic-dependency/sample_2.scala
new file mode 100644
index 0000000000..73cdc64e40
--- /dev/null
+++ b/test/files/neg/t7622-cyclic-dependency/sample_2.scala
@@ -0,0 +1,6 @@
+
+package sample
+
+// just a sample that is compiled with the sample plugin enabled
+object Sample extends App {
+}
diff --git a/test/files/neg/t7622-cyclic-dependency/scalac-plugin.xml b/test/files/neg/t7622-cyclic-dependency/scalac-plugin.xml
new file mode 100644
index 0000000000..2558d6fd03
--- /dev/null
+++ b/test/files/neg/t7622-cyclic-dependency/scalac-plugin.xml
@@ -0,0 +1,5 @@
+<plugin>
+ <name>ignored</name>
+ <classname>scala.test.plugins.ThePlugin</classname>
+</plugin>
+
diff --git a/test/files/neg/t7622-missing-dependency.check b/test/files/neg/t7622-missing-dependency.check
new file mode 100644
index 0000000000..a0d0e30870
--- /dev/null
+++ b/test/files/neg/t7622-missing-dependency.check
@@ -0,0 +1,2 @@
+error: Phase 'myplugin' requires: List(missing)
+one error found
diff --git a/test/files/neg/t7622-missing-dependency/ThePlugin.scala b/test/files/neg/t7622-missing-dependency/ThePlugin.scala
new file mode 100644
index 0000000000..a87cbb8e45
--- /dev/null
+++ b/test/files/neg/t7622-missing-dependency/ThePlugin.scala
@@ -0,0 +1,33 @@
+package scala.test.plugins
+
+import scala.tools.nsc
+import nsc.Global
+import nsc.Phase
+import nsc.plugins.Plugin
+import nsc.plugins.PluginComponent
+
+class ThePlugin(val global: Global) extends Plugin {
+ import global._
+
+ val name = "myplugin"
+ val description = "Declares one plugin with a missing requirement"
+ val components = List[PluginComponent](thePhase)
+
+ private object thePhase extends PluginComponent {
+ val global = ThePlugin.this.global
+
+ val runsAfter = List[String]("typer")
+
+ val phaseName = ThePlugin.this.name
+
+ override val requires = List("missing")
+
+ def newPhase(prev: Phase) = new ThePhase(prev)
+ }
+
+ private class ThePhase(prev: Phase) extends Phase(prev) {
+ def name = thePhase.phaseName
+ def run {}
+ }
+}
+
diff --git a/test/files/neg/t7622-missing-dependency/sample_2.flags b/test/files/neg/t7622-missing-dependency/sample_2.flags
new file mode 100644
index 0000000000..d69035100e
--- /dev/null
+++ b/test/files/neg/t7622-missing-dependency/sample_2.flags
@@ -0,0 +1 @@
+-Xplugin:. -Xplugin-require:myplugin
diff --git a/test/files/neg/t7622-missing-dependency/sample_2.scala b/test/files/neg/t7622-missing-dependency/sample_2.scala
new file mode 100644
index 0000000000..73cdc64e40
--- /dev/null
+++ b/test/files/neg/t7622-missing-dependency/sample_2.scala
@@ -0,0 +1,6 @@
+
+package sample
+
+// just a sample that is compiled with the sample plugin enabled
+object Sample extends App {
+}
diff --git a/test/files/neg/t7622-missing-dependency/scalac-plugin.xml b/test/files/neg/t7622-missing-dependency/scalac-plugin.xml
new file mode 100644
index 0000000000..3c14061dce
--- /dev/null
+++ b/test/files/neg/t7622-missing-dependency/scalac-plugin.xml
@@ -0,0 +1,5 @@
+<plugin>
+ <name>myplugin</name>
+ <classname>scala.test.plugins.ThePlugin</classname>
+</plugin>
+
diff --git a/test/files/neg/t7622-missing-required.check b/test/files/neg/t7622-missing-required.check
new file mode 100644
index 0000000000..5982178581
--- /dev/null
+++ b/test/files/neg/t7622-missing-required.check
@@ -0,0 +1,2 @@
+error: Missing required plugin: special-plugin
+one error found
diff --git a/test/files/neg/t7622-missing-required.flags b/test/files/neg/t7622-missing-required.flags
new file mode 100644
index 0000000000..65deac6feb
--- /dev/null
+++ b/test/files/neg/t7622-missing-required.flags
@@ -0,0 +1 @@
+-Xplugin-require:special-plugin
diff --git a/test/files/neg/t7622-missing-required.scala b/test/files/neg/t7622-missing-required.scala
new file mode 100644
index 0000000000..a0ba487b24
--- /dev/null
+++ b/test/files/neg/t7622-missing-required.scala
@@ -0,0 +1,4 @@
+
+// the amazing features of this trait
+// are unlocked by compiling with a special plugin.
+trait Amazing
diff --git a/test/files/neg/t7622-multi-followers.check b/test/files/neg/t7622-multi-followers.check
new file mode 100644
index 0000000000..d123853a5b
--- /dev/null
+++ b/test/files/neg/t7622-multi-followers.check
@@ -0,0 +1 @@
+error: Multiple phases want to run right after parser; followers: multi1,multi2; created phase-order.dot
diff --git a/test/files/neg/t7622-multi-followers/ThePlugin.scala b/test/files/neg/t7622-multi-followers/ThePlugin.scala
new file mode 100644
index 0000000000..e7a49a9be6
--- /dev/null
+++ b/test/files/neg/t7622-multi-followers/ThePlugin.scala
@@ -0,0 +1,44 @@
+package scala.test.plugins
+
+import scala.tools.nsc
+import nsc.Global
+import nsc.Phase
+import nsc.plugins.Plugin
+import nsc.plugins.PluginComponent
+
+class ThePlugin(val global: Global) extends Plugin {
+ import global._
+
+ val name = "multi"
+ val description = "Declares two phases that both follow parser"
+ val components = List[PluginComponent](thePhase1,thePhase2)
+
+ private object thePhase1 extends PluginComponent {
+ val global = ThePlugin.this.global
+
+ val runsAfter = List[String]()
+
+ override val runsRightAfter = Some("parser")
+
+ val phaseName = ThePlugin.this.name + "1"
+
+ def newPhase(prev: Phase) = new ThePhase(prev, phaseName)
+ }
+
+ private object thePhase2 extends PluginComponent {
+ val global = ThePlugin.this.global
+
+ val runsAfter = List[String]()
+
+ override val runsRightAfter = Some("parser")
+
+ val phaseName = ThePlugin.this.name + "2"
+
+ def newPhase(prev: Phase) = new ThePhase(prev, phaseName)
+ }
+
+ private class ThePhase(prev: Phase, val name: String) extends Phase(prev) {
+ def run {}
+ }
+}
+
diff --git a/test/files/neg/t7622-multi-followers/sample_2.flags b/test/files/neg/t7622-multi-followers/sample_2.flags
new file mode 100644
index 0000000000..d2e83e9723
--- /dev/null
+++ b/test/files/neg/t7622-multi-followers/sample_2.flags
@@ -0,0 +1 @@
+-Xplugin:. -Xplugin-require:multi
diff --git a/test/files/neg/t7622-multi-followers/sample_2.scala b/test/files/neg/t7622-multi-followers/sample_2.scala
new file mode 100644
index 0000000000..73cdc64e40
--- /dev/null
+++ b/test/files/neg/t7622-multi-followers/sample_2.scala
@@ -0,0 +1,6 @@
+
+package sample
+
+// just a sample that is compiled with the sample plugin enabled
+object Sample extends App {
+}
diff --git a/test/files/neg/t7622-multi-followers/scalac-plugin.xml b/test/files/neg/t7622-multi-followers/scalac-plugin.xml
new file mode 100644
index 0000000000..2558d6fd03
--- /dev/null
+++ b/test/files/neg/t7622-multi-followers/scalac-plugin.xml
@@ -0,0 +1,5 @@
+<plugin>
+ <name>ignored</name>
+ <classname>scala.test.plugins.ThePlugin</classname>
+</plugin>
+