summaryrefslogtreecommitdiff
path: root/test/files/run
diff options
context:
space:
mode:
Diffstat (limited to 'test/files/run')
-rw-r--r--test/files/run/macro-quasiquotes.check4
-rw-r--r--test/files/run/macro-quasiquotes/Macros_1.scala15
-rw-r--r--test/files/run/macro-quasiquotes/Test_2.scala5
3 files changed, 24 insertions, 0 deletions
diff --git a/test/files/run/macro-quasiquotes.check b/test/files/run/macro-quasiquotes.check
new file mode 100644
index 0000000000..94ebaf9001
--- /dev/null
+++ b/test/files/run/macro-quasiquotes.check
@@ -0,0 +1,4 @@
+1
+2
+3
+4
diff --git a/test/files/run/macro-quasiquotes/Macros_1.scala b/test/files/run/macro-quasiquotes/Macros_1.scala
new file mode 100644
index 0000000000..b64eec8743
--- /dev/null
+++ b/test/files/run/macro-quasiquotes/Macros_1.scala
@@ -0,0 +1,15 @@
+import language.experimental.macros
+import scala.reflect.macros.Macro
+
+trait Impls extends Macro {
+ import c.universe._
+ def impl1 = q"println(1)"
+ def impl2 = q"{ println(2); println(3) }"
+ def impl3 = q"4"
+}
+
+object Macros {
+ def m1 = macro Impls.impl1
+ def m2 = macro Impls.impl2
+ def m3 = macro Impls.impl3
+} \ No newline at end of file
diff --git a/test/files/run/macro-quasiquotes/Test_2.scala b/test/files/run/macro-quasiquotes/Test_2.scala
new file mode 100644
index 0000000000..4be193938f
--- /dev/null
+++ b/test/files/run/macro-quasiquotes/Test_2.scala
@@ -0,0 +1,5 @@
+object Test extends App {
+ Macros.m1
+ Macros.m2
+ println(Macros.m3)
+}