From 4ab66d1613da276712692001ed8f9f3c009736ab Mon Sep 17 00:00:00 2001 From: Som Snytt Date: Sat, 18 May 2013 08:46:43 -0700 Subject: SI-7494 Tests for status quo Exploit SI-6446 fix to move old pending tests for plugins to the active pool. Also, nuance the partest runner to allow the compiler to crash with a FatalError if a check file is present. Some of the plugin tests make phase assembly throw. One of the legacy tests was moved back to pending: There seems to be a race for who shall be deemed truly dependent. Back to pending for you! apm@mara:~/projects/snytt/test$ ./partest files/neg/t7494-cyclic-dependency/ Selected 1 tests drawn from specified tests > starting 1 test in neg ok 1 - neg/t7494-cyclic-dependency 1/1 passed (elapsed time: 00:00:04) Test Run PASSED apm@mara:~/projects/snytt/test$ ./partest files/neg/t7494-cyclic-dependency/ Selected 1 tests drawn from specified tests > starting 1 test in neg !! 1 - neg/t7494-cyclic-dependency [output differs] > 0/1 passed, 1 failed in neg >>>>> Transcripts from failed tests >>>>> > partest files/neg/t7494-cyclic-dependency % scalac t7494-cyclic-dependency/ThePlugin.scala % scalac t7494-cyclic-dependency/sample_2.scala error: Cycle in compiler phase dependencies detected, phase cyclicdependency1 reacted twice! % diff files/neg/t7494-cyclic-dependency-neg.log files/neg/t7494-cyclic-dependency.check @@ -1 +1 @@ -error: Cycle in compiler phase dependencies detected, phase cyclicdependency1 reacted twice! +error: Cycle in compiler phase dependencies detected, phase cyclicdependency2 reacted twice! 0/1 passed, 1 failed (elapsed time: 00:00:04) Test Run FAILED --- src/partest/scala/tools/partest/nest/Runner.scala | 6 ++-- test/files/neg/t7494-after-terminal.check | 2 ++ .../files/neg/t7494-after-terminal/ThePlugin.scala | 31 ++++++++++++++++ test/files/neg/t7494-after-terminal/sample_2.flags | 1 + test/files/neg/t7494-after-terminal/sample_2.scala | 6 ++++ .../neg/t7494-after-terminal/scalac-plugin.xml | 5 +++ test/files/neg/t7494-before-parser.check | 2 ++ test/files/neg/t7494-before-parser/ThePlugin.scala | 32 +++++++++++++++++ test/files/neg/t7494-before-parser/sample_2.flags | 1 + test/files/neg/t7494-before-parser/sample_2.scala | 6 ++++ .../neg/t7494-before-parser/scalac-plugin.xml | 5 +++ test/files/neg/t7494-cyclic-dependency.check | 1 + test/files/neg/t7494-multi-right-after.check | 3 ++ .../neg/t7494-multi-right-after/ThePlugin.scala | 31 ++++++++++++++++ .../neg/t7494-multi-right-after/sample_2.flags | 1 + .../neg/t7494-multi-right-after/sample_2.scala | 6 ++++ .../neg/t7494-multi-right-after/scalac-plugin.xml | 5 +++ test/files/neg/t7494-no-options.check | 33 +++++++++++++++++ test/files/neg/t7494-no-options/ploogin_1.scala | 31 ++++++++++++++++ test/files/neg/t7494-no-options/sample_2.flags | 1 + test/files/neg/t7494-no-options/sample_2.scala | 6 ++++ test/files/neg/t7494-no-options/scalac-plugin.xml | 4 +++ test/files/neg/t7494-right-after-before.check | 1 + .../neg/t7494-right-after-before/ThePlugin.scala | 31 ++++++++++++++++ .../neg/t7494-right-after-before/sample_2.flags | 1 + .../neg/t7494-right-after-before/sample_2.scala | 6 ++++ .../neg/t7494-right-after-before/scalac-plugin.xml | 5 +++ test/files/neg/t7494-right-after-terminal.check | 2 ++ .../neg/t7494-right-after-terminal/ThePlugin.scala | 32 +++++++++++++++++ .../neg/t7494-right-after-terminal/sample_2.flags | 1 + .../neg/t7494-right-after-terminal/sample_2.scala | 6 ++++ .../t7494-right-after-terminal/scalac-plugin.xml | 5 +++ test/pending/neg/plugin-after-terminal.check | 2 -- test/pending/neg/plugin-after-terminal.flags | 2 -- .../lib/plugins.jar.desired.sha1 | 1 - .../neg/plugin-after-terminal/misc/build.sh | 14 -------- .../plugin-after-terminal/misc/scalac-plugin.xml | 5 --- .../neg/plugin-after-terminal/src/ThePlugin.scala | 31 ---------------- .../neg/plugin-after-terminal/testsource.scala | 4 --- test/pending/neg/plugin-before-parser.check | 2 -- test/pending/neg/plugin-before-parser.flags | 2 -- .../lib/plugins.jar.desired.sha1 | 1 - .../pending/neg/plugin-before-parser/misc/build.sh | 14 -------- .../plugin-before-parser/misc/scalac-plugin.xml | 5 --- .../neg/plugin-before-parser/src/ThePlugin.scala | 32 ----------------- .../neg/plugin-before-parser/testsource.scala | 4 --- test/pending/neg/plugin-cyclic-dependency.check | 2 -- test/pending/neg/plugin-cyclic-dependency.flags | 2 -- .../lib/plugins.jar.desired.sha1 | 1 - .../neg/plugin-cyclic-dependency/misc/build.sh | 14 -------- .../misc/scalac-plugin.xml | 5 --- .../plugin-cyclic-dependency/src/ThePlugin.scala | 41 ---------------------- .../neg/plugin-cyclic-dependency/testsource.scala | 4 --- test/pending/neg/plugin-multiple-rafter.check | 4 --- test/pending/neg/plugin-multiple-rafter.flags | 2 -- .../lib/plugins.jar.desired.sha1 | 1 - .../neg/plugin-multiple-rafter/misc/build.sh | 14 -------- .../plugin-multiple-rafter/misc/scalac-plugin.xml | 5 --- .../neg/plugin-multiple-rafter/src/ThePlugin.scala | 31 ---------------- .../neg/plugin-multiple-rafter/testsource.scala | 4 --- test/pending/neg/plugin-rafter-before-1.check | 2 -- test/pending/neg/plugin-rafter-before-1.flags | 2 -- .../lib/plugins.jar.desired.sha1 | 1 - .../neg/plugin-rafter-before-1/misc/build.sh | 14 -------- .../plugin-rafter-before-1/misc/scalac-plugin.xml | 5 --- .../neg/plugin-rafter-before-1/src/ThePlugin.scala | 31 ---------------- .../neg/plugin-rafter-before-1/testsource.scala | 4 --- test/pending/neg/plugin-rightafter-terminal.check | 2 -- test/pending/neg/plugin-rightafter-terminal.flags | 2 -- .../lib/plugins.jar.desired.sha1 | 1 - .../neg/plugin-rightafter-terminal/misc/build.sh | 14 -------- .../misc/scalac-plugin.xml | 5 --- .../plugin-rightafter-terminal/src/ThePlugin.scala | 32 ----------------- .../plugin-rightafter-terminal/testsource.scala | 4 --- .../neg/t7494-cyclic-dependency/ThePlugin.scala | 41 ++++++++++++++++++++++ .../neg/t7494-cyclic-dependency/sample_2.flags | 1 + .../neg/t7494-cyclic-dependency/sample_2.scala | 6 ++++ .../neg/t7494-cyclic-dependency/scalac-plugin.xml | 5 +++ 78 files changed, 360 insertions(+), 370 deletions(-) create mode 100644 test/files/neg/t7494-after-terminal.check create mode 100644 test/files/neg/t7494-after-terminal/ThePlugin.scala create mode 100644 test/files/neg/t7494-after-terminal/sample_2.flags create mode 100644 test/files/neg/t7494-after-terminal/sample_2.scala create mode 100644 test/files/neg/t7494-after-terminal/scalac-plugin.xml create mode 100644 test/files/neg/t7494-before-parser.check create mode 100644 test/files/neg/t7494-before-parser/ThePlugin.scala create mode 100644 test/files/neg/t7494-before-parser/sample_2.flags create mode 100644 test/files/neg/t7494-before-parser/sample_2.scala create mode 100644 test/files/neg/t7494-before-parser/scalac-plugin.xml create mode 100644 test/files/neg/t7494-cyclic-dependency.check create mode 100644 test/files/neg/t7494-multi-right-after.check create mode 100644 test/files/neg/t7494-multi-right-after/ThePlugin.scala create mode 100644 test/files/neg/t7494-multi-right-after/sample_2.flags create mode 100644 test/files/neg/t7494-multi-right-after/sample_2.scala create mode 100644 test/files/neg/t7494-multi-right-after/scalac-plugin.xml create mode 100644 test/files/neg/t7494-no-options.check create mode 100644 test/files/neg/t7494-no-options/ploogin_1.scala create mode 100644 test/files/neg/t7494-no-options/sample_2.flags create mode 100644 test/files/neg/t7494-no-options/sample_2.scala create mode 100644 test/files/neg/t7494-no-options/scalac-plugin.xml create mode 100644 test/files/neg/t7494-right-after-before.check create mode 100644 test/files/neg/t7494-right-after-before/ThePlugin.scala create mode 100644 test/files/neg/t7494-right-after-before/sample_2.flags create mode 100644 test/files/neg/t7494-right-after-before/sample_2.scala create mode 100644 test/files/neg/t7494-right-after-before/scalac-plugin.xml create mode 100644 test/files/neg/t7494-right-after-terminal.check create mode 100644 test/files/neg/t7494-right-after-terminal/ThePlugin.scala create mode 100644 test/files/neg/t7494-right-after-terminal/sample_2.flags create mode 100644 test/files/neg/t7494-right-after-terminal/sample_2.scala create mode 100644 test/files/neg/t7494-right-after-terminal/scalac-plugin.xml delete mode 100644 test/pending/neg/plugin-after-terminal.check delete mode 100644 test/pending/neg/plugin-after-terminal.flags delete mode 100644 test/pending/neg/plugin-after-terminal/lib/plugins.jar.desired.sha1 delete mode 100755 test/pending/neg/plugin-after-terminal/misc/build.sh delete mode 100644 test/pending/neg/plugin-after-terminal/misc/scalac-plugin.xml delete mode 100644 test/pending/neg/plugin-after-terminal/src/ThePlugin.scala delete mode 100644 test/pending/neg/plugin-after-terminal/testsource.scala delete mode 100644 test/pending/neg/plugin-before-parser.check delete mode 100644 test/pending/neg/plugin-before-parser.flags delete mode 100644 test/pending/neg/plugin-before-parser/lib/plugins.jar.desired.sha1 delete mode 100755 test/pending/neg/plugin-before-parser/misc/build.sh delete mode 100644 test/pending/neg/plugin-before-parser/misc/scalac-plugin.xml delete mode 100644 test/pending/neg/plugin-before-parser/src/ThePlugin.scala delete mode 100644 test/pending/neg/plugin-before-parser/testsource.scala delete mode 100644 test/pending/neg/plugin-cyclic-dependency.check delete mode 100644 test/pending/neg/plugin-cyclic-dependency.flags delete mode 100644 test/pending/neg/plugin-cyclic-dependency/lib/plugins.jar.desired.sha1 delete mode 100755 test/pending/neg/plugin-cyclic-dependency/misc/build.sh delete mode 100644 test/pending/neg/plugin-cyclic-dependency/misc/scalac-plugin.xml delete mode 100644 test/pending/neg/plugin-cyclic-dependency/src/ThePlugin.scala delete mode 100644 test/pending/neg/plugin-cyclic-dependency/testsource.scala delete mode 100644 test/pending/neg/plugin-multiple-rafter.check delete mode 100644 test/pending/neg/plugin-multiple-rafter.flags delete mode 100644 test/pending/neg/plugin-multiple-rafter/lib/plugins.jar.desired.sha1 delete mode 100755 test/pending/neg/plugin-multiple-rafter/misc/build.sh delete mode 100644 test/pending/neg/plugin-multiple-rafter/misc/scalac-plugin.xml delete mode 100644 test/pending/neg/plugin-multiple-rafter/src/ThePlugin.scala delete mode 100644 test/pending/neg/plugin-multiple-rafter/testsource.scala delete mode 100644 test/pending/neg/plugin-rafter-before-1.check delete mode 100644 test/pending/neg/plugin-rafter-before-1.flags delete mode 100644 test/pending/neg/plugin-rafter-before-1/lib/plugins.jar.desired.sha1 delete mode 100755 test/pending/neg/plugin-rafter-before-1/misc/build.sh delete mode 100644 test/pending/neg/plugin-rafter-before-1/misc/scalac-plugin.xml delete mode 100644 test/pending/neg/plugin-rafter-before-1/src/ThePlugin.scala delete mode 100644 test/pending/neg/plugin-rafter-before-1/testsource.scala delete mode 100644 test/pending/neg/plugin-rightafter-terminal.check delete mode 100644 test/pending/neg/plugin-rightafter-terminal.flags delete mode 100644 test/pending/neg/plugin-rightafter-terminal/lib/plugins.jar.desired.sha1 delete mode 100755 test/pending/neg/plugin-rightafter-terminal/misc/build.sh delete mode 100644 test/pending/neg/plugin-rightafter-terminal/misc/scalac-plugin.xml delete mode 100644 test/pending/neg/plugin-rightafter-terminal/src/ThePlugin.scala delete mode 100644 test/pending/neg/plugin-rightafter-terminal/testsource.scala create mode 100644 test/pending/neg/t7494-cyclic-dependency/ThePlugin.scala create mode 100644 test/pending/neg/t7494-cyclic-dependency/sample_2.flags create mode 100644 test/pending/neg/t7494-cyclic-dependency/sample_2.scala create mode 100644 test/pending/neg/t7494-cyclic-dependency/scalac-plugin.xml diff --git a/src/partest/scala/tools/partest/nest/Runner.scala b/src/partest/scala/tools/partest/nest/Runner.scala index 85679ad0b8..01e4f50981 100644 --- a/src/partest/scala/tools/partest/nest/Runner.scala +++ b/src/partest/scala/tools/partest/nest/Runner.scala @@ -13,6 +13,7 @@ import java.util.concurrent.TimeUnit.NANOSECONDS import scala.collection.mutable.ListBuffer import scala.concurrent.duration.Duration import scala.io.Codec +import scala.reflect.internal.FatalError import scala.sys.process.Process import scala.tools.nsc.Properties.{ envOrElse, isWin, jdkHome, javaHome, propOrElse, propOrEmpty, setProp } import scala.tools.nsc.{ Settings, CompilerCommand, Global } @@ -451,9 +452,10 @@ class Runner(val testFile: File, fileManager: FileManager, val testRunParams: Te val failing = rounds find (x => nextTestActionExpectTrue("compilation failed", x.isOk) == false) // which means passing if it checks and didn't crash the compiler + // or, OK, we'll let you crash the compiler with a FatalError if you supply a check file def checked(r: CompileRound) = r.result match { - case f: Crash => false - case f => normalizeLog(); diffIsOk + case Crash(_, t, _) if !checkFile.canRead || !t.isInstanceOf[FatalError] => false + case _ => normalizeLog(); diffIsOk } failing map (checked) getOrElse nextTestActionFailing("expected compilation failure") diff --git a/test/files/neg/t7494-after-terminal.check b/test/files/neg/t7494-after-terminal.check new file mode 100644 index 0000000000..096efe09cd --- /dev/null +++ b/test/files/neg/t7494-after-terminal.check @@ -0,0 +1,2 @@ +error: [phase assembly, after dependency on terminal phase not allowed: afterterminal => terminal] +one error found diff --git a/test/files/neg/t7494-after-terminal/ThePlugin.scala b/test/files/neg/t7494-after-terminal/ThePlugin.scala new file mode 100644 index 0000000000..2a4607392f --- /dev/null +++ b/test/files/neg/t7494-after-terminal/ThePlugin.scala @@ -0,0 +1,31 @@ +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 = "afterterminal" + val description = "Declares one plugin that wants to be after the terminal phase" + val components = List[PluginComponent](thePhase) + + private object thePhase extends PluginComponent { + val global = ThePlugin.this.global + + val runsAfter = List[String]("terminal") + + val phaseName = ThePlugin.this.name + + def newPhase(prev: Phase) = new ThePhase(prev) + } + + private class ThePhase(prev: Phase) extends Phase(prev) { + def name = ThePlugin.this.name + def run {} + } +} + diff --git a/test/files/neg/t7494-after-terminal/sample_2.flags b/test/files/neg/t7494-after-terminal/sample_2.flags new file mode 100644 index 0000000000..b8a476e361 --- /dev/null +++ b/test/files/neg/t7494-after-terminal/sample_2.flags @@ -0,0 +1 @@ +-Xplugin:. -Xplugin-require:afterterminal diff --git a/test/files/neg/t7494-after-terminal/sample_2.scala b/test/files/neg/t7494-after-terminal/sample_2.scala new file mode 100644 index 0000000000..73cdc64e40 --- /dev/null +++ b/test/files/neg/t7494-after-terminal/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/t7494-after-terminal/scalac-plugin.xml b/test/files/neg/t7494-after-terminal/scalac-plugin.xml new file mode 100644 index 0000000000..2558d6fd03 --- /dev/null +++ b/test/files/neg/t7494-after-terminal/scalac-plugin.xml @@ -0,0 +1,5 @@ + + ignored + scala.test.plugins.ThePlugin + + diff --git a/test/files/neg/t7494-before-parser.check b/test/files/neg/t7494-before-parser.check new file mode 100644 index 0000000000..9a407923b1 --- /dev/null +++ b/test/files/neg/t7494-before-parser.check @@ -0,0 +1,2 @@ +error: [phase assembly, before dependency on parser phase not allowed: parser => beforeparser] +one error found diff --git a/test/files/neg/t7494-before-parser/ThePlugin.scala b/test/files/neg/t7494-before-parser/ThePlugin.scala new file mode 100644 index 0000000000..7ca896650d --- /dev/null +++ b/test/files/neg/t7494-before-parser/ThePlugin.scala @@ -0,0 +1,32 @@ +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 = "beforeparser" + val description = "Declares one plugin that wants to be before the parser phase" + val components = List[PluginComponent](thePhase) + + private object thePhase extends PluginComponent { + val global = ThePlugin.this.global + + val runsAfter = List[String]() + override val runsBefore = List[String]("parser") + + val phaseName = ThePlugin.this.name + + def newPhase(prev: Phase) = new ThePhase(prev) + } + + private class ThePhase(prev: Phase) extends Phase(prev) { + def name = ThePlugin.this.name + def run {} + } +} + diff --git a/test/files/neg/t7494-before-parser/sample_2.flags b/test/files/neg/t7494-before-parser/sample_2.flags new file mode 100644 index 0000000000..0c92fc8a06 --- /dev/null +++ b/test/files/neg/t7494-before-parser/sample_2.flags @@ -0,0 +1 @@ +-Xplugin:. -Xplugin-require:beforeparser diff --git a/test/files/neg/t7494-before-parser/sample_2.scala b/test/files/neg/t7494-before-parser/sample_2.scala new file mode 100644 index 0000000000..73cdc64e40 --- /dev/null +++ b/test/files/neg/t7494-before-parser/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/t7494-before-parser/scalac-plugin.xml b/test/files/neg/t7494-before-parser/scalac-plugin.xml new file mode 100644 index 0000000000..90ff27dc2a --- /dev/null +++ b/test/files/neg/t7494-before-parser/scalac-plugin.xml @@ -0,0 +1,5 @@ + + beforeparser + scala.test.plugins.ThePlugin + + diff --git a/test/files/neg/t7494-cyclic-dependency.check b/test/files/neg/t7494-cyclic-dependency.check new file mode 100644 index 0000000000..205387c3dd --- /dev/null +++ b/test/files/neg/t7494-cyclic-dependency.check @@ -0,0 +1 @@ +error: Cycle in compiler phase dependencies detected, phase cyclicdependency2 reacted twice! diff --git a/test/files/neg/t7494-multi-right-after.check b/test/files/neg/t7494-multi-right-after.check new file mode 100644 index 0000000000..9c6fdbe91f --- /dev/null +++ b/test/files/neg/t7494-multi-right-after.check @@ -0,0 +1,3 @@ +error: Multiple phases want to run right after the phase explicitouter +Phases: erasure, multi-rafter, +Re-run with -Xgenerate-phase-graph to better see the problem. diff --git a/test/files/neg/t7494-multi-right-after/ThePlugin.scala b/test/files/neg/t7494-multi-right-after/ThePlugin.scala new file mode 100644 index 0000000000..819176fa88 --- /dev/null +++ b/test/files/neg/t7494-multi-right-after/ThePlugin.scala @@ -0,0 +1,31 @@ +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-rafter" + val description = "" + val components = List[PluginComponent](thePhase) + + private object thePhase extends PluginComponent { + val global = ThePlugin.this.global + + val runsAfter = List[String]() + override val runsRightAfter = Some("explicitouter") + val phaseName = ThePlugin.this.name + + def newPhase(prev: Phase) = new ThePhase(prev) + } + + private class ThePhase(prev: Phase) extends Phase(prev) { + def name = ThePlugin.this.name + def run {} + } +} + diff --git a/test/files/neg/t7494-multi-right-after/sample_2.flags b/test/files/neg/t7494-multi-right-after/sample_2.flags new file mode 100644 index 0000000000..9273fb98d7 --- /dev/null +++ b/test/files/neg/t7494-multi-right-after/sample_2.flags @@ -0,0 +1 @@ +-Xplugin:. -Xplugin-require:multi-rafter diff --git a/test/files/neg/t7494-multi-right-after/sample_2.scala b/test/files/neg/t7494-multi-right-after/sample_2.scala new file mode 100644 index 0000000000..73cdc64e40 --- /dev/null +++ b/test/files/neg/t7494-multi-right-after/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/t7494-multi-right-after/scalac-plugin.xml b/test/files/neg/t7494-multi-right-after/scalac-plugin.xml new file mode 100644 index 0000000000..2558d6fd03 --- /dev/null +++ b/test/files/neg/t7494-multi-right-after/scalac-plugin.xml @@ -0,0 +1,5 @@ + + ignored + scala.test.plugins.ThePlugin + + diff --git a/test/files/neg/t7494-no-options.check b/test/files/neg/t7494-no-options.check new file mode 100644 index 0000000000..c197d2a671 --- /dev/null +++ b/test/files/neg/t7494-no-options.check @@ -0,0 +1,33 @@ +error: Error: ploogin has no options + phase name id description + ---------- -- ----------- + parser 1 parse source into ASTs, perform simple desugaring + namer 2 resolve names, attach symbols to named trees +packageobjects 3 load package objects + typer 4 the meat and potatoes: type the trees + patmat 5 translate match expressions +superaccessors 6 add super accessors in traits and nested classes + extmethods 7 add extension methods for inline classes + pickler 8 serialize symbol tables + refchecks 9 reference/override checking, translate nested objects + uncurry 10 uncurry, translate function values to anonymous classes + tailcalls 11 replace tail calls by jumps + specialize 12 @specialized-driven class and method specialization + explicitouter 13 this refs to outer pointers, translate patterns + erasure 14 erase types, add interfaces for traits + posterasure 15 clean up erased inline classes + lazyvals 16 allocate bitmaps, translate lazy vals into lazified defs + lambdalift 17 move nested functions to top level + constructors 18 move field definitions into constructors + flatten 19 eliminate inner classes + mixin 20 mixin composition + cleanup 21 platform-specific cleanups, generate reflective calls + icode 22 generate portable intermediate code + 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 + ploogin 29 A sample phase that does so many things it's kind of hard... + terminal 30 The last phase in the compiler chain diff --git a/test/files/neg/t7494-no-options/ploogin_1.scala b/test/files/neg/t7494-no-options/ploogin_1.scala new file mode 100644 index 0000000000..ed6adfc1cf --- /dev/null +++ b/test/files/neg/t7494-no-options/ploogin_1.scala @@ -0,0 +1,31 @@ + +package t6446 + +import scala.tools.nsc.{ Global, Phase } +import scala.tools.nsc.plugins.{ Plugin, PluginComponent } +import scala.reflect.io.Path +import scala.reflect.io.File + +/** A test plugin. */ +class Ploogin(val global: Global) extends Plugin { + import global._ + + val name = "ploogin" + val description = "A sample plugin for testing." + val components = List[PluginComponent](TestComponent) + + private object TestComponent extends PluginComponent { + val global: Ploogin.this.global.type = Ploogin.this.global + //override val runsBefore = List("refchecks") + val runsAfter = List("jvm") + val phaseName = Ploogin.this.name + override def description = "A sample phase that does so many things it's kind of hard to describe briefly." + def newPhase(prev: Phase) = new TestPhase(prev) + class TestPhase(prev: Phase) extends StdPhase(prev) { + override def description = TestComponent.this.description + def apply(unit: CompilationUnit) { + // kewl kode + } + } + } +} diff --git a/test/files/neg/t7494-no-options/sample_2.flags b/test/files/neg/t7494-no-options/sample_2.flags new file mode 100644 index 0000000000..7f0f7afe48 --- /dev/null +++ b/test/files/neg/t7494-no-options/sample_2.flags @@ -0,0 +1 @@ +-Xplugin:. -Xshow-phases -P:ploogin:inploog diff --git a/test/files/neg/t7494-no-options/sample_2.scala b/test/files/neg/t7494-no-options/sample_2.scala new file mode 100644 index 0000000000..73cdc64e40 --- /dev/null +++ b/test/files/neg/t7494-no-options/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/t7494-no-options/scalac-plugin.xml b/test/files/neg/t7494-no-options/scalac-plugin.xml new file mode 100644 index 0000000000..e849bb5919 --- /dev/null +++ b/test/files/neg/t7494-no-options/scalac-plugin.xml @@ -0,0 +1,4 @@ + +sample-plugin +t6446.Ploogin + diff --git a/test/files/neg/t7494-right-after-before.check b/test/files/neg/t7494-right-after-before.check new file mode 100644 index 0000000000..9b57a7711b --- /dev/null +++ b/test/files/neg/t7494-right-after-before.check @@ -0,0 +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 to better see the problem. diff --git a/test/files/neg/t7494-right-after-before/ThePlugin.scala b/test/files/neg/t7494-right-after-before/ThePlugin.scala new file mode 100644 index 0000000000..81ba85ae80 --- /dev/null +++ b/test/files/neg/t7494-right-after-before/ThePlugin.scala @@ -0,0 +1,31 @@ +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 = "rafter-before-1" + val description = "" + val components = List[PluginComponent](thePhase1) + + private object thePhase1 extends PluginComponent { + val global = ThePlugin.this.global + + val runsAfter = List[String]("refchecks") + override val runsBefore = List[String]("erasure") + val phaseName = ThePlugin.this.name + + def newPhase(prev: Phase) = new ThePhase(prev) + } + + private class ThePhase(prev: Phase) extends Phase(prev) { + def name = ThePlugin.this.name + def run {} + } +} + diff --git a/test/files/neg/t7494-right-after-before/sample_2.flags b/test/files/neg/t7494-right-after-before/sample_2.flags new file mode 100644 index 0000000000..97d0f5b5f6 --- /dev/null +++ b/test/files/neg/t7494-right-after-before/sample_2.flags @@ -0,0 +1 @@ +-Xplugin:. -Xplugin-require:rafter-before-1 diff --git a/test/files/neg/t7494-right-after-before/sample_2.scala b/test/files/neg/t7494-right-after-before/sample_2.scala new file mode 100644 index 0000000000..73cdc64e40 --- /dev/null +++ b/test/files/neg/t7494-right-after-before/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/t7494-right-after-before/scalac-plugin.xml b/test/files/neg/t7494-right-after-before/scalac-plugin.xml new file mode 100644 index 0000000000..2558d6fd03 --- /dev/null +++ b/test/files/neg/t7494-right-after-before/scalac-plugin.xml @@ -0,0 +1,5 @@ + + ignored + scala.test.plugins.ThePlugin + + diff --git a/test/files/neg/t7494-right-after-terminal.check b/test/files/neg/t7494-right-after-terminal.check new file mode 100644 index 0000000000..6fe4f63c82 --- /dev/null +++ b/test/files/neg/t7494-right-after-terminal.check @@ -0,0 +1,2 @@ +error: [phase assembly, right after dependency on terminal phase not allowed: rightafterterminal => terminal] +one error found diff --git a/test/files/neg/t7494-right-after-terminal/ThePlugin.scala b/test/files/neg/t7494-right-after-terminal/ThePlugin.scala new file mode 100644 index 0000000000..9d6d30b327 --- /dev/null +++ b/test/files/neg/t7494-right-after-terminal/ThePlugin.scala @@ -0,0 +1,32 @@ +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 = "rightafterterminal" + val description = "Declares one plugin that wants to be right after the terminal phase" + val components = List[PluginComponent](thePhase) + + private object thePhase extends PluginComponent { + val global = ThePlugin.this.global + + val runsAfter = List[String]() + override val runsRightAfter = Some("terminal") + + val phaseName = ThePlugin.this.name + + def newPhase(prev: Phase) = new ThePhase(prev) + } + + private class ThePhase(prev: Phase) extends Phase(prev) { + def name = ThePlugin.this.name + def run {} + } +} + diff --git a/test/files/neg/t7494-right-after-terminal/sample_2.flags b/test/files/neg/t7494-right-after-terminal/sample_2.flags new file mode 100644 index 0000000000..da046ba5f1 --- /dev/null +++ b/test/files/neg/t7494-right-after-terminal/sample_2.flags @@ -0,0 +1 @@ +-Xplugin:. -Xplugin-require:rightafterterminal diff --git a/test/files/neg/t7494-right-after-terminal/sample_2.scala b/test/files/neg/t7494-right-after-terminal/sample_2.scala new file mode 100644 index 0000000000..73cdc64e40 --- /dev/null +++ b/test/files/neg/t7494-right-after-terminal/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/t7494-right-after-terminal/scalac-plugin.xml b/test/files/neg/t7494-right-after-terminal/scalac-plugin.xml new file mode 100644 index 0000000000..2558d6fd03 --- /dev/null +++ b/test/files/neg/t7494-right-after-terminal/scalac-plugin.xml @@ -0,0 +1,5 @@ + + ignored + scala.test.plugins.ThePlugin + + diff --git a/test/pending/neg/plugin-after-terminal.check b/test/pending/neg/plugin-after-terminal.check deleted file mode 100644 index 096efe09cd..0000000000 --- a/test/pending/neg/plugin-after-terminal.check +++ /dev/null @@ -1,2 +0,0 @@ -error: [phase assembly, after dependency on terminal phase not allowed: afterterminal => terminal] -one error found diff --git a/test/pending/neg/plugin-after-terminal.flags b/test/pending/neg/plugin-after-terminal.flags deleted file mode 100644 index 6a44376213..0000000000 --- a/test/pending/neg/plugin-after-terminal.flags +++ /dev/null @@ -1,2 +0,0 @@ --Xplugin:files/neg/plugin-after-terminal/lib/plugins.jar - diff --git a/test/pending/neg/plugin-after-terminal/lib/plugins.jar.desired.sha1 b/test/pending/neg/plugin-after-terminal/lib/plugins.jar.desired.sha1 deleted file mode 100644 index 3e382f3a12..0000000000 --- a/test/pending/neg/plugin-after-terminal/lib/plugins.jar.desired.sha1 +++ /dev/null @@ -1 +0,0 @@ -f174c50c4363c492362a05c72dd45b0da18fdcd8 ?plugins.jar diff --git a/test/pending/neg/plugin-after-terminal/misc/build.sh b/test/pending/neg/plugin-after-terminal/misc/build.sh deleted file mode 100755 index 8899009d7f..0000000000 --- a/test/pending/neg/plugin-after-terminal/misc/build.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/bash - -SCALAC="../../../../build/pack/bin/scalac -deprecation -cp ../../../../build/quick/classes/compiler/" - -BASE=`pwd` - -if [[ -d "${BASE}/src" ]] ; then - - mkdir -p build - ${SCALAC} -d build src/*.scala - jar cf lib/plugins.jar -C misc/ scalac-plugin.xml -C build . - rm -rf build -fi - diff --git a/test/pending/neg/plugin-after-terminal/misc/scalac-plugin.xml b/test/pending/neg/plugin-after-terminal/misc/scalac-plugin.xml deleted file mode 100644 index 90ff27dc2a..0000000000 --- a/test/pending/neg/plugin-after-terminal/misc/scalac-plugin.xml +++ /dev/null @@ -1,5 +0,0 @@ - - beforeparser - scala.test.plugins.ThePlugin - - diff --git a/test/pending/neg/plugin-after-terminal/src/ThePlugin.scala b/test/pending/neg/plugin-after-terminal/src/ThePlugin.scala deleted file mode 100644 index 2a4607392f..0000000000 --- a/test/pending/neg/plugin-after-terminal/src/ThePlugin.scala +++ /dev/null @@ -1,31 +0,0 @@ -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 = "afterterminal" - val description = "Declares one plugin that wants to be after the terminal phase" - val components = List[PluginComponent](thePhase) - - private object thePhase extends PluginComponent { - val global = ThePlugin.this.global - - val runsAfter = List[String]("terminal") - - val phaseName = ThePlugin.this.name - - def newPhase(prev: Phase) = new ThePhase(prev) - } - - private class ThePhase(prev: Phase) extends Phase(prev) { - def name = ThePlugin.this.name - def run {} - } -} - diff --git a/test/pending/neg/plugin-after-terminal/testsource.scala b/test/pending/neg/plugin-after-terminal/testsource.scala deleted file mode 100644 index 519d162fdf..0000000000 --- a/test/pending/neg/plugin-after-terminal/testsource.scala +++ /dev/null @@ -1,4 +0,0 @@ -object Test extends Application { - println("afterterminal") -} - diff --git a/test/pending/neg/plugin-before-parser.check b/test/pending/neg/plugin-before-parser.check deleted file mode 100644 index 9a407923b1..0000000000 --- a/test/pending/neg/plugin-before-parser.check +++ /dev/null @@ -1,2 +0,0 @@ -error: [phase assembly, before dependency on parser phase not allowed: parser => beforeparser] -one error found diff --git a/test/pending/neg/plugin-before-parser.flags b/test/pending/neg/plugin-before-parser.flags deleted file mode 100644 index 632530922c..0000000000 --- a/test/pending/neg/plugin-before-parser.flags +++ /dev/null @@ -1,2 +0,0 @@ --Xplugin:files/neg/plugin-before-parser/lib/plugins.jar - diff --git a/test/pending/neg/plugin-before-parser/lib/plugins.jar.desired.sha1 b/test/pending/neg/plugin-before-parser/lib/plugins.jar.desired.sha1 deleted file mode 100644 index e82eed76ce..0000000000 --- a/test/pending/neg/plugin-before-parser/lib/plugins.jar.desired.sha1 +++ /dev/null @@ -1 +0,0 @@ -d7b100ad483484b598b7cd643424bd2e33898a0d ?plugins.jar diff --git a/test/pending/neg/plugin-before-parser/misc/build.sh b/test/pending/neg/plugin-before-parser/misc/build.sh deleted file mode 100755 index 8899009d7f..0000000000 --- a/test/pending/neg/plugin-before-parser/misc/build.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/bash - -SCALAC="../../../../build/pack/bin/scalac -deprecation -cp ../../../../build/quick/classes/compiler/" - -BASE=`pwd` - -if [[ -d "${BASE}/src" ]] ; then - - mkdir -p build - ${SCALAC} -d build src/*.scala - jar cf lib/plugins.jar -C misc/ scalac-plugin.xml -C build . - rm -rf build -fi - diff --git a/test/pending/neg/plugin-before-parser/misc/scalac-plugin.xml b/test/pending/neg/plugin-before-parser/misc/scalac-plugin.xml deleted file mode 100644 index 90ff27dc2a..0000000000 --- a/test/pending/neg/plugin-before-parser/misc/scalac-plugin.xml +++ /dev/null @@ -1,5 +0,0 @@ - - beforeparser - scala.test.plugins.ThePlugin - - diff --git a/test/pending/neg/plugin-before-parser/src/ThePlugin.scala b/test/pending/neg/plugin-before-parser/src/ThePlugin.scala deleted file mode 100644 index 7ca896650d..0000000000 --- a/test/pending/neg/plugin-before-parser/src/ThePlugin.scala +++ /dev/null @@ -1,32 +0,0 @@ -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 = "beforeparser" - val description = "Declares one plugin that wants to be before the parser phase" - val components = List[PluginComponent](thePhase) - - private object thePhase extends PluginComponent { - val global = ThePlugin.this.global - - val runsAfter = List[String]() - override val runsBefore = List[String]("parser") - - val phaseName = ThePlugin.this.name - - def newPhase(prev: Phase) = new ThePhase(prev) - } - - private class ThePhase(prev: Phase) extends Phase(prev) { - def name = ThePlugin.this.name - def run {} - } -} - diff --git a/test/pending/neg/plugin-before-parser/testsource.scala b/test/pending/neg/plugin-before-parser/testsource.scala deleted file mode 100644 index 9928aaa83c..0000000000 --- a/test/pending/neg/plugin-before-parser/testsource.scala +++ /dev/null @@ -1,4 +0,0 @@ -object Test extends Application { - println("beforeparser") -} - diff --git a/test/pending/neg/plugin-cyclic-dependency.check b/test/pending/neg/plugin-cyclic-dependency.check deleted file mode 100644 index a29bc3f5be..0000000000 --- a/test/pending/neg/plugin-cyclic-dependency.check +++ /dev/null @@ -1,2 +0,0 @@ -error: fatal error: Cycle in compiler phase dependencies detected, phase cyclicdependency1 reacted twice! -one error found diff --git a/test/pending/neg/plugin-cyclic-dependency.flags b/test/pending/neg/plugin-cyclic-dependency.flags deleted file mode 100644 index 8716aaa65f..0000000000 --- a/test/pending/neg/plugin-cyclic-dependency.flags +++ /dev/null @@ -1,2 +0,0 @@ --Xplugin:files/neg/plugin-cyclic-dependency/lib/plugins.jar - diff --git a/test/pending/neg/plugin-cyclic-dependency/lib/plugins.jar.desired.sha1 b/test/pending/neg/plugin-cyclic-dependency/lib/plugins.jar.desired.sha1 deleted file mode 100644 index 7e565e9e61..0000000000 --- a/test/pending/neg/plugin-cyclic-dependency/lib/plugins.jar.desired.sha1 +++ /dev/null @@ -1 +0,0 @@ -7e6be9e33a87194e7061f94f6be115619f91ada2 ?plugins.jar diff --git a/test/pending/neg/plugin-cyclic-dependency/misc/build.sh b/test/pending/neg/plugin-cyclic-dependency/misc/build.sh deleted file mode 100755 index 8899009d7f..0000000000 --- a/test/pending/neg/plugin-cyclic-dependency/misc/build.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/bash - -SCALAC="../../../../build/pack/bin/scalac -deprecation -cp ../../../../build/quick/classes/compiler/" - -BASE=`pwd` - -if [[ -d "${BASE}/src" ]] ; then - - mkdir -p build - ${SCALAC} -d build src/*.scala - jar cf lib/plugins.jar -C misc/ scalac-plugin.xml -C build . - rm -rf build -fi - diff --git a/test/pending/neg/plugin-cyclic-dependency/misc/scalac-plugin.xml b/test/pending/neg/plugin-cyclic-dependency/misc/scalac-plugin.xml deleted file mode 100644 index 90ff27dc2a..0000000000 --- a/test/pending/neg/plugin-cyclic-dependency/misc/scalac-plugin.xml +++ /dev/null @@ -1,5 +0,0 @@ - - beforeparser - scala.test.plugins.ThePlugin - - diff --git a/test/pending/neg/plugin-cyclic-dependency/src/ThePlugin.scala b/test/pending/neg/plugin-cyclic-dependency/src/ThePlugin.scala deleted file mode 100644 index bd94ce60d7..0000000000 --- a/test/pending/neg/plugin-cyclic-dependency/src/ThePlugin.scala +++ /dev/null @@ -1,41 +0,0 @@ -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) - } - - 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) - } - - private class ThePhase(prev: Phase) extends Phase(prev) { - def name = ThePlugin.this.name - def run {} - } -} - diff --git a/test/pending/neg/plugin-cyclic-dependency/testsource.scala b/test/pending/neg/plugin-cyclic-dependency/testsource.scala deleted file mode 100644 index f1513ec9a0..0000000000 --- a/test/pending/neg/plugin-cyclic-dependency/testsource.scala +++ /dev/null @@ -1,4 +0,0 @@ -object Test extends Application { - println("cyclicdependency") -} - diff --git a/test/pending/neg/plugin-multiple-rafter.check b/test/pending/neg/plugin-multiple-rafter.check deleted file mode 100644 index c54f884feb..0000000000 --- a/test/pending/neg/plugin-multiple-rafter.check +++ /dev/null @@ -1,4 +0,0 @@ -error: fatal error: Multiple phases want to run right after the phase explicitouter -Phases: erasure, multi-rafter, -Re-run with -Xgenerate-phase-graph to better see the problem. -one error found diff --git a/test/pending/neg/plugin-multiple-rafter.flags b/test/pending/neg/plugin-multiple-rafter.flags deleted file mode 100644 index dcae7f2f96..0000000000 --- a/test/pending/neg/plugin-multiple-rafter.flags +++ /dev/null @@ -1,2 +0,0 @@ --Xplugin:files/neg/plugin-multiple-rafter/lib/plugins.jar - diff --git a/test/pending/neg/plugin-multiple-rafter/lib/plugins.jar.desired.sha1 b/test/pending/neg/plugin-multiple-rafter/lib/plugins.jar.desired.sha1 deleted file mode 100644 index f4905fcbd4..0000000000 --- a/test/pending/neg/plugin-multiple-rafter/lib/plugins.jar.desired.sha1 +++ /dev/null @@ -1 +0,0 @@ -2bda582b574287429ad5ee2e1d9a3effc88b0a5f ?plugins.jar diff --git a/test/pending/neg/plugin-multiple-rafter/misc/build.sh b/test/pending/neg/plugin-multiple-rafter/misc/build.sh deleted file mode 100755 index 8899009d7f..0000000000 --- a/test/pending/neg/plugin-multiple-rafter/misc/build.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/bash - -SCALAC="../../../../build/pack/bin/scalac -deprecation -cp ../../../../build/quick/classes/compiler/" - -BASE=`pwd` - -if [[ -d "${BASE}/src" ]] ; then - - mkdir -p build - ${SCALAC} -d build src/*.scala - jar cf lib/plugins.jar -C misc/ scalac-plugin.xml -C build . - rm -rf build -fi - diff --git a/test/pending/neg/plugin-multiple-rafter/misc/scalac-plugin.xml b/test/pending/neg/plugin-multiple-rafter/misc/scalac-plugin.xml deleted file mode 100644 index 90ff27dc2a..0000000000 --- a/test/pending/neg/plugin-multiple-rafter/misc/scalac-plugin.xml +++ /dev/null @@ -1,5 +0,0 @@ - - beforeparser - scala.test.plugins.ThePlugin - - diff --git a/test/pending/neg/plugin-multiple-rafter/src/ThePlugin.scala b/test/pending/neg/plugin-multiple-rafter/src/ThePlugin.scala deleted file mode 100644 index 819176fa88..0000000000 --- a/test/pending/neg/plugin-multiple-rafter/src/ThePlugin.scala +++ /dev/null @@ -1,31 +0,0 @@ -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-rafter" - val description = "" - val components = List[PluginComponent](thePhase) - - private object thePhase extends PluginComponent { - val global = ThePlugin.this.global - - val runsAfter = List[String]() - override val runsRightAfter = Some("explicitouter") - val phaseName = ThePlugin.this.name - - def newPhase(prev: Phase) = new ThePhase(prev) - } - - private class ThePhase(prev: Phase) extends Phase(prev) { - def name = ThePlugin.this.name - def run {} - } -} - diff --git a/test/pending/neg/plugin-multiple-rafter/testsource.scala b/test/pending/neg/plugin-multiple-rafter/testsource.scala deleted file mode 100644 index f73db1eb60..0000000000 --- a/test/pending/neg/plugin-multiple-rafter/testsource.scala +++ /dev/null @@ -1,4 +0,0 @@ -object Test extends Application { - println("multi-rafter") -} - diff --git a/test/pending/neg/plugin-rafter-before-1.check b/test/pending/neg/plugin-rafter-before-1.check deleted file mode 100644 index 19ed4d2fba..0000000000 --- a/test/pending/neg/plugin-rafter-before-1.check +++ /dev/null @@ -1,2 +0,0 @@ -error: fatal error: phase erasure want to run right after explicitouter, but some phase has declared to run before erasure. Re-run with -Xgenerate-phase-graph to better see the problem. -one error found diff --git a/test/pending/neg/plugin-rafter-before-1.flags b/test/pending/neg/plugin-rafter-before-1.flags deleted file mode 100644 index 8bf03145b9..0000000000 --- a/test/pending/neg/plugin-rafter-before-1.flags +++ /dev/null @@ -1,2 +0,0 @@ --Xplugin:files/neg/plugin-rafter-before-1/lib/plugins.jar - diff --git a/test/pending/neg/plugin-rafter-before-1/lib/plugins.jar.desired.sha1 b/test/pending/neg/plugin-rafter-before-1/lib/plugins.jar.desired.sha1 deleted file mode 100644 index 8ad591b6ea..0000000000 --- a/test/pending/neg/plugin-rafter-before-1/lib/plugins.jar.desired.sha1 +++ /dev/null @@ -1 +0,0 @@ -af91fd67ccef349e7f8ea662615e17796a339485 ?plugins.jar diff --git a/test/pending/neg/plugin-rafter-before-1/misc/build.sh b/test/pending/neg/plugin-rafter-before-1/misc/build.sh deleted file mode 100755 index 8899009d7f..0000000000 --- a/test/pending/neg/plugin-rafter-before-1/misc/build.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/bash - -SCALAC="../../../../build/pack/bin/scalac -deprecation -cp ../../../../build/quick/classes/compiler/" - -BASE=`pwd` - -if [[ -d "${BASE}/src" ]] ; then - - mkdir -p build - ${SCALAC} -d build src/*.scala - jar cf lib/plugins.jar -C misc/ scalac-plugin.xml -C build . - rm -rf build -fi - diff --git a/test/pending/neg/plugin-rafter-before-1/misc/scalac-plugin.xml b/test/pending/neg/plugin-rafter-before-1/misc/scalac-plugin.xml deleted file mode 100644 index 90ff27dc2a..0000000000 --- a/test/pending/neg/plugin-rafter-before-1/misc/scalac-plugin.xml +++ /dev/null @@ -1,5 +0,0 @@ - - beforeparser - scala.test.plugins.ThePlugin - - diff --git a/test/pending/neg/plugin-rafter-before-1/src/ThePlugin.scala b/test/pending/neg/plugin-rafter-before-1/src/ThePlugin.scala deleted file mode 100644 index 81ba85ae80..0000000000 --- a/test/pending/neg/plugin-rafter-before-1/src/ThePlugin.scala +++ /dev/null @@ -1,31 +0,0 @@ -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 = "rafter-before-1" - val description = "" - val components = List[PluginComponent](thePhase1) - - private object thePhase1 extends PluginComponent { - val global = ThePlugin.this.global - - val runsAfter = List[String]("refchecks") - override val runsBefore = List[String]("erasure") - val phaseName = ThePlugin.this.name - - def newPhase(prev: Phase) = new ThePhase(prev) - } - - private class ThePhase(prev: Phase) extends Phase(prev) { - def name = ThePlugin.this.name - def run {} - } -} - diff --git a/test/pending/neg/plugin-rafter-before-1/testsource.scala b/test/pending/neg/plugin-rafter-before-1/testsource.scala deleted file mode 100644 index 836459db22..0000000000 --- a/test/pending/neg/plugin-rafter-before-1/testsource.scala +++ /dev/null @@ -1,4 +0,0 @@ -object Test extends Application { - println("rafter-before-1") -} - diff --git a/test/pending/neg/plugin-rightafter-terminal.check b/test/pending/neg/plugin-rightafter-terminal.check deleted file mode 100644 index 6fe4f63c82..0000000000 --- a/test/pending/neg/plugin-rightafter-terminal.check +++ /dev/null @@ -1,2 +0,0 @@ -error: [phase assembly, right after dependency on terminal phase not allowed: rightafterterminal => terminal] -one error found diff --git a/test/pending/neg/plugin-rightafter-terminal.flags b/test/pending/neg/plugin-rightafter-terminal.flags deleted file mode 100644 index 948a318668..0000000000 --- a/test/pending/neg/plugin-rightafter-terminal.flags +++ /dev/null @@ -1,2 +0,0 @@ --Xplugin:files/neg/plugin-rightafter-terminal/lib/plugins.jar - diff --git a/test/pending/neg/plugin-rightafter-terminal/lib/plugins.jar.desired.sha1 b/test/pending/neg/plugin-rightafter-terminal/lib/plugins.jar.desired.sha1 deleted file mode 100644 index c2e2b9cd43..0000000000 --- a/test/pending/neg/plugin-rightafter-terminal/lib/plugins.jar.desired.sha1 +++ /dev/null @@ -1 +0,0 @@ -8cccde4914da2058dca893783c231cda23855603 ?plugins.jar diff --git a/test/pending/neg/plugin-rightafter-terminal/misc/build.sh b/test/pending/neg/plugin-rightafter-terminal/misc/build.sh deleted file mode 100755 index 8899009d7f..0000000000 --- a/test/pending/neg/plugin-rightafter-terminal/misc/build.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/bash - -SCALAC="../../../../build/pack/bin/scalac -deprecation -cp ../../../../build/quick/classes/compiler/" - -BASE=`pwd` - -if [[ -d "${BASE}/src" ]] ; then - - mkdir -p build - ${SCALAC} -d build src/*.scala - jar cf lib/plugins.jar -C misc/ scalac-plugin.xml -C build . - rm -rf build -fi - diff --git a/test/pending/neg/plugin-rightafter-terminal/misc/scalac-plugin.xml b/test/pending/neg/plugin-rightafter-terminal/misc/scalac-plugin.xml deleted file mode 100644 index 90ff27dc2a..0000000000 --- a/test/pending/neg/plugin-rightafter-terminal/misc/scalac-plugin.xml +++ /dev/null @@ -1,5 +0,0 @@ - - beforeparser - scala.test.plugins.ThePlugin - - diff --git a/test/pending/neg/plugin-rightafter-terminal/src/ThePlugin.scala b/test/pending/neg/plugin-rightafter-terminal/src/ThePlugin.scala deleted file mode 100644 index 9d6d30b327..0000000000 --- a/test/pending/neg/plugin-rightafter-terminal/src/ThePlugin.scala +++ /dev/null @@ -1,32 +0,0 @@ -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 = "rightafterterminal" - val description = "Declares one plugin that wants to be right after the terminal phase" - val components = List[PluginComponent](thePhase) - - private object thePhase extends PluginComponent { - val global = ThePlugin.this.global - - val runsAfter = List[String]() - override val runsRightAfter = Some("terminal") - - val phaseName = ThePlugin.this.name - - def newPhase(prev: Phase) = new ThePhase(prev) - } - - private class ThePhase(prev: Phase) extends Phase(prev) { - def name = ThePlugin.this.name - def run {} - } -} - diff --git a/test/pending/neg/plugin-rightafter-terminal/testsource.scala b/test/pending/neg/plugin-rightafter-terminal/testsource.scala deleted file mode 100644 index 7af767b638..0000000000 --- a/test/pending/neg/plugin-rightafter-terminal/testsource.scala +++ /dev/null @@ -1,4 +0,0 @@ -object Test extends Application { - println("rightafterterminal") -} - diff --git a/test/pending/neg/t7494-cyclic-dependency/ThePlugin.scala b/test/pending/neg/t7494-cyclic-dependency/ThePlugin.scala new file mode 100644 index 0000000000..bd94ce60d7 --- /dev/null +++ b/test/pending/neg/t7494-cyclic-dependency/ThePlugin.scala @@ -0,0 +1,41 @@ +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) + } + + 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) + } + + private class ThePhase(prev: Phase) extends Phase(prev) { + def name = ThePlugin.this.name + def run {} + } +} + diff --git a/test/pending/neg/t7494-cyclic-dependency/sample_2.flags b/test/pending/neg/t7494-cyclic-dependency/sample_2.flags new file mode 100644 index 0000000000..db25b88a12 --- /dev/null +++ b/test/pending/neg/t7494-cyclic-dependency/sample_2.flags @@ -0,0 +1 @@ +-Xplugin:. -Xplugin-require:cyclicdependency diff --git a/test/pending/neg/t7494-cyclic-dependency/sample_2.scala b/test/pending/neg/t7494-cyclic-dependency/sample_2.scala new file mode 100644 index 0000000000..73cdc64e40 --- /dev/null +++ b/test/pending/neg/t7494-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/pending/neg/t7494-cyclic-dependency/scalac-plugin.xml b/test/pending/neg/t7494-cyclic-dependency/scalac-plugin.xml new file mode 100644 index 0000000000..2558d6fd03 --- /dev/null +++ b/test/pending/neg/t7494-cyclic-dependency/scalac-plugin.xml @@ -0,0 +1,5 @@ + + ignored + scala.test.plugins.ThePlugin + + -- cgit v1.2.3