diff --git a/kotlin-native/backend.native/tests/build.gradle b/kotlin-native/backend.native/tests/build.gradle index 5ebc1d7d4a1..9435c3c076e 100644 --- a/kotlin-native/backend.native/tests/build.gradle +++ b/kotlin-native/backend.native/tests/build.gradle @@ -2338,6 +2338,12 @@ dynamicTest("kt42830") { useGoldenData = true } +dynamicTest("kt64508") { + source = "produce_dynamic/kt-64508/hello.kt" + cSource = "$projectDir/produce_dynamic/kt-64508/main.c" + useGoldenData = true +} + dynamicTest("produce_dynamic_unhandledException") { disabled = (cacheTesting != null) // Disabled due to KT-47828. source = "produce_dynamic/unhandledException/unhandled.kt" diff --git a/kotlin-native/backend.native/tests/produce_dynamic/kt-64508/hello-main.out b/kotlin-native/backend.native/tests/produce_dynamic/kt-64508/hello-main.out new file mode 100644 index 00000000000..7326d960397 --- /dev/null +++ b/kotlin-native/backend.native/tests/produce_dynamic/kt-64508/hello-main.out @@ -0,0 +1 @@ +Ok diff --git a/kotlin-native/backend.native/tests/produce_dynamic/kt-64508/hello.kt b/kotlin-native/backend.native/tests/produce_dynamic/kt-64508/hello.kt new file mode 100644 index 00000000000..cfb7ce5853c --- /dev/null +++ b/kotlin-native/backend.native/tests/produce_dynamic/kt-64508/hello.kt @@ -0,0 +1,31 @@ +/* + * Copyright 2010-2023 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +private inline fun inlineFun(block: () -> T): T { + val zalue = block() + return zalue +} + +interface Bar { + fun bar() +} + +interface Foo { + fun getBar(): Bar +} + +val foo = inlineFun { + object : Foo { + override fun getBar(): Bar { + return inlineFun { + object : Bar { + override fun bar() { } + } + } + } + } +} + +fun callbar(bar: Bar) = bar.bar() diff --git a/kotlin-native/backend.native/tests/produce_dynamic/kt-64508/main.c b/kotlin-native/backend.native/tests/produce_dynamic/kt-64508/main.c new file mode 100644 index 00000000000..43f7ac2c337 --- /dev/null +++ b/kotlin-native/backend.native/tests/produce_dynamic/kt-64508/main.c @@ -0,0 +1,13 @@ +/* + * Copyright 2010-2023 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ +#include "testlib_api.h" +#define __ testlib_symbols()-> +#define T_(x) testlib_kref_ ## x + +#include + +int main(int argc, char** argv) { + printf("Ok\n"); +}