summaryrefslogtreecommitdiff
path: root/test/files/instrumented/indy-symbol-literal.scala
diff options
context:
space:
mode:
Diffstat (limited to 'test/files/instrumented/indy-symbol-literal.scala')
-rw-r--r--test/files/instrumented/indy-symbol-literal.scala19
1 files changed, 19 insertions, 0 deletions
diff --git a/test/files/instrumented/indy-symbol-literal.scala b/test/files/instrumented/indy-symbol-literal.scala
new file mode 100644
index 0000000000..a1c333cf95
--- /dev/null
+++ b/test/files/instrumented/indy-symbol-literal.scala
@@ -0,0 +1,19 @@
+import scala.tools.partest.instrumented._
+import scala.tools.partest.instrumented.Instrumentation._
+
+object Test {
+ def main(args: Array[String]): Unit = {
+ 'warmup
+ startProfiling()
+ var i = 0;
+ while (i < 2) {
+ 'foo.name
+ i += 1
+ }
+ stopProfiling()
+ // Only expect a single call to lookup the interned Symbol at each call site the defines
+ // a single literal.
+ val Symbol_apply = MethodCallTrace("scala/Symbol$", "apply", "(Ljava/lang/String;)Lscala/Symbol;")
+ assert(getStatistics.get(Symbol_apply) == Some(1), getStatistics);
+ }
+}