diff options
author | Lukas Rytz <lukas.rytz@typesafe.com> | 2016-01-26 06:59:23 +0100 |
---|---|---|
committer | Lukas Rytz <lukas.rytz@typesafe.com> | 2016-01-26 06:59:23 +0100 |
commit | ef77a5497a64f4fa870e830e9114bd00db269452 (patch) | |
tree | 4ce0d9afde8d2c44e0920d276661b0e57ca6d6bb /test/pending/run/t5313.scala | |
parent | 90ee1b871236402f8543bf424a4f38d909598b3a (diff) | |
parent | 983894f24b6c79934af757173d9e44faecd34069 (diff) | |
download | scala-ef77a5497a64f4fa870e830e9114bd00db269452.tar.gz scala-ef77a5497a64f4fa870e830e9114bd00db269452.tar.bz2 scala-ef77a5497a64f4fa870e830e9114bd00db269452.zip |
Merge pull request #4916 from lrytz/restoreASMTests
Restore backend tests that were removed together with GenASM
Diffstat (limited to 'test/pending/run/t5313.scala')
-rw-r--r-- | test/pending/run/t5313.scala | 54 |
1 files changed, 0 insertions, 54 deletions
diff --git a/test/pending/run/t5313.scala b/test/pending/run/t5313.scala deleted file mode 100644 index 4a5b076e6e..0000000000 --- a/test/pending/run/t5313.scala +++ /dev/null @@ -1,54 +0,0 @@ -import scala.tools.partest.IcodeComparison - -object Test extends IcodeComparison { - override def printIcodeAfterPhase = "dce" - - override def extraSettings: String = super.extraSettings + " -Yopt:l:classpath" - - override def code = - """class Foo { - def randomBoolean = scala.util.Random.nextInt % 2 == 0 - def bar = { - var kept1 = new Object - val result = new java.lang.ref.WeakReference(kept1) - kept1 = null // we can't eliminate this assignment because result can observe - // when the object has no more references. See SI-5313 - kept1 = new Object // but we can eliminate this one because kept1 has already been clobbered - var erased2 = null // we can eliminate this store because it's never used - val erased3 = erased2 // and this - var erased4 = erased2 // and this - val erased5 = erased4 // and this - var kept2: Object = new Object // ultimately can't be eliminated - while(randomBoolean) { - val kept3 = kept2 - kept2 = null // this can't, because it clobbers kept2, which is used - erased4 = null // safe to eliminate - println(kept3) - } - var kept4 = new Object // have to keep, it's used - try - println(kept4) - catch { - case _ : Throwable => kept4 = null // have to keep, it clobbers kept4 which is used - } - var kept5 = new Object - print(kept5) - kept5 = null // can't eliminate it's a clobber and it's used - print(kept5) - kept5 = null // can eliminate because we don't care about clobbers of nulls - while(randomBoolean) { - var kept6: AnyRef = null // not used, but have to keep because it clobbers the next used store - // on the back edge of the loop - kept6 = new Object // used - println(kept6) - } - result - } - }""".stripMargin - - override def show() { - val storeLocal = "STORE_LOCAL" - val lines1 = collectIcode() filter (_ contains storeLocal) map (x => x.drop(x.indexOf(storeLocal))) - println(lines1 mkString "\n") - } -} |