diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/files/continuations-run/t5314.check | 4 | ||||
-rw-r--r-- | test/files/continuations-run/t5314.scala | 11 |
2 files changed, 15 insertions, 0 deletions
diff --git a/test/files/continuations-run/t5314.check b/test/files/continuations-run/t5314.check index 4951e7caae..4b35d8e6d0 100644 --- a/test/files/continuations-run/t5314.check +++ b/test/files/continuations-run/t5314.check @@ -1,3 +1,7 @@ +7 +7 +7 +8 8 hi 8 diff --git a/test/files/continuations-run/t5314.scala b/test/files/continuations-run/t5314.scala index 0bdea19824..d611016ce4 100644 --- a/test/files/continuations-run/t5314.scala +++ b/test/files/continuations-run/t5314.scala @@ -29,6 +29,17 @@ object Test extends App { def nocps(x: Int): Int = { return x; x } + def foo2(x:Int): Int @cps[Int] = 7 + def bar2(x:Int): Int @cps[Int] = { foo2(x); return 7 } + def bar3(x:Int): Int @cps[Int] = { foo2(x); if (x == 7) return 7 else return foo2(x) } + def bar4(x:Int): Int @cps[Int] = { foo2(x); if (x == 7) return 7 else foo2(x) } + def bar5(x:Int): Int @cps[Int] = { foo2(x); if (x == 7) return 7 else 8 } + println(reset { bar2(10) }) + println(reset { bar3(10) }) + println(reset { bar4(10) }) + println(reset { bar5(10) }) + + /* original test case */ val repro = new ReturnRepro repro.caller repro.caller2 |