[K/N] Adjust moved special backend checks tests

^KT-61564
This commit is contained in:
Vladimir Sukharev
2023-11-10 13:07:12 +01:00
committed by Space Team
parent 8f12bf6cc8
commit 08bc0a6bd0
74 changed files with 2155 additions and 19 deletions
@@ -1,3 +1,4 @@
// FIR_IDENTICAL
import kotlinx.cinterop.*
fun foo(x: Int, vararg s: String): Int {
@@ -6,6 +7,7 @@ fun foo(x: Int, vararg s: String): Int {
return sum
}
@OptIn(kotlinx.cinterop.ExperimentalForeignApi::class)
fun bar() {
staticCFunction(::foo)
}
@@ -1,7 +1,9 @@
// FIR_IDENTICAL
import kotlinx.cinterop.*
fun foo(f: Function1<*, Int>) = f
@OptIn(kotlinx.cinterop.ExperimentalForeignApi::class)
fun bar() {
staticCFunction(::foo)
}
@@ -1,7 +1,9 @@
// FIR_IDENTICAL
import kotlinx.cinterop.*
fun foo(f: Function1<in Int, Int>) = f
@OptIn(kotlinx.cinterop.ExperimentalForeignApi::class)
fun bar() {
staticCFunction(::foo)
}
@@ -1,3 +1,5 @@
// FIR_IDENTICAL
@file:OptIn(kotlinx.cinterop.ExperimentalForeignApi::class)
import kotlinx.cinterop.*
fun foo(x: CValue<*>?) = x
@@ -1,5 +1,7 @@
// FIR_IDENTICAL
import kotlinx.cinterop.*
@OptIn(kotlinx.cinterop.ExperimentalForeignApi::class)
fun <T: CVariable> bar() {
fun foo(x: CValue<T>) = x
@@ -1,3 +1,5 @@
// FIR_IDENTICAL
@file:OptIn(kotlinx.cinterop.ExperimentalForeignApi::class)
import kotlinx.cinterop.*
class Z(rawPtr: NativePtr): CStructVar(rawPtr)
@@ -1,6 +1,9 @@
// FIR_IDENTICAL
// OPT_IN: kotlin.native.internal.InternalForKotlinNative
import kotlinx.cinterop.*
import kotlinx.cinterop.internal.*
@OptIn(kotlinx.cinterop.ExperimentalForeignApi::class)
@CStruct(spelling = "struct { }") class Z constructor(rawPtr: NativePtr) : CStructVar(rawPtr) {
val x: Pair<Int, Int>? = null
@CStruct.MemberAt(offset = 0L) get
@@ -1,6 +1,9 @@
// FIR_IDENTICAL
// OPT_IN: kotlin.native.internal.InternalForKotlinNative
import kotlinx.cinterop.*
import kotlinx.cinterop.internal.*
@OptIn(kotlinx.cinterop.ExperimentalForeignApi::class)
@CStruct(spelling = "struct { }") class Z constructor(rawPtr: NativePtr) : CStructVar(rawPtr) {
var x: Pair<Int, Int>? = null
@CStruct.MemberAt(offset = 0L) get
@@ -1,9 +1,11 @@
// FIR_IDENTICAL
import kotlinx.cinterop.*
class Z {
fun foo(x: Int) = x
}
@OptIn(kotlinx.cinterop.ExperimentalForeignApi::class)
fun bar() {
staticCFunction(Z()::foo)
}
@@ -1,5 +1,7 @@
// FIR_IDENTICAL
import kotlinx.cinterop.*
@OptIn(kotlinx.cinterop.ExperimentalForeignApi::class)
fun bar(x: Int) {
fun foo() = x
@@ -1,7 +1,9 @@
// FIR_IDENTICAL
import kotlinx.cinterop.*
fun foo(x: Any) = x
@OptIn(kotlinx.cinterop.ExperimentalForeignApi::class)
fun bar() {
staticCFunction<String, Any>(::foo)
}
@@ -1,3 +1,5 @@
// FIR_IDENTICAL
import kotlinx.cinterop.*
@Suppress("DEPRECATION")
fun bar(x: Float) = x.signExtend<Int>()
@@ -1,3 +1,5 @@
// FIR_IDENTICAL
import kotlinx.cinterop.*
@Suppress("DEPRECATION")
fun bar(x: Int) = x.signExtend<Float>()
@@ -1,3 +1,5 @@
// FIR_IDENTICAL
import kotlinx.cinterop.*
@Suppress("DEPRECATION")
fun bar(x: Int) = x.signExtend<Short>()
@@ -1,3 +1,5 @@
// FIR_IDENTICAL
import kotlinx.cinterop.*
@Suppress("DEPRECATION")
fun bar(x: Int) = x.narrow<Long>()
@@ -1,3 +1,5 @@
// FIR_IDENTICAL
@file:OptIn(kotlinx.cinterop.ExperimentalForeignApi::class)
import kotlinx.cinterop.*
fun bar(x: Int) = x.convert<String>()
@@ -1,3 +1,5 @@
// FIR_IDENTICAL
@file:OptIn(kotlinx.cinterop.ExperimentalForeignApi::class)
import kotlinx.cinterop.*
class Vertex constructor(rawPtr: NativePtr) : CStructVar(rawPtr) {
@@ -6,5 +8,6 @@ class Vertex constructor(rawPtr: NativePtr) : CStructVar(rawPtr) {
var r: Float = 0f
var g: Float = 0f
var b: Float = 0f
@Suppress("DEPRECATION")
companion object : CStructVar.Type(40, 8)
}
@@ -1,3 +1,4 @@
// FIR_IDENTICAL
import kotlinx.cinterop.*
import kotlin.coroutines.*
@@ -17,6 +18,7 @@ fun startCoroutine(block: suspend () -> Unit) {
block.startCoroutine(EmptyContinuation)
}
@OptIn(kotlinx.cinterop.BetaInteropApi::class)
fun main() {
autoreleasepool {
startCoroutine {
@@ -1,3 +1,4 @@
// FIR_IDENTICAL
import kotlinx.cinterop.*
import kotlin.coroutines.*
@@ -17,8 +18,10 @@ fun startCoroutine(block: suspend () -> Unit) {
block.startCoroutine(EmptyContinuation)
}
@OptIn(kotlinx.cinterop.BetaInteropApi::class)
inline fun <T> myAutoreleasepool(block: () -> T) = autoreleasepool(block)
@OptIn(kotlinx.cinterop.BetaInteropApi::class)
fun main() {
autoreleasepool {
startCoroutine {
@@ -1,7 +1,9 @@
// FIR_IDENTICAL
import kotlinx.cinterop.*
fun foo(f: Function0<*>) = f
@OptIn(kotlinx.cinterop.ExperimentalForeignApi::class)
fun bar() {
staticCFunction(::foo)
}
@@ -1,7 +1,9 @@
// FIR_IDENTICAL
import kotlinx.cinterop.*
fun foo(f: Function0<out Int>) = f
@OptIn(kotlinx.cinterop.ExperimentalForeignApi::class)
fun bar() {
staticCFunction(::foo)
}