diff --git a/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/llvm/IrToBitcode.kt b/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/llvm/IrToBitcode.kt index 13fd807d867..0cfe1573af4 100644 --- a/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/llvm/IrToBitcode.kt +++ b/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/llvm/IrToBitcode.kt @@ -1919,7 +1919,12 @@ internal class CodeGeneratorVisitor(val context: Context, val lifetimes: Map Int): Int { + val arr = IntArray(n) { block(it) } + var sum = 0 + for (x in arr) sum += x + return sum +} \ No newline at end of file diff --git a/backend.native/tests/codegen/inline/inlineCtor_linkTest_main.kt b/backend.native/tests/codegen/inline/inlineCtor_linkTest_main.kt new file mode 100644 index 00000000000..6281b09a7d5 --- /dev/null +++ b/backend.native/tests/codegen/inline/inlineCtor_linkTest_main.kt @@ -0,0 +1,11 @@ +/* + * Copyright 2010-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license + * that can be found in the LICENSE file. + */ + +import a.* +import kotlin.test.* + +fun main() { + assertEquals(42, foo(7) { it * 2 }) +} \ No newline at end of file