diff --git a/backend.native/tests/build.gradle b/backend.native/tests/build.gradle index ccccbebfaa6..90cdb2e9da4 100644 --- a/backend.native/tests/build.gradle +++ b/backend.native/tests/build.gradle @@ -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' } diff --git a/backend.native/tests/interop/basics/1.kt b/backend.native/tests/interop/basics/1.kt index c25b686f209..65ae18a17b6 100644 --- a/backend.native/tests/interop/basics/1.kt +++ b/backend.native/tests/interop/basics/1.kt @@ -1,5 +1,12 @@ import cstdlib.* +import kotlinx.cinterop.* fun main(args: Array) { println(atoi("257")) + + val divResult = div(-5, 3) + val (quot, rem) = divResult.useContents { Pair(quot, rem) } + println(quot) + println(rem) + } \ No newline at end of file