Add interop test for returning struct by value

This commit is contained in:
Svyatoslav Scherbina
2017-04-10 11:16:35 +03:00
committed by SvyatoslavScherbina
parent 208d568e3e
commit 2a3450047c
2 changed files with 8 additions and 1 deletions
+1 -1
View File
@@ -1651,7 +1651,7 @@ task interop0(type: RunInteropKonanTest) {
}
task interop1(type: RunInteropKonanTest) {
goldValue = "257\n"
goldValue = "257\n-1\n-2\n"
source = "interop/basics/1.kt"
interop = 'cstdlib'
}
+7
View File
@@ -1,5 +1,12 @@
import cstdlib.*
import kotlinx.cinterop.*
fun main(args: Array<String>) {
println(atoi("257"))
val divResult = div(-5, 3)
val (quot, rem) = divResult.useContents { Pair(quot, rem) }
println(quot)
println(rem)
}