diff options
Diffstat (limited to 'plugins/kotlin/jvm-debugger/test/testData/evaluation/multiplatform')
10 files changed, 224 insertions, 0 deletions
diff --git a/plugins/kotlin/jvm-debugger/test/testData/evaluation/multiplatform/diamond.kt b/plugins/kotlin/jvm-debugger/test/testData/evaluation/multiplatform/diamond.kt new file mode 100644 index 000000000000..87bc132fdc47 --- /dev/null +++ b/plugins/kotlin/jvm-debugger/test/testData/evaluation/multiplatform/diamond.kt @@ -0,0 +1,56 @@ +// MODULE: common +// FILE: common.kt +// PLATFORM: common +expect fun debugMe(i: Int): Int + +fun commonContext(){ + //Breakpoint1 + val str = "Stop here" +} + +expect fun left(): Int +expect fun right(): Int + +// ADDITIONAL_BREAKPOINT: common.kt / Breakpoint1 / line / 1 + +// EXPRESSION: debugMe(3) +// RESULT: 6: I + +// EXPRESSION: left() +// RESULT: 1: I + +// EXPRESSION: right() +// RESULT: 2: I + +// MODULE: left +// FILE: left.kt +// PLATFORM: jvm +// DEPENDS_ON: common +expect fun leftImplInLeaf(): Int +actual fun left(): Int = leftImplInLeaf() + +// MODULE: right +// FILE: right.kt +// PLATFORM: jvm +// DEPENDS_ON: common +actual fun right(): Int = rightImplInLeaf() +expect fun rightImplInLeaf(): Int + +// MODULE: jvm +// FILE: jvm.kt +// PLATFORM: jvm +// DEPENDS_ON: left, right +actual fun debugMe(i: Int): Int { + return left() + right() + i +} + +// FILE: leftImpl.kt +actual fun leftImplInLeaf(): Int = 1 + +// FILE: rightImpl.kt +actual fun rightImplInLeaf(): Int = 2 + +// FILE: main.kt +fun main(){ + commonContext() +} diff --git a/plugins/kotlin/jvm-debugger/test/testData/evaluation/multiplatform/diamond.out b/plugins/kotlin/jvm-debugger/test/testData/evaluation/multiplatform/diamond.out new file mode 100644 index 000000000000..3aa39bf41991 --- /dev/null +++ b/plugins/kotlin/jvm-debugger/test/testData/evaluation/multiplatform/diamond.out @@ -0,0 +1,8 @@ +LineBreakpoint created at common.kt:8 lambdaOrdinal = 1 +Run Java +Connected to the target VM +common.kt:8 +Compile bytecode for debugMe(3) +Disconnected from the target VM + +Process finished with exit code 0 diff --git a/plugins/kotlin/jvm-debugger/test/testData/evaluation/multiplatform/differentCommons.kt b/plugins/kotlin/jvm-debugger/test/testData/evaluation/multiplatform/differentCommons.kt new file mode 100644 index 000000000000..46177bf9a420 --- /dev/null +++ b/plugins/kotlin/jvm-debugger/test/testData/evaluation/multiplatform/differentCommons.kt @@ -0,0 +1,43 @@ +// MODULE: left +// FILE: left.kt +// PLATFORM: common +expect fun left(): Int + +fun debugTrulyMultiplatformCommon() { + //Breakpoint1 + val s = "Left stop" +} + +// ADDITIONAL_BREAKPOINT: left.kt / Breakpoint1 / line / 1 + +// EXPRESSION: left() +// RESULT: 1: I + + +// MODULE: right +// FILE: right.kt +// PLATFORM: jvm +expect fun right(): Int + +fun debugSharedJvmCommon() { + //Breakpoint2 + val s = "Right stop" +} + +// ADDITIONAL_BREAKPOINT: right.kt / Breakpoint2 / line / 1 + +// EXPRESSION: right() +// RESULT: 2: I + + +// MODULE: jvm +// FILE: jvm.kt +// PLATFORM: jvm +// DEPENDS_ON: left, right +actual fun left(): Int = 1 +actual fun right(): Int = 2 + +fun main(){ + debugTrulyMultiplatformCommon() + debugSharedJvmCommon() +} diff --git a/plugins/kotlin/jvm-debugger/test/testData/evaluation/multiplatform/differentCommons.out b/plugins/kotlin/jvm-debugger/test/testData/evaluation/multiplatform/differentCommons.out new file mode 100644 index 000000000000..663d258579b2 --- /dev/null +++ b/plugins/kotlin/jvm-debugger/test/testData/evaluation/multiplatform/differentCommons.out @@ -0,0 +1,11 @@ +LineBreakpoint created at left.kt:8 lambdaOrdinal = 1 +LineBreakpoint created at right.kt:8 lambdaOrdinal = 1 +Run Java +Connected to the target VM +left.kt:8 +Compile bytecode for left() +right.kt:8 +Compile bytecode for right() +Disconnected from the target VM + +Process finished with exit code 0 diff --git a/plugins/kotlin/jvm-debugger/test/testData/evaluation/multiplatform/evaluateInCommonCode.kt b/plugins/kotlin/jvm-debugger/test/testData/evaluation/multiplatform/evaluateInCommonCode.kt new file mode 100644 index 000000000000..6ab07de01228 --- /dev/null +++ b/plugins/kotlin/jvm-debugger/test/testData/evaluation/multiplatform/evaluateInCommonCode.kt @@ -0,0 +1,30 @@ +// MODULE: common +// FILE: common.kt + +expect fun foo(): Int + +fun bar() { + //Breakpoint1 + foo() + //Breakpoint2 + foo() +} + +// ADDITIONAL_BREAKPOINT: common.kt / Breakpoint1 / line / 1 +// ADDITIONAL_BREAKPOINT: common.kt / Breakpoint2 / line / 1 + +// EXPRESSION: foo() +// RESULT: 1: I + +// EXPRESSION: listOf(1, 2, 3).map { it }.size +// RESULT: 3: I + +// MODULE: jvm +// FILE: evaluateInCommonCode.kt +// DEPENDS_ON: common + +actual fun foo() = 1 + +fun main() { + bar() +} diff --git a/plugins/kotlin/jvm-debugger/test/testData/evaluation/multiplatform/evaluateInCommonCode.out b/plugins/kotlin/jvm-debugger/test/testData/evaluation/multiplatform/evaluateInCommonCode.out new file mode 100644 index 000000000000..079c7c41122c --- /dev/null +++ b/plugins/kotlin/jvm-debugger/test/testData/evaluation/multiplatform/evaluateInCommonCode.out @@ -0,0 +1,12 @@ +// IGNORE_BACKEND: JVM_WITH_IR_EVALUATOR, JVM_IR_WITH_IR_EVALUATOR +LineBreakpoint created at common.kt:8 lambdaOrdinal = 1 +LineBreakpoint created at common.kt:10 lambdaOrdinal = 1 +Run Java +Connected to the target VM +common.kt:8 +Compile bytecode for foo() +common.kt:10 +Compile bytecode for listOf(1, 2, 3).map { it }.size +Disconnected from the target VM + +Process finished with exit code 0 diff --git a/plugins/kotlin/jvm-debugger/test/testData/evaluation/multiplatform/evaluateWithIntermediateJvm.kt b/plugins/kotlin/jvm-debugger/test/testData/evaluation/multiplatform/evaluateWithIntermediateJvm.kt new file mode 100644 index 000000000000..7a00bc0e7ce9 --- /dev/null +++ b/plugins/kotlin/jvm-debugger/test/testData/evaluation/multiplatform/evaluateWithIntermediateJvm.kt @@ -0,0 +1,28 @@ +// MODULE: common +// FILE: common.kt +// PLATFORM: common +expect fun debugMe(i: Int): String +fun commonContext(){ + //Breakpoint1 + val str = "Stop here" +} + +// ADDITIONAL_BREAKPOINT: common.kt / Breakpoint1 / line / 1 + +// EXPRESSION: debugMe(42) +// RESULT: "JVM 42": Ljava/lang/String; + +// MODULE: jvm +// FILE: jvm.kt +// DEPENDS_ON: intermediateJvm +actual fun debugMe(i: Int): String { + return "JVM $i" +} +fun main(){ + commonContext() +} + +// MODULE: intermediateJvm +// FILE: intermediate.kt +// DEPENDS_ON: common +// PLATFORM: jvm diff --git a/plugins/kotlin/jvm-debugger/test/testData/evaluation/multiplatform/evaluateWithIntermediateJvm.out b/plugins/kotlin/jvm-debugger/test/testData/evaluation/multiplatform/evaluateWithIntermediateJvm.out new file mode 100644 index 000000000000..e377ac90b692 --- /dev/null +++ b/plugins/kotlin/jvm-debugger/test/testData/evaluation/multiplatform/evaluateWithIntermediateJvm.out @@ -0,0 +1,8 @@ +LineBreakpoint created at common.kt:7 lambdaOrdinal = 1 +Run Java +Connected to the target VM +common.kt:7 +Compile bytecode for debugMe(42) +Disconnected from the target VM + +Process finished with exit code 0 diff --git a/plugins/kotlin/jvm-debugger/test/testData/evaluation/multiplatform/typealiasFromCommonCode.kt b/plugins/kotlin/jvm-debugger/test/testData/evaluation/multiplatform/typealiasFromCommonCode.kt new file mode 100644 index 000000000000..57f019252fea --- /dev/null +++ b/plugins/kotlin/jvm-debugger/test/testData/evaluation/multiplatform/typealiasFromCommonCode.kt @@ -0,0 +1,19 @@ +// MODULE: common +// FILE: common.kt + +expect class ExpectTypeAlias() +val value = ExpectTypeAlias() + +// MODULE: jvm +// FILE: typealiasFromCommonCode.kt +// DEPENDS_ON: common + +class JvmTypeAlias +actual typealias ExpectTypeAlias = JvmTypeAlias + +fun main() { + // EXPRESSION: value + // RESULT: instance of JvmTypeAlias(id=ID): LJvmTypeAlias; + //Breakpoint! + val a = 0 +} diff --git a/plugins/kotlin/jvm-debugger/test/testData/evaluation/multiplatform/typealiasFromCommonCode.out b/plugins/kotlin/jvm-debugger/test/testData/evaluation/multiplatform/typealiasFromCommonCode.out new file mode 100644 index 000000000000..6f1c2b465f8a --- /dev/null +++ b/plugins/kotlin/jvm-debugger/test/testData/evaluation/multiplatform/typealiasFromCommonCode.out @@ -0,0 +1,9 @@ +// IGNORE_BACKEND: JVM_WITH_IR_EVALUATOR, JVM_IR_WITH_IR_EVALUATOR +LineBreakpoint created at typealiasFromCommonCode.kt:12 +Run Java +Connected to the target VM +typealiasFromCommonCode.kt:12 +Compile bytecode for value +Disconnected from the target VM + +Process finished with exit code 0 |