From 695339e21f02bf2da5440174771f1c14b835824f Mon Sep 17 00:00:00 2001 From: Vasily Levchenko Date: Wed, 9 Jun 2021 12:31:34 +0200 Subject: [PATCH] [k/n][tests][debugger] test for KT-47198. --- .../kotlin/native/test/debugger/LldbTests.kt | 43 +++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/kotlin-native/backend.native/tests/debugger/src/test/kotlin/org/jetbrains/kotlin/native/test/debugger/LldbTests.kt b/kotlin-native/backend.native/tests/debugger/src/test/kotlin/org/jetbrains/kotlin/native/test/debugger/LldbTests.kt index 6e7f26d3c2c..2f63db81700 100644 --- a/kotlin-native/backend.native/tests/debugger/src/test/kotlin/org/jetbrains/kotlin/native/test/debugger/LldbTests.kt +++ b/kotlin-native/backend.native/tests/debugger/src/test/kotlin/org/jetbrains/kotlin/native/test/debugger/LldbTests.kt @@ -328,4 +328,47 @@ class LldbTests { """.trimIndent().lldb(binary) } + @Test + fun `kt47198`() = lldbComplexTest { + val kt47198 = """ + fun foo(a:Int) = print("a: ${'$'}a") + + fun main() { + foo(33) + } + """.feedOutput("kt47198.kt") + + val binary = arrayOf(kt47198).binary("kt47198", "-g") + """ + > b 1 + Breakpoint 1: where = kt47198.kexe`kfun:#foo(kotlin.Int){} [..] at kt47198.kt:1:29, [..] + > ${lldbCommandRunOrContinue()} + > fr v + (int) a = 33 + > q + """.trimIndent().lldb(binary) + } + + @Test + fun `kt47198 with body`() = lldbComplexTest { + val kt47198 = """ + fun foo(a:Int){ + print("a: ${'$'}a") + } + + fun main() { + foo(33) + } + """.feedOutput("kt47198.kt") + + val binary = arrayOf(kt47198).binary("kt47198", "-g") + """ + > b 1 + Breakpoint 1: where = kt47198.kexe`kfun:#foo(kotlin.Int){} [..] at kt47198.kt:2:[..] + > ${lldbCommandRunOrContinue()} + > fr v + (int) a = 33 + > q + """.trimIndent().lldb(binary) + } } \ No newline at end of file