[K/N][Tests] Move filecheck and cinterop tests to /native/

^KT-61259
This commit is contained in:
Vladimir Sukharev
2024-02-14 13:07:40 +01:00
committed by Space Team
parent 05cbe66ee0
commit bf0150108d
144 changed files with 1683 additions and 5542 deletions
@@ -0,0 +1,57 @@
/*
* Copyright 2010-2023 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
// TARGET_BACKEND: NATIVE
// MODULE: lib1
// FILE: lib1.def
language=Objective-C
headers=lib1.h
// FILE: lib1.h
@class Foo;
@protocol Bar;
struct Baz;
// MODULE: lib2(lib1)
// FILE: lib2.def
language=Objective-C
headers=lib2.h
// FILE: lib2.h
#import "../lib1/lib1.h"
Foo* createFoo() {
return 0;
}
id<Bar> createBar() {
return 0;
}
struct Baz* createBaz() {
return 0;
}
// MODULE: main(lib1,lib2)
// FILE: main.kt
import kotlinx.cinterop.CPointer
import lib1.*
import lib2.*
import cnames.structs.Baz
import objcnames.classes.Foo
import objcnames.protocols.BarProtocol
@OptIn(kotlinx.cinterop.ExperimentalForeignApi::class)
fun box(): String {
val foo: Foo? = createFoo()
if (foo !== null) return "FAIL 1"
val bar: BarProtocol? = createBar()
if (bar !== null) return "FAIL 2"
val baz: CPointer<Baz>? = createBaz()
if (baz !== null) return "FAIL 3"
return "OK"
}