summaryrefslogtreecommitdiff
path: root/test/files/specialized/SI-5005.check
diff options
context:
space:
mode:
authorErik Osheim <d_m@plastic-idolatry.com>2012-02-15 18:21:38 -0500
committerErik Osheim <d_m@plastic-idolatry.com>2012-02-15 18:21:38 -0500
commit423360f597e20483307457686cee213e089cdd32 (patch)
tree76270f5c7161ea68cfe2e535d1675c3e0985fc9b /test/files/specialized/SI-5005.check
parente4b5c002b12e17150740283619e12fd6dfab5442 (diff)
downloadscala-423360f597e20483307457686cee213e089cdd32.tar.gz
scala-423360f597e20483307457686cee213e089cdd32.tar.bz2
scala-423360f597e20483307457686cee213e089cdd32.zip
Added test files to verify previous commit.
Tests scalac -optimize -Xprint:specialize -Ylog:inliner output to verify that final/@inline + specialization are being handled correctly (that is, the original class' specialized methods should not be final/@inline, but its specialized subclass' should be). This test was written by Vlad Ureche based on the bug report in SI-5005.
Diffstat (limited to 'test/files/specialized/SI-5005.check')
-rw-r--r--test/files/specialized/SI-5005.check33
1 files changed, 33 insertions, 0 deletions
diff --git a/test/files/specialized/SI-5005.check b/test/files/specialized/SI-5005.check
new file mode 100644
index 0000000000..d2a97512ae
--- /dev/null
+++ b/test/files/specialized/SI-5005.check
@@ -0,0 +1,33 @@
+[[syntax trees at end of specialize]]// Scala source: newSource1
+package <empty> {
+ class C2[@specialized(scala.Boolean) U >: Nothing <: Any] extends Object with ScalaObject {
+ def <init>(): C2[U] = {
+ C2.super.<init>();
+ ()
+ };
+ def apply(x: U): U = x;
+ <specialized> def apply$mcZ$sp(x: Boolean): Boolean = C2.this.apply(x.asInstanceOf[U]()).asInstanceOf[Boolean]()
+ };
+ class B extends Object with ScalaObject {
+ def <init>(): B = {
+ B.super.<init>();
+ ()
+ };
+ new C2$mcZ$sp().apply$mcZ$sp(true)
+ };
+ <specialized> class C2$mcZ$sp extends C2[Boolean] {
+ <specialized> def <init>(): C2$mcZ$sp = {
+ C2$mcZ$sp.super.<init>();
+ ()
+ };
+ @inline final override <specialized> def apply(x: Boolean): Boolean = C2$mcZ$sp.this.apply$mcZ$sp(x);
+ @inline final override <specialized> def apply$mcZ$sp(x: Boolean): Boolean = x
+ }
+}
+
+[log inliner] Analyzing C2.apply count 0 with 1 blocks
+[log inliner] C2.apply blocks before inlining: 1 (2) after: 1 (2)
+[log inliner] Analyzing C2.apply$mcZ$sp count 0 with 1 blocks
+[log inliner] C2.apply$mcZ$sp blocks before inlining: 1 (8) after: 1 (8)
+[log inliner] Not inlining into apply because it is marked @inline.
+[log inliner] Not inlining into apply$mcZ$sp because it is marked @inline.