All tests for TCO moved to box (with diagnostics marked up)

This commit is contained in:
Andrey Breslav
2013-12-06 11:08:29 +04:00
parent 1849643e52
commit 71be3bcec5
19 changed files with 205 additions and 97 deletions
@@ -1,4 +0,0 @@
// !DIAGNOSTICS: -UNUSED_PARAMETER
tailRecursive fun Int.foo(x: Int) {
return 1.foo(2)
}
@@ -1,3 +0,0 @@
<!NO_TAIL_CALLS_FOUND!>tailRecursive fun noTails()<!> {
// nothing here
}
@@ -1,12 +0,0 @@
tailRecursive fun badTails(x : Int) : Int {
if (x > 0) {
return 1 + <!NON_TAIL_RECURSIVE_CALL!>badTails<!>(x - 1)
}
else if (x == 10) {
[suppress("NON_TAIL_RECURSIVE_CALL")]
return 1 + badTails(x - 1)
} else if (x == 50) {
return badTails(x - 1)
}
return 0
}
@@ -1,6 +0,0 @@
fun withoutAnnotation(x : Int) : Int {
if (x > 0) {
return 1 + withoutAnnotation(x - 1)
}
return 0
}
@@ -1,4 +0,0 @@
// !DIAGNOSTICS: -UNUSED_PARAMETER
tailRecursive fun Int.foo(x: Int) {
return 1 foo 2
}
@@ -1,8 +0,0 @@
// !DIAGNOSTICS: -UNUSED_PARAMETER
<!NO_TAIL_CALLS_FOUND!>tailRecursive fun foo()<!> {
run {
<!NON_TAIL_RECURSIVE_CALL!>foo<!>()
}
}
fun run(a: Any) {}
@@ -1,5 +0,0 @@
<!NO_TAIL_CALLS_FOUND!>tailRecursive fun foo()<!> {
fun bar() {
<!NON_TAIL_RECURSIVE_CALL!>foo<!>()
}
}
@@ -1,3 +0,0 @@
tailRecursive fun foo() {
(return foo())
}
@@ -1,6 +0,0 @@
tailRecursive fun foo() {
return if (true) {
(foo())
}
else Unit.VALUE
}
@@ -1,3 +0,0 @@
tailRecursive fun foo() {
return (foo())
}
@@ -1,9 +0,0 @@
<!NO_TAIL_CALLS_FOUND!>tailRecursive fun test() : Unit<!> {
try {
<!TAIL_RECURSION_IN_TRY_IS_NOT_SUPPORTED!>test<!>()
} catch (any : Exception) {
<!TAIL_RECURSION_IN_TRY_IS_NOT_SUPPORTED!>test<!>()
} finally {
<!TAIL_RECURSION_IN_TRY_IS_NOT_SUPPORTED!>test<!>()
}
}