Skip to content

Commit d06276e

Browse files
committed
Split run test to avoid timeouts
1 parent 618e5de commit d06276e

File tree

8 files changed

+76
-55
lines changed

8 files changed

+76
-55
lines changed

tests/run-with-compiler/i3876-b.check

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
6
2+
{
3+
val x$1: Int = 3
4+
{
5+
def f(x: Int): Int = x.+(x)
6+
f(x$1)
7+
}
8+
}

tests/run-with-compiler/i3876-b.scala

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import dotty.tools.dotc.quoted.Runners._
2+
import scala.quoted._
3+
object Test {
4+
def main(args: Array[String]): Unit = {
5+
val x: Expr[Int] = '(3)
6+
7+
val f2: Expr[Int => Int] = '{
8+
def f(x: Int): Int = x + x
9+
f
10+
}
11+
println(f2(x).run)
12+
println(f2(x).show)
13+
}
14+
}

tests/run-with-compiler/i3876-c.check

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
6
2+
{
3+
val x$1: Int = 3
4+
{
5+
val f:
6+
Function1[Int, Int]
7+
{
8+
def apply(x: Int): Int
9+
}
10+
=
11+
{
12+
(x: Int) => x.+(x)
13+
}
14+
(f: (x: Int) => Int).apply(x$1)
15+
}
16+
}

tests/run-with-compiler/i3876-c.scala

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import dotty.tools.dotc.quoted.Runners._
2+
import scala.quoted._
3+
object Test {
4+
def main(args: Array[String]): Unit = {
5+
val x: Expr[Int] = '(3)
6+
7+
val f3: Expr[Int => Int] = '{
8+
val f: (x: Int) => Int = x => x + x
9+
f
10+
}
11+
println(f3(x).run)
12+
println(f3(x).show) // TODO improve printer
13+
}
14+
}

tests/run-with-compiler/i3876-d.check

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
6
2+
{
3+
val x$1: Int = 3
4+
/* inlined from Test*/
5+
{
6+
x$1.+(x$1)
7+
}
8+
}

tests/run-with-compiler/i3876-d.scala

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import dotty.tools.dotc.quoted.Runners._
2+
import scala.quoted._
3+
object Test {
4+
def main(args: Array[String]): Unit = {
5+
val x: Expr[Int] = '(3)
6+
7+
val f4: Expr[Int => Int] = '{
8+
inlineLambda
9+
}
10+
println(f4(x).run)
11+
println(f4(x).show)
12+
}
13+
14+
inline def inlineLambda: Int => Int = x => x + x
15+
}

tests/run-with-compiler/i3876.check

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -5,35 +5,3 @@
55
x$1.+(x$1)
66
}
77
}
8-
6
9-
{
10-
val x$1: Int = 3
11-
{
12-
def f(x: Int): Int = x.+(x)
13-
f(x$1)
14-
}
15-
}
16-
6
17-
{
18-
val x$1: Int = 3
19-
{
20-
val f:
21-
Function1[Int, Int]
22-
{
23-
def apply(x: Int): Int
24-
}
25-
=
26-
{
27-
(x: Int) => x.+(x)
28-
}
29-
(f: (x: Int) => Int).apply(x$1)
30-
}
31-
}
32-
6
33-
{
34-
val x$1: Int = 3
35-
/* inlined from Test*/
36-
{
37-
x$1.+(x$1)
38-
}
39-
}

tests/run-with-compiler/i3876.scala

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -7,27 +7,5 @@ object Test {
77
val f: Expr[Int => Int] = '{ (x: Int) => x + x }
88
println(f(x).run)
99
println(f(x).show)
10-
11-
val f2: Expr[Int => Int] = '{
12-
def f(x: Int): Int = x + x
13-
f
14-
}
15-
println(f2(x).run)
16-
println(f2(x).show)
17-
18-
val f3: Expr[Int => Int] = '{
19-
val f: (x: Int) => Int = x => x + x
20-
f
21-
}
22-
println(f3(x).run)
23-
println(f3(x).show) // TODO improve printer
24-
25-
val f4: Expr[Int => Int] = '{
26-
inlineLambda
27-
}
28-
println(f4(x).run)
29-
println(f4(x).show)
3010
}
31-
32-
inline def inlineLambda: Int => Int = x => x + x
33-
}
11+
}

0 commit comments

Comments
 (0)