Add interop test for returning struct by value
This commit is contained in:
committed by
SvyatoslavScherbina
parent
208d568e3e
commit
2a3450047c
@@ -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'
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user