From 5c6b9b1bc6a8d79631d3f31b3b3479d90394a3bd Mon Sep 17 00:00:00 2001 From: Michael Bogdanov Date: Thu, 29 Jan 2015 15:13:11 +0300 Subject: [PATCH] New smap test --- .../boxInline/smap/anonymous/lambda.1.kt | 46 +++++++++++ .../boxInline/smap/anonymous/lambda.2.kt | 18 +++++ .../smap/anonymous/lambdaOnCallSite.1.kt | 34 ++++++++ .../smap/anonymous/lambdaOnCallSite.2.kt | 7 ++ .../anonymous/lambdaOnInlineCallSite.1.kt | 56 +++++++++++++ .../anonymous/lambdaOnInlineCallSite.2.kt | 7 ++ .../boxInline/smap/anonymous/object.1.kt | 45 +++++++++++ .../boxInline/smap/anonymous/object.2.kt | 21 +++++ .../smap/anonymous/objectOnCallSite.1.kt | 36 +++++++++ .../smap/anonymous/objectOnCallSite.2.kt | 7 ++ .../anonymous/objectOnInlineCallSite.1.kt | 58 ++++++++++++++ .../anonymous/objectOnInlineCallSite.2.kt | 7 ++ .../anonymous/objectOnInlineCallSite2.1.kt | 32 ++++++++ .../anonymous/objectOnInlineCallSite2.2.kt | 42 ++++++++++ .../codegen/boxInline/smap/assertion.1.kt | 25 ++++++ .../codegen/boxInline/smap/assertion.2.kt | 34 ++++++++ .../codegen/boxInline/smap/oneFile.1.kt | 22 +++++ .../codegen/boxInline/smap/oneFile.2.kt | 5 ++ .../testData/codegen/boxInline/smap/smap.1.kt | 38 +++++++++ .../testData/codegen/boxInline/smap/smap.2.kt | 28 +++++++ .../BlackBoxInlineCodegenTestGenerated.java | 80 +++++++++++++++++++ ...otlinAgainstInlineKotlinTestGenerated.java | 80 +++++++++++++++++++ .../tinyApp/outs/stepIntoFromInlineFun.out | 8 ++ .../tinyApp/outs/stepIntoInlineFun.out | 9 +++ .../tinyApp/outs/stepIntoStdLibInlineFun.out | 9 +++ .../stepInto/stepIntoFromInlineFun.kt | 17 ++++ .../stepInto/stepInto/stepIntoInlineFun.kt | 17 ++++ .../stepInto/stepIntoStdLibInlineFun.kt | 11 +++ .../debugger/KotlinSteppingTestGenerated.java | 18 +++++ 29 files changed, 817 insertions(+) create mode 100644 compiler/testData/codegen/boxInline/smap/anonymous/lambda.1.kt create mode 100644 compiler/testData/codegen/boxInline/smap/anonymous/lambda.2.kt create mode 100644 compiler/testData/codegen/boxInline/smap/anonymous/lambdaOnCallSite.1.kt create mode 100644 compiler/testData/codegen/boxInline/smap/anonymous/lambdaOnCallSite.2.kt create mode 100644 compiler/testData/codegen/boxInline/smap/anonymous/lambdaOnInlineCallSite.1.kt create mode 100644 compiler/testData/codegen/boxInline/smap/anonymous/lambdaOnInlineCallSite.2.kt create mode 100644 compiler/testData/codegen/boxInline/smap/anonymous/object.1.kt create mode 100644 compiler/testData/codegen/boxInline/smap/anonymous/object.2.kt create mode 100644 compiler/testData/codegen/boxInline/smap/anonymous/objectOnCallSite.1.kt create mode 100644 compiler/testData/codegen/boxInline/smap/anonymous/objectOnCallSite.2.kt create mode 100644 compiler/testData/codegen/boxInline/smap/anonymous/objectOnInlineCallSite.1.kt create mode 100644 compiler/testData/codegen/boxInline/smap/anonymous/objectOnInlineCallSite.2.kt create mode 100644 compiler/testData/codegen/boxInline/smap/anonymous/objectOnInlineCallSite2.1.kt create mode 100644 compiler/testData/codegen/boxInline/smap/anonymous/objectOnInlineCallSite2.2.kt create mode 100644 compiler/testData/codegen/boxInline/smap/assertion.1.kt create mode 100644 compiler/testData/codegen/boxInline/smap/assertion.2.kt create mode 100644 compiler/testData/codegen/boxInline/smap/oneFile.1.kt create mode 100644 compiler/testData/codegen/boxInline/smap/oneFile.2.kt create mode 100644 compiler/testData/codegen/boxInline/smap/smap.1.kt create mode 100644 compiler/testData/codegen/boxInline/smap/smap.2.kt create mode 100644 idea/testData/debugger/tinyApp/outs/stepIntoFromInlineFun.out create mode 100644 idea/testData/debugger/tinyApp/outs/stepIntoInlineFun.out create mode 100644 idea/testData/debugger/tinyApp/outs/stepIntoStdLibInlineFun.out create mode 100644 idea/testData/debugger/tinyApp/src/stepInto/stepInto/stepIntoFromInlineFun.kt create mode 100644 idea/testData/debugger/tinyApp/src/stepInto/stepInto/stepIntoInlineFun.kt create mode 100644 idea/testData/debugger/tinyApp/src/stepInto/stepInto/stepIntoStdLibInlineFun.kt diff --git a/compiler/testData/codegen/boxInline/smap/anonymous/lambda.1.kt b/compiler/testData/codegen/boxInline/smap/anonymous/lambda.1.kt new file mode 100644 index 00000000000..f00f642ece2 --- /dev/null +++ b/compiler/testData/codegen/boxInline/smap/anonymous/lambda.1.kt @@ -0,0 +1,46 @@ +import builders.* +import kotlin.InlineOption.* + +fun test(): String { + var res = "Fail" + + call { + res = "OK" + } + + return res +} + + +fun box(): String { + return test() +} + + +//SMAP +//lambda.1.kt +//Kotlin +//*S Kotlin +//*F +//+ 1 lambda.1.kt +//_DefaultPackage +//+ 2 lambda.2.kt +//builders/BuildersPackage +//*L +//1#1,46:1 +//4#2:47 +//*E +// +//SMAP +//lambda.2.kt +//Kotlin +//*S Kotlin +//*F +//+ 1 lambda.2.kt +//builders/BuildersPackage$lambda_2$HASH$call$1 +//+ 2 lambda.1.kt +//_DefaultPackage$lambda_1$HASH +//*L +//1#1,18:1 +//8#2:19 +//*E \ No newline at end of file diff --git a/compiler/testData/codegen/boxInline/smap/anonymous/lambda.2.kt b/compiler/testData/codegen/boxInline/smap/anonymous/lambda.2.kt new file mode 100644 index 00000000000..bee5fecd64a --- /dev/null +++ b/compiler/testData/codegen/boxInline/smap/anonymous/lambda.2.kt @@ -0,0 +1,18 @@ +package builders + +inline fun call(inlineOptions(InlineOption.ONLY_LOCAL_RETURN) init: () -> Unit) { + return { + init() + }() +} + +//SMAP +//lambda.2.kt +//Kotlin +//*S Kotlin +//*F +//+ 1 lambda.2.kt +//builders/BuildersPackage$lambda_2$HASH$call$1 +//*L +//1#1,18:1 +//*E \ No newline at end of file diff --git a/compiler/testData/codegen/boxInline/smap/anonymous/lambdaOnCallSite.1.kt b/compiler/testData/codegen/boxInline/smap/anonymous/lambdaOnCallSite.1.kt new file mode 100644 index 00000000000..cba19ffbbdd --- /dev/null +++ b/compiler/testData/codegen/boxInline/smap/anonymous/lambdaOnCallSite.1.kt @@ -0,0 +1,34 @@ +import builders.* +import kotlin.InlineOption.* + +fun test(): String { + var res = "Fail" + + call { + { + res = "OK" + }() + } + + return res +} + + +fun box(): String { + return test() +} + + +//SMAP +//lambdaOnCallSite.1.kt +//Kotlin +//*S Kotlin +//*F +//+ 1 lambdaOnCallSite.1.kt +//_DefaultPackage +//+ 2 lambdaOnCallSite.2.kt +//builders/BuildersPackage +//*L +//1#1,34:1 +//4#2:35 +//*E \ No newline at end of file diff --git a/compiler/testData/codegen/boxInline/smap/anonymous/lambdaOnCallSite.2.kt b/compiler/testData/codegen/boxInline/smap/anonymous/lambdaOnCallSite.2.kt new file mode 100644 index 00000000000..625d4182bbf --- /dev/null +++ b/compiler/testData/codegen/boxInline/smap/anonymous/lambdaOnCallSite.2.kt @@ -0,0 +1,7 @@ +package builders + +inline fun call(inlineOptions(InlineOption.ONLY_LOCAL_RETURN) init: () -> Unit) { + return init() +} + +//SMAP ABSENT diff --git a/compiler/testData/codegen/boxInline/smap/anonymous/lambdaOnInlineCallSite.1.kt b/compiler/testData/codegen/boxInline/smap/anonymous/lambdaOnInlineCallSite.1.kt new file mode 100644 index 00000000000..e6be370a6a5 --- /dev/null +++ b/compiler/testData/codegen/boxInline/smap/anonymous/lambdaOnInlineCallSite.1.kt @@ -0,0 +1,56 @@ +import builders.* +import kotlin.InlineOption.* + +inline fun test(): String { + var res = "Fail" + + call { + { + res = "OK" + }() + } + + return res +} + + +fun box(): String { + return test() +} +//TODO SHOULD BE LESS + +//SMAP +//lambdaOnInlineCallSite.1.kt +//Kotlin +//*S Kotlin +//*F +//+ 1 lambdaOnInlineCallSite.1.kt +//_DefaultPackage +//+ 2 lambdaOnInlineCallSite.2.kt +//builders/BuildersPackage +//*L +//1#1,56:1 +//4#2:57 +//*E +// +//SMAP +//lambdaOnInlineCallSite.1.kt +//Kotlin +//*S Kotlin +//*F +//+ 1 lambdaOnInlineCallSite.1.kt +//_DefaultPackage$lambdaOnInlineCallSite_1$HASH$test$1$1 +//*L +//1#1,56:1 +//*E +// +//SMAP +//lambdaOnInlineCallSite.1.kt +//Kotlin +//*S Kotlin +//*F +//+ 1 lambdaOnInlineCallSite.1.kt +//_DefaultPackage$lambdaOnInlineCallSite_1$HASH$test$1$1 +//*L +//1#1,56:1 +//*E \ No newline at end of file diff --git a/compiler/testData/codegen/boxInline/smap/anonymous/lambdaOnInlineCallSite.2.kt b/compiler/testData/codegen/boxInline/smap/anonymous/lambdaOnInlineCallSite.2.kt new file mode 100644 index 00000000000..625d4182bbf --- /dev/null +++ b/compiler/testData/codegen/boxInline/smap/anonymous/lambdaOnInlineCallSite.2.kt @@ -0,0 +1,7 @@ +package builders + +inline fun call(inlineOptions(InlineOption.ONLY_LOCAL_RETURN) init: () -> Unit) { + return init() +} + +//SMAP ABSENT diff --git a/compiler/testData/codegen/boxInline/smap/anonymous/object.1.kt b/compiler/testData/codegen/boxInline/smap/anonymous/object.1.kt new file mode 100644 index 00000000000..69927d95d4d --- /dev/null +++ b/compiler/testData/codegen/boxInline/smap/anonymous/object.1.kt @@ -0,0 +1,45 @@ +import builders.* +import kotlin.InlineOption.* + +fun test(): String { + var res = "Fail" + + call { + res = "OK" + } + + return res +} + + +fun box(): String { + return test() +} + +//SMAP +//object.1.kt +//Kotlin +//*S Kotlin +//*F +//+ 1 object.1.kt +//_DefaultPackage +//+ 2 object.2.kt +//builders/BuildersPackage +//*L +//1#1,45:1 +//4#2,5:46 +//*E +// +//SMAP +//object.2.kt +//Kotlin +//*S Kotlin +//*F +//+ 1 object.2.kt +//builders/BuildersPackage$object_2$HASH$call$1 +//+ 2 object.1.kt +//_DefaultPackage$object_1$HASH +//*L +//1#1,21:1 +//8#2:22 +//*E \ No newline at end of file diff --git a/compiler/testData/codegen/boxInline/smap/anonymous/object.2.kt b/compiler/testData/codegen/boxInline/smap/anonymous/object.2.kt new file mode 100644 index 00000000000..544fd5379a4 --- /dev/null +++ b/compiler/testData/codegen/boxInline/smap/anonymous/object.2.kt @@ -0,0 +1,21 @@ +package builders + +inline fun call(inlineOptions(InlineOption.ONLY_LOCAL_RETURN) init: () -> Unit) { + return object { + fun run () { + init() + } + }.run() +} + + +//SMAP +//object.2.kt +//Kotlin +//*S Kotlin +//*F +//+ 1 object.2.kt +//builders/BuildersPackage$object_2$HASH$call$1 +//*L +//1#1,21:1 +//*E \ No newline at end of file diff --git a/compiler/testData/codegen/boxInline/smap/anonymous/objectOnCallSite.1.kt b/compiler/testData/codegen/boxInline/smap/anonymous/objectOnCallSite.1.kt new file mode 100644 index 00000000000..95d5dd49699 --- /dev/null +++ b/compiler/testData/codegen/boxInline/smap/anonymous/objectOnCallSite.1.kt @@ -0,0 +1,36 @@ +import builders.* +import kotlin.InlineOption.* + +fun test(): String { + var res = "Fail" + + call { + object { + fun run () { + res = "OK" + } + }.run() + } + + return res +} + + +fun box(): String { + return test() +} + + +//SMAP +//objectOnCallSite.1.kt +//Kotlin +//*S Kotlin +//*F +//+ 1 objectOnCallSite.1.kt +//_DefaultPackage +//+ 2 objectOnCallSite.2.kt +//builders/BuildersPackage +//*L +//1#1,36:1 +//4#2:37 +//*E \ No newline at end of file diff --git a/compiler/testData/codegen/boxInline/smap/anonymous/objectOnCallSite.2.kt b/compiler/testData/codegen/boxInline/smap/anonymous/objectOnCallSite.2.kt new file mode 100644 index 00000000000..625d4182bbf --- /dev/null +++ b/compiler/testData/codegen/boxInline/smap/anonymous/objectOnCallSite.2.kt @@ -0,0 +1,7 @@ +package builders + +inline fun call(inlineOptions(InlineOption.ONLY_LOCAL_RETURN) init: () -> Unit) { + return init() +} + +//SMAP ABSENT diff --git a/compiler/testData/codegen/boxInline/smap/anonymous/objectOnInlineCallSite.1.kt b/compiler/testData/codegen/boxInline/smap/anonymous/objectOnInlineCallSite.1.kt new file mode 100644 index 00000000000..053ab339681 --- /dev/null +++ b/compiler/testData/codegen/boxInline/smap/anonymous/objectOnInlineCallSite.1.kt @@ -0,0 +1,58 @@ +import builders.* +import kotlin.InlineOption.* + +inline fun test(): String { + var res = "Fail" + + call { + object { + fun run () { + res = "OK" + } + }.run() + } + + return res +} + + +fun box(): String { + return test() +} +//TODO SHOULD BE LESS + +//SMAP +//objectOnInlineCallSite.1.kt +//Kotlin +//*S Kotlin +//*F +//+ 1 objectOnInlineCallSite.1.kt +//_DefaultPackage +//+ 2 objectOnInlineCallSite.2.kt +//builders/BuildersPackage +//*L +//1#1,58:1 +//4#2:59 +//*E +// +//SMAP +//objectOnInlineCallSite.1.kt +//Kotlin +//*S Kotlin +//*F +//+ 1 objectOnInlineCallSite.1.kt +//_DefaultPackage$objectOnInlineCallSite_1$HASH$test$1$1 +//*L +//1#1,58:1 +//*E +// +//SMAP +//objectOnInlineCallSite.1.kt +//Kotlin +//*S Kotlin +//*F +//+ 1 objectOnInlineCallSite.1.kt +//_DefaultPackage$objectOnInlineCallSite_1$HASH$test$1$1 +//*L +//1#1,58:1 +//*E \ No newline at end of file diff --git a/compiler/testData/codegen/boxInline/smap/anonymous/objectOnInlineCallSite.2.kt b/compiler/testData/codegen/boxInline/smap/anonymous/objectOnInlineCallSite.2.kt new file mode 100644 index 00000000000..c0162eb578b --- /dev/null +++ b/compiler/testData/codegen/boxInline/smap/anonymous/objectOnInlineCallSite.2.kt @@ -0,0 +1,7 @@ +package builders + +inline fun call(inlineOptions(InlineOption.ONLY_LOCAL_RETURN) init: () -> Unit) { + return init() +} + +//SMAP ABSENT \ No newline at end of file diff --git a/compiler/testData/codegen/boxInline/smap/anonymous/objectOnInlineCallSite2.1.kt b/compiler/testData/codegen/boxInline/smap/anonymous/objectOnInlineCallSite2.1.kt new file mode 100644 index 00000000000..c14c2f769b2 --- /dev/null +++ b/compiler/testData/codegen/boxInline/smap/anonymous/objectOnInlineCallSite2.1.kt @@ -0,0 +1,32 @@ +import builders.* +import kotlin.InlineOption.* + +fun box(): String { + return test() +} + + +//SMAP +//objectOnInlineCallSite2.1.kt +//Kotlin +//*S Kotlin +//*F +//+ 1 objectOnInlineCallSite2.1.kt +//_DefaultPackage +//+ 2 objectOnInlineCallSite2.2.kt +//builders/BuildersPackage +//*L +//1#1,32:1 +//8#2,11:33 +//*E +// +//SMAP +//objectOnInlineCallSite2.2.kt +//Kotlin +//*S Kotlin +//*F +//+ 1 objectOnInlineCallSite2.2.kt +//builders/BuildersPackage$objectOnInlineCallSite2_2$HASH$test$1$1 +//*L +//1#1,42:1 +//*E \ No newline at end of file diff --git a/compiler/testData/codegen/boxInline/smap/anonymous/objectOnInlineCallSite2.2.kt b/compiler/testData/codegen/boxInline/smap/anonymous/objectOnInlineCallSite2.2.kt new file mode 100644 index 00000000000..9855a3aa0af --- /dev/null +++ b/compiler/testData/codegen/boxInline/smap/anonymous/objectOnInlineCallSite2.2.kt @@ -0,0 +1,42 @@ +package builders + +inline fun call(inlineOptions(InlineOption.ONLY_LOCAL_RETURN) init: () -> Unit) { + return init() +} + +inline fun test(): String { + var res = "Fail" + + call { + object { + fun run () { + res = "OK" + } + }.run() + } + + return res +} +//TODO SHOULD BE LESS + +//SMAP +//objectOnInlineCallSite2.2.kt +//Kotlin +//*S Kotlin +//*F +//+ 1 objectOnInlineCallSite2.2.kt +//builders/BuildersPackage +//*L +//1#1,42:1 +//*E +// +//SMAP +//objectOnInlineCallSite2.2.kt +//Kotlin +//*S Kotlin +//*F +//+ 1 objectOnInlineCallSite2.2.kt +//builders/BuildersPackage$objectOnInlineCallSite2_2$HASH$test$1$1 +//*L +//1#1,42:1 +//*E \ No newline at end of file diff --git a/compiler/testData/codegen/boxInline/smap/assertion.1.kt b/compiler/testData/codegen/boxInline/smap/assertion.1.kt new file mode 100644 index 00000000000..f4f7e4edc24 --- /dev/null +++ b/compiler/testData/codegen/boxInline/smap/assertion.1.kt @@ -0,0 +1,25 @@ +import test.* + +fun box(): String { + massert(true) + massert(true) { + "test" + } + + return "OK" +} + +//SMAP +//assertion.1.kt +//Kotlin +//*S Kotlin +//*F +//+ 1 assertion.1.kt +//_DefaultPackage +//+ 2 assertion.2.kt +//test/TestPackage +//*L +//1#1,25:1 +//15#2,7:26 +//6#2,7:33 +//*E \ No newline at end of file diff --git a/compiler/testData/codegen/boxInline/smap/assertion.2.kt b/compiler/testData/codegen/boxInline/smap/assertion.2.kt new file mode 100644 index 00000000000..97509d2b005 --- /dev/null +++ b/compiler/testData/codegen/boxInline/smap/assertion.2.kt @@ -0,0 +1,34 @@ +package test + +public val MASSERTIONS_ENABLED: Boolean = true + +public inline fun massert(value: Boolean, lazyMessage: () -> String) { + if (MASSERTIONS_ENABLED) { + if (!value) { + val message = lazyMessage() + throw AssertionError(message) + } + } +} + + +public inline fun massert(value: Boolean, message: Any = "Assertion failed") { + if (ASSERTIONS_ENABLED) { + if (!value) { + throw AssertionError(message) + } + } +} + +//TODO SHOUDL BE ABSENT + +//SMAP +//assertion.2.kt +//Kotlin +//*S Kotlin +//*F +//+ 1 assertion.2.kt +//test/TestPackage +//*L +//1#1,34:1 +//*E \ No newline at end of file diff --git a/compiler/testData/codegen/boxInline/smap/oneFile.1.kt b/compiler/testData/codegen/boxInline/smap/oneFile.1.kt new file mode 100644 index 00000000000..db876ac9e65 --- /dev/null +++ b/compiler/testData/codegen/boxInline/smap/oneFile.1.kt @@ -0,0 +1,22 @@ +fun box(): String { + return test { + "K" + } +} + +inline fun test(p: () -> String): String { + var pd = "" + pd = "O" + return pd + p() +} +//TODO should be empty +//SMAP +//oneFile.1.kt +//Kotlin +//*S Kotlin +//*F +//+ 1 oneFile.1.kt +//_DefaultPackage +//*L +//1#1,22:1 +//*E \ No newline at end of file diff --git a/compiler/testData/codegen/boxInline/smap/oneFile.2.kt b/compiler/testData/codegen/boxInline/smap/oneFile.2.kt new file mode 100644 index 00000000000..4914054dcb2 --- /dev/null +++ b/compiler/testData/codegen/boxInline/smap/oneFile.2.kt @@ -0,0 +1,5 @@ +package zzz + +inline fun nothing() {} + +//SMAP ABSENT \ No newline at end of file diff --git a/compiler/testData/codegen/boxInline/smap/smap.1.kt b/compiler/testData/codegen/boxInline/smap/smap.1.kt new file mode 100644 index 00000000000..015f17d15b2 --- /dev/null +++ b/compiler/testData/codegen/boxInline/smap/smap.1.kt @@ -0,0 +1,38 @@ +import builders.* +import kotlin.InlineOption.* + +inline fun test(): String { + var res = "Fail" + + html { + head { + res = "OK" + } + } + + return res +} + + +fun box(): String { + var expected = test(); + + return expected +} + +//SMAP +//smap.1.kt +//Kotlin +//*S Kotlin +//*F +//+ 1 smap.1.kt +//_DefaultPackage +//+ 2 smap.2.kt +//builders/BuildersPackage +//*L +//1#1,38:1 +//16#2:39 +//4#2,9:40 +//8#2,3:49 +//5#2:52 +//*E \ No newline at end of file diff --git a/compiler/testData/codegen/boxInline/smap/smap.2.kt b/compiler/testData/codegen/boxInline/smap/smap.2.kt new file mode 100644 index 00000000000..42f03f73739 --- /dev/null +++ b/compiler/testData/codegen/boxInline/smap/smap.2.kt @@ -0,0 +1,28 @@ +package builders + +inline fun init(init: () -> Unit) { + init() +} + +inline fun initTag2(init: () -> Unit) { + val p = 1; + init() +} + +inline fun head(init: () -> Unit) = initTag2(init) + + +inline fun html(init: () -> Unit) { + return init(init) +} +//TODO SHOULD BE EMPTY +//SMAP +//smap.2.kt +//Kotlin +//*S Kotlin +//*F +//+ 1 smap.2.kt +//builders/BuildersPackage +//*L +//1#1,28:1 +//*E \ No newline at end of file diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/generated/BlackBoxInlineCodegenTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/codegen/generated/BlackBoxInlineCodegenTestGenerated.java index f5de59a2c9f..7f3b7dd3c79 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/generated/BlackBoxInlineCodegenTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/generated/BlackBoxInlineCodegenTestGenerated.java @@ -43,6 +43,7 @@ import java.util.regex.Pattern; BlackBoxInlineCodegenTestGenerated.NonLocalReturns.class, BlackBoxInlineCodegenTestGenerated.Reified.class, BlackBoxInlineCodegenTestGenerated.Simple.class, + BlackBoxInlineCodegenTestGenerated.Smap.class, BlackBoxInlineCodegenTestGenerated.Special.class, BlackBoxInlineCodegenTestGenerated.Trait.class, BlackBoxInlineCodegenTestGenerated.TryCatchFinally.class, @@ -737,6 +738,85 @@ public class BlackBoxInlineCodegenTestGenerated extends AbstractBlackBoxInlineCo } } + @TestMetadata("compiler/testData/codegen/boxInline/smap") + @TestDataPath("$PROJECT_ROOT") + @InnerTestClasses({Smap.Anonymous.class}) + @RunWith(JUnit3RunnerWithInners.class) + public static class Smap extends AbstractBlackBoxInlineCodegenTest { + public void testAllFilesPresentInSmap() throws Exception { + JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/boxInline/smap"), Pattern.compile("^(.+)\\.1.kt$"), true); + } + + @TestMetadata("assertion.1.kt") + public void testAssertion() throws Exception { + String fileName = JetTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/smap/assertion.1.kt"); + doTestMultiFileWithInlineCheck(fileName); + } + + @TestMetadata("oneFile.1.kt") + public void testOneFile() throws Exception { + String fileName = JetTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/smap/oneFile.1.kt"); + doTestMultiFileWithInlineCheck(fileName); + } + + @TestMetadata("smap.1.kt") + public void testSmap() throws Exception { + String fileName = JetTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/smap/smap.1.kt"); + doTestMultiFileWithInlineCheck(fileName); + } + + @TestMetadata("compiler/testData/codegen/boxInline/smap/anonymous") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Anonymous extends AbstractBlackBoxInlineCodegenTest { + public void testAllFilesPresentInAnonymous() throws Exception { + JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/boxInline/smap/anonymous"), Pattern.compile("^(.+)\\.1.kt$"), true); + } + + @TestMetadata("lambda.1.kt") + public void testLambda() throws Exception { + String fileName = JetTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/smap/anonymous/lambda.1.kt"); + doTestMultiFileWithInlineCheck(fileName); + } + + @TestMetadata("lambdaOnCallSite.1.kt") + public void testLambdaOnCallSite() throws Exception { + String fileName = JetTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/smap/anonymous/lambdaOnCallSite.1.kt"); + doTestMultiFileWithInlineCheck(fileName); + } + + @TestMetadata("lambdaOnInlineCallSite.1.kt") + public void testLambdaOnInlineCallSite() throws Exception { + String fileName = JetTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/smap/anonymous/lambdaOnInlineCallSite.1.kt"); + doTestMultiFileWithInlineCheck(fileName); + } + + @TestMetadata("object.1.kt") + public void testObject() throws Exception { + String fileName = JetTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/smap/anonymous/object.1.kt"); + doTestMultiFileWithInlineCheck(fileName); + } + + @TestMetadata("objectOnCallSite.1.kt") + public void testObjectOnCallSite() throws Exception { + String fileName = JetTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/smap/anonymous/objectOnCallSite.1.kt"); + doTestMultiFileWithInlineCheck(fileName); + } + + @TestMetadata("objectOnInlineCallSite.1.kt") + public void testObjectOnInlineCallSite() throws Exception { + String fileName = JetTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/smap/anonymous/objectOnInlineCallSite.1.kt"); + doTestMultiFileWithInlineCheck(fileName); + } + + @TestMetadata("objectOnInlineCallSite2.1.kt") + public void testObjectOnInlineCallSite2() throws Exception { + String fileName = JetTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/smap/anonymous/objectOnInlineCallSite2.1.kt"); + doTestMultiFileWithInlineCheck(fileName); + } + } + } + @TestMetadata("compiler/testData/codegen/boxInline/special") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) diff --git a/compiler/tests/org/jetbrains/kotlin/jvm/compiler/CompileKotlinAgainstInlineKotlinTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/jvm/compiler/CompileKotlinAgainstInlineKotlinTestGenerated.java index 3a61d350fcd..239d5a8d8ea 100644 --- a/compiler/tests/org/jetbrains/kotlin/jvm/compiler/CompileKotlinAgainstInlineKotlinTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/jvm/compiler/CompileKotlinAgainstInlineKotlinTestGenerated.java @@ -43,6 +43,7 @@ import java.util.regex.Pattern; CompileKotlinAgainstInlineKotlinTestGenerated.NonLocalReturns.class, CompileKotlinAgainstInlineKotlinTestGenerated.Reified.class, CompileKotlinAgainstInlineKotlinTestGenerated.Simple.class, + CompileKotlinAgainstInlineKotlinTestGenerated.Smap.class, CompileKotlinAgainstInlineKotlinTestGenerated.Special.class, CompileKotlinAgainstInlineKotlinTestGenerated.Trait.class, CompileKotlinAgainstInlineKotlinTestGenerated.TryCatchFinally.class, @@ -737,6 +738,85 @@ public class CompileKotlinAgainstInlineKotlinTestGenerated extends AbstractCompi } } + @TestMetadata("compiler/testData/codegen/boxInline/smap") + @TestDataPath("$PROJECT_ROOT") + @InnerTestClasses({Smap.Anonymous.class}) + @RunWith(JUnit3RunnerWithInners.class) + public static class Smap extends AbstractCompileKotlinAgainstInlineKotlinTest { + public void testAllFilesPresentInSmap() throws Exception { + JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/boxInline/smap"), Pattern.compile("^(.+)\\.1.kt$"), true); + } + + @TestMetadata("assertion.1.kt") + public void testAssertion() throws Exception { + String fileName = JetTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/smap/assertion.1.kt"); + doBoxTestWithInlineCheck(fileName); + } + + @TestMetadata("oneFile.1.kt") + public void testOneFile() throws Exception { + String fileName = JetTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/smap/oneFile.1.kt"); + doBoxTestWithInlineCheck(fileName); + } + + @TestMetadata("smap.1.kt") + public void testSmap() throws Exception { + String fileName = JetTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/smap/smap.1.kt"); + doBoxTestWithInlineCheck(fileName); + } + + @TestMetadata("compiler/testData/codegen/boxInline/smap/anonymous") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Anonymous extends AbstractCompileKotlinAgainstInlineKotlinTest { + public void testAllFilesPresentInAnonymous() throws Exception { + JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/boxInline/smap/anonymous"), Pattern.compile("^(.+)\\.1.kt$"), true); + } + + @TestMetadata("lambda.1.kt") + public void testLambda() throws Exception { + String fileName = JetTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/smap/anonymous/lambda.1.kt"); + doBoxTestWithInlineCheck(fileName); + } + + @TestMetadata("lambdaOnCallSite.1.kt") + public void testLambdaOnCallSite() throws Exception { + String fileName = JetTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/smap/anonymous/lambdaOnCallSite.1.kt"); + doBoxTestWithInlineCheck(fileName); + } + + @TestMetadata("lambdaOnInlineCallSite.1.kt") + public void testLambdaOnInlineCallSite() throws Exception { + String fileName = JetTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/smap/anonymous/lambdaOnInlineCallSite.1.kt"); + doBoxTestWithInlineCheck(fileName); + } + + @TestMetadata("object.1.kt") + public void testObject() throws Exception { + String fileName = JetTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/smap/anonymous/object.1.kt"); + doBoxTestWithInlineCheck(fileName); + } + + @TestMetadata("objectOnCallSite.1.kt") + public void testObjectOnCallSite() throws Exception { + String fileName = JetTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/smap/anonymous/objectOnCallSite.1.kt"); + doBoxTestWithInlineCheck(fileName); + } + + @TestMetadata("objectOnInlineCallSite.1.kt") + public void testObjectOnInlineCallSite() throws Exception { + String fileName = JetTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/smap/anonymous/objectOnInlineCallSite.1.kt"); + doBoxTestWithInlineCheck(fileName); + } + + @TestMetadata("objectOnInlineCallSite2.1.kt") + public void testObjectOnInlineCallSite2() throws Exception { + String fileName = JetTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/smap/anonymous/objectOnInlineCallSite2.1.kt"); + doBoxTestWithInlineCheck(fileName); + } + } + } + @TestMetadata("compiler/testData/codegen/boxInline/special") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) diff --git a/idea/testData/debugger/tinyApp/outs/stepIntoFromInlineFun.out b/idea/testData/debugger/tinyApp/outs/stepIntoFromInlineFun.out new file mode 100644 index 00000000000..66e28ac77f7 --- /dev/null +++ b/idea/testData/debugger/tinyApp/outs/stepIntoFromInlineFun.out @@ -0,0 +1,8 @@ +LineBreakpoint created at stepIntoFromInlineFun.kt:13 +!JDK_HOME!\bin\java -agentlib:jdwp=transport=dt_socket,address=!HOST_NAME!:!HOST_PORT!,suspend=y,server=n -Dfile.encoding=!FILE_ENCODING! -classpath !APP_PATH!\classes;!KOTLIN_RUNTIME!;!CUSTOM_LIBRARY!;!RT_JAR! stepIntoFromInlineFun.StepIntoFromInlineFunPackage +Connected to the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket' +stepIntoFromInlineFun.kt:13 +stepIntoFromInlineFun.kt:7 +Disconnected from the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket' + +Process finished with exit code 0 diff --git a/idea/testData/debugger/tinyApp/outs/stepIntoInlineFun.out b/idea/testData/debugger/tinyApp/outs/stepIntoInlineFun.out new file mode 100644 index 00000000000..4a6ab6e8ef6 --- /dev/null +++ b/idea/testData/debugger/tinyApp/outs/stepIntoInlineFun.out @@ -0,0 +1,9 @@ +LineBreakpoint created at stepIntoInlineFun.kt:8 +!JDK_HOME!\bin\java -agentlib:jdwp=transport=dt_socket,address=!HOST_NAME!:!HOST_PORT!,suspend=y,server=n -Dfile.encoding=!FILE_ENCODING! -classpath !APP_PATH!\classes;!KOTLIN_RUNTIME!;!CUSTOM_LIBRARY!;!RT_JAR! stepIntoInlineFun.StepIntoInlineFunPackage +Connected to the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket' +stepIntoInlineFun.kt:8 +stepIntoInlineFun.kt:13 +stepIntoInlineFun.kt:8 +Disconnected from the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket' + +Process finished with exit code 0 diff --git a/idea/testData/debugger/tinyApp/outs/stepIntoStdLibInlineFun.out b/idea/testData/debugger/tinyApp/outs/stepIntoStdLibInlineFun.out new file mode 100644 index 00000000000..993cb3d5e01 --- /dev/null +++ b/idea/testData/debugger/tinyApp/outs/stepIntoStdLibInlineFun.out @@ -0,0 +1,9 @@ +LineBreakpoint created at stepIntoStdLibInlineFun.kt:6 +!JDK_HOME!\bin\java -agentlib:jdwp=transport=dt_socket,address=!HOST_NAME!:!HOST_PORT!,suspend=y,server=n -Dfile.encoding=!FILE_ENCODING! -classpath !APP_PATH!\classes;!KOTLIN_RUNTIME!;!CUSTOM_LIBRARY!;!RT_JAR! stepIntoStdLibInlineFun.StepIntoStdLibInlineFunPackage +Connected to the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket' +stepIntoStdLibInlineFun.kt:6 +_Mapping.!EXT! +resuming stepIntoStdLibInlineFun.kt:5 +Disconnected from the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket' + +Process finished with exit code 0 diff --git a/idea/testData/debugger/tinyApp/src/stepInto/stepInto/stepIntoFromInlineFun.kt b/idea/testData/debugger/tinyApp/src/stepInto/stepInto/stepIntoFromInlineFun.kt new file mode 100644 index 00000000000..ec88266d538 --- /dev/null +++ b/idea/testData/debugger/tinyApp/src/stepInto/stepInto/stepIntoFromInlineFun.kt @@ -0,0 +1,17 @@ +package stepIntoFromInlineFun + +class A() + +fun main(args: Array) { + val a = A() + a.test { it + 1 } + val b = 1 +} + +inline fun A.test(l: (Int) -> Unit) { + //Breakpoint! + l(11) +} + +// STEP_INTO: 1 +// TRACING_FILTERS_ENABLED: false diff --git a/idea/testData/debugger/tinyApp/src/stepInto/stepInto/stepIntoInlineFun.kt b/idea/testData/debugger/tinyApp/src/stepInto/stepInto/stepIntoInlineFun.kt new file mode 100644 index 00000000000..07fab317c1b --- /dev/null +++ b/idea/testData/debugger/tinyApp/src/stepInto/stepInto/stepIntoInlineFun.kt @@ -0,0 +1,17 @@ +package stepIntoInlineFun + +class A() + +fun main(args: Array) { + val a = A() + //Breakpoint! + a.test { it + 1 } + val b = 1 +} + +inline fun A.test(l: (Int) -> Unit) { + l(11) +} + +// STEP_INTO: 2 +// TRACING_FILTERS_ENABLED: false diff --git a/idea/testData/debugger/tinyApp/src/stepInto/stepInto/stepIntoStdLibInlineFun.kt b/idea/testData/debugger/tinyApp/src/stepInto/stepInto/stepIntoStdLibInlineFun.kt new file mode 100644 index 00000000000..88a83833c51 --- /dev/null +++ b/idea/testData/debugger/tinyApp/src/stepInto/stepInto/stepIntoStdLibInlineFun.kt @@ -0,0 +1,11 @@ +package stepIntoStdLibInlineFun + +fun main(args: Array) { + val a = listOf(1) + //Breakpoint! + a.map { it + 1 } + val b = 1 +} + +// STEP_INTO: 1 +// TRACING_FILTERS_ENABLED: false diff --git a/idea/tests/org/jetbrains/kotlin/idea/debugger/KotlinSteppingTestGenerated.java b/idea/tests/org/jetbrains/kotlin/idea/debugger/KotlinSteppingTestGenerated.java index 31d39f818a3..1545a9305b1 100644 --- a/idea/tests/org/jetbrains/kotlin/idea/debugger/KotlinSteppingTestGenerated.java +++ b/idea/tests/org/jetbrains/kotlin/idea/debugger/KotlinSteppingTestGenerated.java @@ -242,6 +242,24 @@ public class KotlinSteppingTestGenerated extends AbstractKotlinSteppingTest { doStepIntoTest(fileName); } + @TestMetadata("stepIntoFromInlineFun.kt") + public void testStepIntoFromInlineFun() throws Exception { + String fileName = JetTestUtils.navigationMetadata("idea/testData/debugger/tinyApp/src/stepInto/stepInto/stepIntoFromInlineFun.kt"); + doStepIntoTest(fileName); + } + + @TestMetadata("stepIntoInlineFun.kt") + public void testStepIntoInlineFun() throws Exception { + String fileName = JetTestUtils.navigationMetadata("idea/testData/debugger/tinyApp/src/stepInto/stepInto/stepIntoInlineFun.kt"); + doStepIntoTest(fileName); + } + + @TestMetadata("stepIntoStdLibInlineFun.kt") + public void testStepIntoStdLibInlineFun() throws Exception { + String fileName = JetTestUtils.navigationMetadata("idea/testData/debugger/tinyApp/src/stepInto/stepInto/stepIntoStdLibInlineFun.kt"); + doStepIntoTest(fileName); + } + @TestMetadata("syntheticMethods.kt") public void testSyntheticMethods() throws Exception { String fileName = JetTestUtils.navigationMetadata("idea/testData/debugger/tinyApp/src/stepInto/stepInto/syntheticMethods.kt");