diff --git a/compiler/testData/codegen/box/diagnostics/functions/tailRecursion/defaultArgs.kt b/compiler/testData/codegen/box/diagnostics/functions/tailRecursion/defaultArgs.kt index b4f8f9f77d7..77551daaaf2 100644 --- a/compiler/testData/codegen/box/diagnostics/functions/tailRecursion/defaultArgs.kt +++ b/compiler/testData/codegen/box/diagnostics/functions/tailRecursion/defaultArgs.kt @@ -1,3 +1,5 @@ +// IGNORE_BACKEND_WITHOUT_CHECK: JS + tailrec fun test(x : Int = 0, e : Any = "a") { if (!e.equals("a")) { throw IllegalArgumentException() diff --git a/compiler/testData/codegen/box/diagnostics/functions/tailRecursion/defaultArgsOverridden.kt b/compiler/testData/codegen/box/diagnostics/functions/tailRecursion/defaultArgsOverridden.kt index 38f8e9b602b..2f924b56908 100644 --- a/compiler/testData/codegen/box/diagnostics/functions/tailRecursion/defaultArgsOverridden.kt +++ b/compiler/testData/codegen/box/diagnostics/functions/tailRecursion/defaultArgsOverridden.kt @@ -1,5 +1,5 @@ // TODO: muted automatically, investigate should it be ran for JS or not -// IGNORE_BACKEND: JS +// IGNORE_BACKEND_WITHOUT_CHECK: JS open class A { open fun foo(s: String = "OK") = s diff --git a/compiler/testData/codegen/box/diagnostics/functions/tailRecursion/extensionTailCall.kt b/compiler/testData/codegen/box/diagnostics/functions/tailRecursion/extensionTailCall.kt index ca069b14ab2..e9873fc4a14 100644 --- a/compiler/testData/codegen/box/diagnostics/functions/tailRecursion/extensionTailCall.kt +++ b/compiler/testData/codegen/box/diagnostics/functions/tailRecursion/extensionTailCall.kt @@ -1,4 +1,7 @@ // !DIAGNOSTICS: -UNUSED_PARAMETER + +// IGNORE_BACKEND_WITHOUT_CHECK: JS + tailrec fun Int.foo(x: Int) { if (x == 0) return return 1.foo(x - 1) diff --git a/compiler/testData/codegen/box/diagnostics/functions/tailRecursion/functionWithNoTails.kt b/compiler/testData/codegen/box/diagnostics/functions/tailRecursion/functionWithNoTails.kt index f116c53ebea..15eb0203244 100644 --- a/compiler/testData/codegen/box/diagnostics/functions/tailRecursion/functionWithNoTails.kt +++ b/compiler/testData/codegen/box/diagnostics/functions/tailRecursion/functionWithNoTails.kt @@ -1,5 +1,5 @@ // TODO: muted automatically, investigate should it be ran for JS or not -// IGNORE_BACKEND: JS +// IGNORE_BACKEND_WITHOUT_CHECK: JS tailrec fun noTails() { // nothing here diff --git a/compiler/testData/codegen/box/diagnostics/functions/tailRecursion/functionWithNonTailRecursions.kt b/compiler/testData/codegen/box/diagnostics/functions/tailRecursion/functionWithNonTailRecursions.kt index c5ddfea03c1..c6b15a3234d 100644 --- a/compiler/testData/codegen/box/diagnostics/functions/tailRecursion/functionWithNonTailRecursions.kt +++ b/compiler/testData/codegen/box/diagnostics/functions/tailRecursion/functionWithNonTailRecursions.kt @@ -1,5 +1,5 @@ // TODO: muted automatically, investigate should it be ran for JS or not -// IGNORE_BACKEND: JS +// IGNORE_BACKEND_WITHOUT_CHECK: JS tailrec fun badTails(x : Int) : Int { if (x < 50 && x != 10 && x > 0) { diff --git a/compiler/testData/codegen/box/diagnostics/functions/tailRecursion/functionWithoutAnnotation.kt b/compiler/testData/codegen/box/diagnostics/functions/tailRecursion/functionWithoutAnnotation.kt index 5bc754515e2..06b569df4d4 100644 --- a/compiler/testData/codegen/box/diagnostics/functions/tailRecursion/functionWithoutAnnotation.kt +++ b/compiler/testData/codegen/box/diagnostics/functions/tailRecursion/functionWithoutAnnotation.kt @@ -1,3 +1,5 @@ +// IGNORE_BACKEND_WITHOUT_CHECK: JS + fun withoutAnnotation(x : Int) : Int { if (x > 0) { return 1 + withoutAnnotation(x - 1) diff --git a/compiler/testData/codegen/box/diagnostics/functions/tailRecursion/infixCall.kt b/compiler/testData/codegen/box/diagnostics/functions/tailRecursion/infixCall.kt index edf0b6bdee0..4642b88c175 100644 --- a/compiler/testData/codegen/box/diagnostics/functions/tailRecursion/infixCall.kt +++ b/compiler/testData/codegen/box/diagnostics/functions/tailRecursion/infixCall.kt @@ -1,3 +1,5 @@ +// IGNORE_BACKEND_WITHOUT_CHECK: JS + tailrec infix fun Int.test(x : Int) : Int { if (this > 1) { return (this - 1) test x diff --git a/compiler/testData/codegen/box/diagnostics/functions/tailRecursion/infixRecursiveCall.kt b/compiler/testData/codegen/box/diagnostics/functions/tailRecursion/infixRecursiveCall.kt index c533885426b..09212b1ad4b 100644 --- a/compiler/testData/codegen/box/diagnostics/functions/tailRecursion/infixRecursiveCall.kt +++ b/compiler/testData/codegen/box/diagnostics/functions/tailRecursion/infixRecursiveCall.kt @@ -1,4 +1,7 @@ // !DIAGNOSTICS: -UNUSED_PARAMETER + +// IGNORE_BACKEND_WITHOUT_CHECK: JS + tailrec infix fun Int.foo(x: Int) { if (x == 0) return val xx = x - 1 diff --git a/compiler/testData/codegen/box/diagnostics/functions/tailRecursion/insideElvis.kt b/compiler/testData/codegen/box/diagnostics/functions/tailRecursion/insideElvis.kt index b7252819658..d758897bde5 100644 --- a/compiler/testData/codegen/box/diagnostics/functions/tailRecursion/insideElvis.kt +++ b/compiler/testData/codegen/box/diagnostics/functions/tailRecursion/insideElvis.kt @@ -1,5 +1,5 @@ // TODO: muted automatically, investigate should it be ran for JS or not -// IGNORE_BACKEND: JS +// IGNORE_BACKEND_WITHOUT_CHECK: JS tailrec fun test(counter : Int) : Int? { if (counter < 0) return null diff --git a/compiler/testData/codegen/box/diagnostics/functions/tailRecursion/labeledThisReferences.kt b/compiler/testData/codegen/box/diagnostics/functions/tailRecursion/labeledThisReferences.kt index 59fdc5594ee..307a0163bca 100644 --- a/compiler/testData/codegen/box/diagnostics/functions/tailRecursion/labeledThisReferences.kt +++ b/compiler/testData/codegen/box/diagnostics/functions/tailRecursion/labeledThisReferences.kt @@ -1,7 +1,7 @@ // !DIAGNOSTICS: -UNUSED_PARAMETER // TODO: muted automatically, investigate should it be ran for JS or not -// IGNORE_BACKEND: JS +// IGNORE_BACKEND_WITHOUT_CHECK: JS class B { inner class C { diff --git a/compiler/testData/codegen/box/diagnostics/functions/tailRecursion/loops.kt b/compiler/testData/codegen/box/diagnostics/functions/tailRecursion/loops.kt index 5a2ce4b4467..0eac7241a86 100644 --- a/compiler/testData/codegen/box/diagnostics/functions/tailRecursion/loops.kt +++ b/compiler/testData/codegen/box/diagnostics/functions/tailRecursion/loops.kt @@ -1,5 +1,5 @@ // TODO: muted automatically, investigate should it be ran for JS or not -// IGNORE_BACKEND: JS +// IGNORE_BACKEND_WITHOUT_CHECK: JS tailrec fun test(x : Int) : Int { var z = if (x > 3) 3 else x diff --git a/compiler/testData/codegen/box/diagnostics/functions/tailRecursion/multilevelBlocks.kt b/compiler/testData/codegen/box/diagnostics/functions/tailRecursion/multilevelBlocks.kt index 19b1f095cf4..597ca8dd231 100644 --- a/compiler/testData/codegen/box/diagnostics/functions/tailRecursion/multilevelBlocks.kt +++ b/compiler/testData/codegen/box/diagnostics/functions/tailRecursion/multilevelBlocks.kt @@ -1,5 +1,5 @@ // TODO: muted automatically, investigate should it be ran for JS or not -// IGNORE_BACKEND: JS +// IGNORE_BACKEND_WITHOUT_CHECK: JS tailrec fun test(x : Int) : Int { if (x == 1) { diff --git a/compiler/testData/codegen/box/diagnostics/functions/tailRecursion/realIteratorFoldl.kt b/compiler/testData/codegen/box/diagnostics/functions/tailRecursion/realIteratorFoldl.kt index 702e96c8355..a4523b4320d 100644 --- a/compiler/testData/codegen/box/diagnostics/functions/tailRecursion/realIteratorFoldl.kt +++ b/compiler/testData/codegen/box/diagnostics/functions/tailRecursion/realIteratorFoldl.kt @@ -1,5 +1,5 @@ // TODO: muted automatically, investigate should it be ran for JS or not -// IGNORE_BACKEND: JS +// IGNORE_BACKEND_WITHOUT_CHECK: JS tailrec fun Iterator.foldl(acc : A, foldFunction : (e : T, acc : A) -> A) : A = if (!hasNext()) acc diff --git a/compiler/testData/codegen/box/diagnostics/functions/tailRecursion/realStringEscape.kt b/compiler/testData/codegen/box/diagnostics/functions/tailRecursion/realStringEscape.kt index 00c6818a8ff..f78c458a8e6 100644 --- a/compiler/testData/codegen/box/diagnostics/functions/tailRecursion/realStringEscape.kt +++ b/compiler/testData/codegen/box/diagnostics/functions/tailRecursion/realStringEscape.kt @@ -1,3 +1,5 @@ +// IGNORE_BACKEND_WITHOUT_CHECK: JS + fun escapeChar(c : Char) : String? = when (c) { '\\' -> "\\\\" '\n' -> "\\n" diff --git a/compiler/testData/codegen/box/diagnostics/functions/tailRecursion/realStringRepeat.kt b/compiler/testData/codegen/box/diagnostics/functions/tailRecursion/realStringRepeat.kt index 5cfd4e59e17..2772ef3c3a2 100644 --- a/compiler/testData/codegen/box/diagnostics/functions/tailRecursion/realStringRepeat.kt +++ b/compiler/testData/codegen/box/diagnostics/functions/tailRecursion/realStringRepeat.kt @@ -1,3 +1,5 @@ +// IGNORE_BACKEND_WITHOUT_CHECK: JS + tailrec fun String.repeat(num : Int, acc : StringBuilder = StringBuilder()) : String = if (num == 0) acc.toString() else repeat(num - 1, acc.append(this)) diff --git a/compiler/testData/codegen/box/diagnostics/functions/tailRecursion/recursiveCallInLambda.kt b/compiler/testData/codegen/box/diagnostics/functions/tailRecursion/recursiveCallInLambda.kt index d148c954514..e53fc49a214 100644 --- a/compiler/testData/codegen/box/diagnostics/functions/tailRecursion/recursiveCallInLambda.kt +++ b/compiler/testData/codegen/box/diagnostics/functions/tailRecursion/recursiveCallInLambda.kt @@ -1,7 +1,7 @@ // !DIAGNOSTICS: -UNUSED_PARAMETER // TODO: muted automatically, investigate should it be ran for JS or not -// IGNORE_BACKEND: JS +// IGNORE_BACKEND_WITHOUT_CHECK: JS tailrec fun foo() { bar { diff --git a/compiler/testData/codegen/box/diagnostics/functions/tailRecursion/recursiveCallInLocalFunction.kt b/compiler/testData/codegen/box/diagnostics/functions/tailRecursion/recursiveCallInLocalFunction.kt index 98c5aafaea5..c6e5fe2a79f 100644 --- a/compiler/testData/codegen/box/diagnostics/functions/tailRecursion/recursiveCallInLocalFunction.kt +++ b/compiler/testData/codegen/box/diagnostics/functions/tailRecursion/recursiveCallInLocalFunction.kt @@ -1,5 +1,5 @@ // TODO: muted automatically, investigate should it be ran for JS or not -// IGNORE_BACKEND: JS +// IGNORE_BACKEND_WITHOUT_CHECK: JS tailrec fun foo() { fun bar() { diff --git a/compiler/testData/codegen/box/diagnostics/functions/tailRecursion/recursiveInnerFunction.kt b/compiler/testData/codegen/box/diagnostics/functions/tailRecursion/recursiveInnerFunction.kt index c4c96bd2097..cf6ac28a2b1 100644 --- a/compiler/testData/codegen/box/diagnostics/functions/tailRecursion/recursiveInnerFunction.kt +++ b/compiler/testData/codegen/box/diagnostics/functions/tailRecursion/recursiveInnerFunction.kt @@ -1,3 +1,5 @@ +// IGNORE_BACKEND_WITHOUT_CHECK: JS + fun test() { tailrec fun g3(counter : Int) { if (counter > 0) { g3(counter - 1) } diff --git a/compiler/testData/codegen/box/diagnostics/functions/tailRecursion/returnIf.kt b/compiler/testData/codegen/box/diagnostics/functions/tailRecursion/returnIf.kt index 332c91be471..f974aac542d 100644 --- a/compiler/testData/codegen/box/diagnostics/functions/tailRecursion/returnIf.kt +++ b/compiler/testData/codegen/box/diagnostics/functions/tailRecursion/returnIf.kt @@ -1,5 +1,5 @@ // TODO: muted automatically, investigate should it be ran for JS or not -// IGNORE_BACKEND: JS +// IGNORE_BACKEND_WITHOUT_CHECK: JS tailrec fun test(x : Int) : Int { return if (x == 1) { diff --git a/compiler/testData/codegen/box/diagnostics/functions/tailRecursion/returnInCatch.kt b/compiler/testData/codegen/box/diagnostics/functions/tailRecursion/returnInCatch.kt index 91ff5b9cf3c..94541e9b0ad 100644 --- a/compiler/testData/codegen/box/diagnostics/functions/tailRecursion/returnInCatch.kt +++ b/compiler/testData/codegen/box/diagnostics/functions/tailRecursion/returnInCatch.kt @@ -1,5 +1,5 @@ // TODO: muted automatically, investigate should it be ran for JS or not -// IGNORE_BACKEND: JS +// IGNORE_BACKEND_WITHOUT_CHECK: JS tailrec fun test(counter : Int) : Int { if (counter == 0) return 0 diff --git a/compiler/testData/codegen/box/diagnostics/functions/tailRecursion/returnInFinally.kt b/compiler/testData/codegen/box/diagnostics/functions/tailRecursion/returnInFinally.kt index d8684d39bf3..37c8bde1bd5 100644 --- a/compiler/testData/codegen/box/diagnostics/functions/tailRecursion/returnInFinally.kt +++ b/compiler/testData/codegen/box/diagnostics/functions/tailRecursion/returnInFinally.kt @@ -1,5 +1,5 @@ // TODO: muted automatically, investigate should it be ran for JS or not -// IGNORE_BACKEND: JS +// IGNORE_BACKEND_WITHOUT_CHECK: JS tailrec fun test(counter : Int) : Int { if (counter == 0) return 0 diff --git a/compiler/testData/codegen/box/diagnostics/functions/tailRecursion/returnInIfInFinally.kt b/compiler/testData/codegen/box/diagnostics/functions/tailRecursion/returnInIfInFinally.kt index cfa6f0a94a1..a91a01c4007 100644 --- a/compiler/testData/codegen/box/diagnostics/functions/tailRecursion/returnInIfInFinally.kt +++ b/compiler/testData/codegen/box/diagnostics/functions/tailRecursion/returnInIfInFinally.kt @@ -1,5 +1,5 @@ // TODO: muted automatically, investigate should it be ran for JS or not -// IGNORE_BACKEND: JS +// IGNORE_BACKEND_WITHOUT_CHECK: JS tailrec fun test(counter : Int) : Int { if (counter == 0) return 0 diff --git a/compiler/testData/codegen/box/diagnostics/functions/tailRecursion/returnInParentheses.kt b/compiler/testData/codegen/box/diagnostics/functions/tailRecursion/returnInParentheses.kt index 27b5f92f913..6a05a80c18d 100644 --- a/compiler/testData/codegen/box/diagnostics/functions/tailRecursion/returnInParentheses.kt +++ b/compiler/testData/codegen/box/diagnostics/functions/tailRecursion/returnInParentheses.kt @@ -1,3 +1,5 @@ +// IGNORE_BACKEND_WITHOUT_CHECK: JS + tailrec fun foo(x: Int) { if (x == 0) return (return foo(x - 1)) diff --git a/compiler/testData/codegen/box/diagnostics/functions/tailRecursion/returnInTry.kt b/compiler/testData/codegen/box/diagnostics/functions/tailRecursion/returnInTry.kt index f5854cd758a..f3c225f251e 100644 --- a/compiler/testData/codegen/box/diagnostics/functions/tailRecursion/returnInTry.kt +++ b/compiler/testData/codegen/box/diagnostics/functions/tailRecursion/returnInTry.kt @@ -1,5 +1,5 @@ // TODO: muted automatically, investigate should it be ran for JS or not -// IGNORE_BACKEND: JS +// IGNORE_BACKEND_WITHOUT_CHECK: JS tailrec fun test(counter : Int) : Int { if (counter == 0) return 0 diff --git a/compiler/testData/codegen/box/diagnostics/functions/tailRecursion/simpleBlock.kt b/compiler/testData/codegen/box/diagnostics/functions/tailRecursion/simpleBlock.kt index be6e58fccf8..7d2cf67bd63 100644 --- a/compiler/testData/codegen/box/diagnostics/functions/tailRecursion/simpleBlock.kt +++ b/compiler/testData/codegen/box/diagnostics/functions/tailRecursion/simpleBlock.kt @@ -1,5 +1,5 @@ // TODO: muted automatically, investigate should it be ran for JS or not -// IGNORE_BACKEND: JS +// IGNORE_BACKEND_WITHOUT_CHECK: JS tailrec fun test(x : Int) : Int = if (x == 1) { diff --git a/compiler/testData/codegen/box/diagnostics/functions/tailRecursion/simpleReturn.kt b/compiler/testData/codegen/box/diagnostics/functions/tailRecursion/simpleReturn.kt index 6e7156da7a0..497f0456cf8 100644 --- a/compiler/testData/codegen/box/diagnostics/functions/tailRecursion/simpleReturn.kt +++ b/compiler/testData/codegen/box/diagnostics/functions/tailRecursion/simpleReturn.kt @@ -1,5 +1,5 @@ // TODO: muted automatically, investigate should it be ran for JS or not -// IGNORE_BACKEND: JS +// IGNORE_BACKEND_WITHOUT_CHECK: JS tailrec fun test(x : Int) : Int { if (x == 10) { diff --git a/compiler/testData/codegen/box/diagnostics/functions/tailRecursion/simpleReturnWithElse.kt b/compiler/testData/codegen/box/diagnostics/functions/tailRecursion/simpleReturnWithElse.kt index bcafc83eb02..5e41e54a3cb 100644 --- a/compiler/testData/codegen/box/diagnostics/functions/tailRecursion/simpleReturnWithElse.kt +++ b/compiler/testData/codegen/box/diagnostics/functions/tailRecursion/simpleReturnWithElse.kt @@ -1,5 +1,5 @@ // TODO: muted automatically, investigate should it be ran for JS or not -// IGNORE_BACKEND: JS +// IGNORE_BACKEND_WITHOUT_CHECK: JS tailrec fun test(x : Int) : Int { if (x == 0) { diff --git a/compiler/testData/codegen/box/diagnostics/functions/tailRecursion/sum.kt b/compiler/testData/codegen/box/diagnostics/functions/tailRecursion/sum.kt index da2054d3358..461f09c5ec1 100644 --- a/compiler/testData/codegen/box/diagnostics/functions/tailRecursion/sum.kt +++ b/compiler/testData/codegen/box/diagnostics/functions/tailRecursion/sum.kt @@ -1,5 +1,5 @@ // TODO: muted automatically, investigate should it be ran for JS or not -// IGNORE_BACKEND: JS +// IGNORE_BACKEND_WITHOUT_CHECK: JS tailrec fun sum(x: Long, sum: Long): Long { if (x == 0.toLong()) return sum diff --git a/compiler/testData/codegen/box/diagnostics/functions/tailRecursion/tailCallInBlockInParentheses.kt b/compiler/testData/codegen/box/diagnostics/functions/tailRecursion/tailCallInBlockInParentheses.kt index e413deef2d1..92fd0bf3ffb 100644 --- a/compiler/testData/codegen/box/diagnostics/functions/tailRecursion/tailCallInBlockInParentheses.kt +++ b/compiler/testData/codegen/box/diagnostics/functions/tailRecursion/tailCallInBlockInParentheses.kt @@ -1,3 +1,5 @@ +// IGNORE_BACKEND_WITHOUT_CHECK: JS + tailrec fun foo(x: Int) { return if (x > 0) { (foo(x - 1)) diff --git a/compiler/testData/codegen/box/diagnostics/functions/tailRecursion/tailCallInParentheses.kt b/compiler/testData/codegen/box/diagnostics/functions/tailRecursion/tailCallInParentheses.kt index 4cd6b0c0716..d0c54318be0 100644 --- a/compiler/testData/codegen/box/diagnostics/functions/tailRecursion/tailCallInParentheses.kt +++ b/compiler/testData/codegen/box/diagnostics/functions/tailRecursion/tailCallInParentheses.kt @@ -1,3 +1,5 @@ +// IGNORE_BACKEND_WITHOUT_CHECK: JS + tailrec fun foo(x: Int) { if (x == 0) return return (foo(x - 1)) diff --git a/compiler/testData/codegen/box/diagnostics/functions/tailRecursion/tailRecursionInFinally.kt b/compiler/testData/codegen/box/diagnostics/functions/tailRecursion/tailRecursionInFinally.kt index 1fb8b6ec5df..a69c34bd44c 100644 --- a/compiler/testData/codegen/box/diagnostics/functions/tailRecursion/tailRecursionInFinally.kt +++ b/compiler/testData/codegen/box/diagnostics/functions/tailRecursion/tailRecursionInFinally.kt @@ -1,5 +1,5 @@ // TODO: muted automatically, investigate should it be ran for JS or not -// IGNORE_BACKEND: JS +// IGNORE_BACKEND_WITHOUT_CHECK: JS tailrec fun test(go: Boolean) : Unit { if (!go) return diff --git a/compiler/testData/codegen/box/diagnostics/functions/tailRecursion/thisReferences.kt b/compiler/testData/codegen/box/diagnostics/functions/tailRecursion/thisReferences.kt index b3884ce3c91..b067a3c5717 100644 --- a/compiler/testData/codegen/box/diagnostics/functions/tailRecursion/thisReferences.kt +++ b/compiler/testData/codegen/box/diagnostics/functions/tailRecursion/thisReferences.kt @@ -1,5 +1,5 @@ // TODO: muted automatically, investigate should it be ran for JS or not -// IGNORE_BACKEND: JS +// IGNORE_BACKEND_WITHOUT_CHECK: JS class A { tailrec fun f1(c : Int) { diff --git a/compiler/testData/codegen/box/diagnostics/functions/tailRecursion/unitBlocks.kt b/compiler/testData/codegen/box/diagnostics/functions/tailRecursion/unitBlocks.kt index 7ffbfb65d3f..9324f76ad43 100644 --- a/compiler/testData/codegen/box/diagnostics/functions/tailRecursion/unitBlocks.kt +++ b/compiler/testData/codegen/box/diagnostics/functions/tailRecursion/unitBlocks.kt @@ -1,5 +1,5 @@ // TODO: muted automatically, investigate should it be ran for JS or not -// IGNORE_BACKEND: JS +// IGNORE_BACKEND_WITHOUT_CHECK: JS tailrec fun test(x : Int) : Unit { if (x == 1) { diff --git a/compiler/testData/codegen/box/diagnostics/functions/tailRecursion/whenWithCondition.kt b/compiler/testData/codegen/box/diagnostics/functions/tailRecursion/whenWithCondition.kt index 89a1db63801..c87fb69a91e 100644 --- a/compiler/testData/codegen/box/diagnostics/functions/tailRecursion/whenWithCondition.kt +++ b/compiler/testData/codegen/box/diagnostics/functions/tailRecursion/whenWithCondition.kt @@ -1,5 +1,5 @@ // TODO: muted automatically, investigate should it be ran for JS or not -// IGNORE_BACKEND: JS +// IGNORE_BACKEND_WITHOUT_CHECK: JS tailrec fun withWhen(counter : Int) : Int = when (counter) { diff --git a/compiler/testData/codegen/box/diagnostics/functions/tailRecursion/whenWithInRange.kt b/compiler/testData/codegen/box/diagnostics/functions/tailRecursion/whenWithInRange.kt index 6a66c51ad80..9ceaf639f08 100644 --- a/compiler/testData/codegen/box/diagnostics/functions/tailRecursion/whenWithInRange.kt +++ b/compiler/testData/codegen/box/diagnostics/functions/tailRecursion/whenWithInRange.kt @@ -1,7 +1,7 @@ // !DIAGNOSTICS: -UNUSED_PARAMETER // TODO: muted automatically, investigate should it be ran for JS or not -// IGNORE_BACKEND: JS +// IGNORE_BACKEND_WITHOUT_CHECK: JS tailrec fun withWhen(counter : Int, d : Any) : Int = when (counter) { diff --git a/compiler/testData/codegen/box/diagnostics/functions/tailRecursion/whenWithIs.kt b/compiler/testData/codegen/box/diagnostics/functions/tailRecursion/whenWithIs.kt index 45be5ef4ec1..d86ee798725 100644 --- a/compiler/testData/codegen/box/diagnostics/functions/tailRecursion/whenWithIs.kt +++ b/compiler/testData/codegen/box/diagnostics/functions/tailRecursion/whenWithIs.kt @@ -1,3 +1,5 @@ +// IGNORE_BACKEND_WITHOUT_CHECK: JS + tailrec fun withWhen(counter : Int, d : Any) : Int = if (counter == 0) { 0 diff --git a/compiler/testData/codegen/box/diagnostics/functions/tailRecursion/whenWithoutCondition.kt b/compiler/testData/codegen/box/diagnostics/functions/tailRecursion/whenWithoutCondition.kt index 8a61cb75630..154371bacee 100644 --- a/compiler/testData/codegen/box/diagnostics/functions/tailRecursion/whenWithoutCondition.kt +++ b/compiler/testData/codegen/box/diagnostics/functions/tailRecursion/whenWithoutCondition.kt @@ -1,5 +1,5 @@ // TODO: muted automatically, investigate should it be ran for JS or not -// IGNORE_BACKEND: JS +// IGNORE_BACKEND_WITHOUT_CHECK: JS tailrec fun withWhen2(counter : Int) : Int = when { diff --git a/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/JsCodegenBoxTestGenerated.java b/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/JsCodegenBoxTestGenerated.java index c3552900130..957bc6b4f67 100644 --- a/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/JsCodegenBoxTestGenerated.java +++ b/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/JsCodegenBoxTestGenerated.java @@ -7595,380 +7595,230 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest { @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) public static class TailRecursion extends AbstractJsCodegenBoxTest { - public void testAllFilesPresentInTailRecursion() throws Exception { - KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/diagnostics/functions/tailRecursion"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JS, true); - } - @TestMetadata("defaultArgs.kt") - public void testDefaultArgs() throws Exception { + public void ignoreDefaultArgs() throws Exception { String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/diagnostics/functions/tailRecursion/defaultArgs.kt"); doTest(fileName); } @TestMetadata("defaultArgsOverridden.kt") - public void testDefaultArgsOverridden() throws Exception { + public void ignoreDefaultArgsOverridden() throws Exception { String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/diagnostics/functions/tailRecursion/defaultArgsOverridden.kt"); - try { - doTest(fileName); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + doTest(fileName); } @TestMetadata("extensionTailCall.kt") - public void testExtensionTailCall() throws Exception { + public void ignoreExtensionTailCall() throws Exception { String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/diagnostics/functions/tailRecursion/extensionTailCall.kt"); doTest(fileName); } @TestMetadata("functionWithNoTails.kt") - public void testFunctionWithNoTails() throws Exception { + public void ignoreFunctionWithNoTails() throws Exception { String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/diagnostics/functions/tailRecursion/functionWithNoTails.kt"); - try { - doTest(fileName); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + doTest(fileName); } @TestMetadata("functionWithNonTailRecursions.kt") - public void testFunctionWithNonTailRecursions() throws Exception { + public void ignoreFunctionWithNonTailRecursions() throws Exception { String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/diagnostics/functions/tailRecursion/functionWithNonTailRecursions.kt"); - try { - doTest(fileName); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + doTest(fileName); } @TestMetadata("functionWithoutAnnotation.kt") - public void testFunctionWithoutAnnotation() throws Exception { + public void ignoreFunctionWithoutAnnotation() throws Exception { String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/diagnostics/functions/tailRecursion/functionWithoutAnnotation.kt"); doTest(fileName); } @TestMetadata("infixCall.kt") - public void testInfixCall() throws Exception { + public void ignoreInfixCall() throws Exception { String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/diagnostics/functions/tailRecursion/infixCall.kt"); doTest(fileName); } @TestMetadata("infixRecursiveCall.kt") - public void testInfixRecursiveCall() throws Exception { + public void ignoreInfixRecursiveCall() throws Exception { String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/diagnostics/functions/tailRecursion/infixRecursiveCall.kt"); doTest(fileName); } @TestMetadata("insideElvis.kt") - public void testInsideElvis() throws Exception { + public void ignoreInsideElvis() throws Exception { String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/diagnostics/functions/tailRecursion/insideElvis.kt"); - try { - doTest(fileName); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + doTest(fileName); } @TestMetadata("labeledThisReferences.kt") - public void testLabeledThisReferences() throws Exception { + public void ignoreLabeledThisReferences() throws Exception { String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/diagnostics/functions/tailRecursion/labeledThisReferences.kt"); - try { - doTest(fileName); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + doTest(fileName); } @TestMetadata("loops.kt") - public void testLoops() throws Exception { + public void ignoreLoops() throws Exception { String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/diagnostics/functions/tailRecursion/loops.kt"); - try { - doTest(fileName); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + doTest(fileName); } @TestMetadata("multilevelBlocks.kt") - public void testMultilevelBlocks() throws Exception { + public void ignoreMultilevelBlocks() throws Exception { String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/diagnostics/functions/tailRecursion/multilevelBlocks.kt"); - try { - doTest(fileName); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + doTest(fileName); } @TestMetadata("realIteratorFoldl.kt") - public void testRealIteratorFoldl() throws Exception { + public void ignoreRealIteratorFoldl() throws Exception { String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/diagnostics/functions/tailRecursion/realIteratorFoldl.kt"); - try { - doTest(fileName); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + doTest(fileName); } @TestMetadata("realStringEscape.kt") - public void testRealStringEscape() throws Exception { + public void ignoreRealStringEscape() throws Exception { String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/diagnostics/functions/tailRecursion/realStringEscape.kt"); doTest(fileName); } @TestMetadata("realStringRepeat.kt") - public void testRealStringRepeat() throws Exception { + public void ignoreRealStringRepeat() throws Exception { String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/diagnostics/functions/tailRecursion/realStringRepeat.kt"); doTest(fileName); } @TestMetadata("recursiveCallInLambda.kt") - public void testRecursiveCallInLambda() throws Exception { + public void ignoreRecursiveCallInLambda() throws Exception { String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/diagnostics/functions/tailRecursion/recursiveCallInLambda.kt"); - try { - doTest(fileName); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + doTest(fileName); } @TestMetadata("recursiveCallInLocalFunction.kt") - public void testRecursiveCallInLocalFunction() throws Exception { + public void ignoreRecursiveCallInLocalFunction() throws Exception { String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/diagnostics/functions/tailRecursion/recursiveCallInLocalFunction.kt"); - try { - doTest(fileName); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + doTest(fileName); } @TestMetadata("recursiveInnerFunction.kt") - public void testRecursiveInnerFunction() throws Exception { + public void ignoreRecursiveInnerFunction() throws Exception { String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/diagnostics/functions/tailRecursion/recursiveInnerFunction.kt"); doTest(fileName); } @TestMetadata("returnIf.kt") - public void testReturnIf() throws Exception { + public void ignoreReturnIf() throws Exception { String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/diagnostics/functions/tailRecursion/returnIf.kt"); - try { - doTest(fileName); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + doTest(fileName); } @TestMetadata("returnInCatch.kt") - public void testReturnInCatch() throws Exception { + public void ignoreReturnInCatch() throws Exception { String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/diagnostics/functions/tailRecursion/returnInCatch.kt"); - try { - doTest(fileName); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + doTest(fileName); } @TestMetadata("returnInFinally.kt") - public void testReturnInFinally() throws Exception { + public void ignoreReturnInFinally() throws Exception { String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/diagnostics/functions/tailRecursion/returnInFinally.kt"); - try { - doTest(fileName); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + doTest(fileName); } @TestMetadata("returnInIfInFinally.kt") - public void testReturnInIfInFinally() throws Exception { + public void ignoreReturnInIfInFinally() throws Exception { String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/diagnostics/functions/tailRecursion/returnInIfInFinally.kt"); - try { - doTest(fileName); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + doTest(fileName); } @TestMetadata("returnInParentheses.kt") - public void testReturnInParentheses() throws Exception { + public void ignoreReturnInParentheses() throws Exception { String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/diagnostics/functions/tailRecursion/returnInParentheses.kt"); doTest(fileName); } @TestMetadata("returnInTry.kt") - public void testReturnInTry() throws Exception { + public void ignoreReturnInTry() throws Exception { String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/diagnostics/functions/tailRecursion/returnInTry.kt"); - try { - doTest(fileName); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + doTest(fileName); } @TestMetadata("simpleBlock.kt") - public void testSimpleBlock() throws Exception { + public void ignoreSimpleBlock() throws Exception { String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/diagnostics/functions/tailRecursion/simpleBlock.kt"); - try { - doTest(fileName); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + doTest(fileName); } @TestMetadata("simpleReturn.kt") - public void testSimpleReturn() throws Exception { + public void ignoreSimpleReturn() throws Exception { String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/diagnostics/functions/tailRecursion/simpleReturn.kt"); - try { - doTest(fileName); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + doTest(fileName); } @TestMetadata("simpleReturnWithElse.kt") - public void testSimpleReturnWithElse() throws Exception { + public void ignoreSimpleReturnWithElse() throws Exception { String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/diagnostics/functions/tailRecursion/simpleReturnWithElse.kt"); - try { - doTest(fileName); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + doTest(fileName); } @TestMetadata("sum.kt") - public void testSum() throws Exception { + public void ignoreSum() throws Exception { String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/diagnostics/functions/tailRecursion/sum.kt"); - try { - doTest(fileName); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + doTest(fileName); } @TestMetadata("tailCallInBlockInParentheses.kt") - public void testTailCallInBlockInParentheses() throws Exception { + public void ignoreTailCallInBlockInParentheses() throws Exception { String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/diagnostics/functions/tailRecursion/tailCallInBlockInParentheses.kt"); doTest(fileName); } @TestMetadata("tailCallInParentheses.kt") - public void testTailCallInParentheses() throws Exception { + public void ignoreTailCallInParentheses() throws Exception { String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/diagnostics/functions/tailRecursion/tailCallInParentheses.kt"); doTest(fileName); } @TestMetadata("tailRecursionInFinally.kt") - public void testTailRecursionInFinally() throws Exception { + public void ignoreTailRecursionInFinally() throws Exception { String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/diagnostics/functions/tailRecursion/tailRecursionInFinally.kt"); - try { - doTest(fileName); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + doTest(fileName); } @TestMetadata("thisReferences.kt") - public void testThisReferences() throws Exception { + public void ignoreThisReferences() throws Exception { String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/diagnostics/functions/tailRecursion/thisReferences.kt"); - try { - doTest(fileName); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + doTest(fileName); } @TestMetadata("unitBlocks.kt") - public void testUnitBlocks() throws Exception { + public void ignoreUnitBlocks() throws Exception { String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/diagnostics/functions/tailRecursion/unitBlocks.kt"); - try { - doTest(fileName); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + doTest(fileName); } @TestMetadata("whenWithCondition.kt") - public void testWhenWithCondition() throws Exception { + public void ignoreWhenWithCondition() throws Exception { String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/diagnostics/functions/tailRecursion/whenWithCondition.kt"); - try { - doTest(fileName); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + doTest(fileName); } @TestMetadata("whenWithInRange.kt") - public void testWhenWithInRange() throws Exception { + public void ignoreWhenWithInRange() throws Exception { String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/diagnostics/functions/tailRecursion/whenWithInRange.kt"); - try { - doTest(fileName); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + doTest(fileName); } @TestMetadata("whenWithIs.kt") - public void testWhenWithIs() throws Exception { + public void ignoreWhenWithIs() throws Exception { String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/diagnostics/functions/tailRecursion/whenWithIs.kt"); doTest(fileName); } @TestMetadata("whenWithoutCondition.kt") - public void testWhenWithoutCondition() throws Exception { + public void ignoreWhenWithoutCondition() throws Exception { String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/diagnostics/functions/tailRecursion/whenWithoutCondition.kt"); - try { - doTest(fileName); - } - catch (Throwable ignore) { - return; - } - throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + doTest(fileName); + } + + public void testAllFilesPresentInTailRecursion() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/diagnostics/functions/tailRecursion"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JS, true); } } }