[K/N] Use ptr-sized types in objc_firendly_dealloc tests
Merge-request: KT-MR-11525 Merged-by: Alexey Glushko <aleksei.glushko@jetbrains.com>
This commit is contained in:
committed by
Space Team
parent
0072189fb1
commit
0a09d1e140
@@ -4146,9 +4146,9 @@ if (PlatformInfo.isAppleTarget(project)) {
|
||||
it.defFile 'interop/objc/kt56402/objclib.def'
|
||||
it.headers "$projectDir/interop/objc/kt56402/objclib.h"
|
||||
}
|
||||
createInterop("objc_autorelease_from_dealloc") {
|
||||
it.defFile 'interop/objc/autorelease_from_dealloc/objclib.def'
|
||||
it.headers "$projectDir/interop/objc/autorelease_from_dealloc/objclib.h"
|
||||
createInterop("objc_friendly_dealloc") {
|
||||
it.defFile 'interop/objc/objc_friendly_dealloc/objclib.def'
|
||||
it.headers "$projectDir/interop/objc/objc_friendly_dealloc/objclib.h"
|
||||
}
|
||||
createInterop("objCAction") {
|
||||
it.defFile 'interop/objc/objCAction/objclib.def'
|
||||
@@ -4947,21 +4947,21 @@ if (PlatformInfo.isAppleTarget(project)) {
|
||||
}
|
||||
}
|
||||
|
||||
interopTest("interop_objc_autorelease_from_dealloc") {
|
||||
interopTest("interop_objc_friendly_dealloc") {
|
||||
enabled = !isNoopGC // requires some GC
|
||||
source = 'interop/objc/autorelease_from_dealloc/main.kt'
|
||||
interop = "objc_autorelease_from_dealloc"
|
||||
source = 'interop/objc/objc_friendly_dealloc/main.kt'
|
||||
interop = "objc_friendly_dealloc"
|
||||
flags = ["-tr"]
|
||||
|
||||
doBeforeBuild {
|
||||
mkdir(buildDir)
|
||||
project.extensions.execClang.execClangForCompilerTests(project.target) {
|
||||
args "$projectDir/interop/objc/autorelease_from_dealloc/objclib.m"
|
||||
args "$projectDir/interop/objc/objc_friendly_dealloc/objclib.m"
|
||||
args "-lobjc", '-fno-objc-arc'
|
||||
args '-fPIC', '-shared', '-o', "$buildDir/libobjc_autorelease_from_dealloc.dylib"
|
||||
args '-fPIC', '-shared', '-o', "$buildDir/libobjc_friendly_dealloc.dylib"
|
||||
}
|
||||
if (UtilsKt.isSimulatorTarget(project, project.target)) {
|
||||
UtilsKt.codesign(project, "$buildDir/libobjc_autorelease_from_dealloc.dylib")
|
||||
UtilsKt.codesign(project, "$buildDir/libobjc_friendly_dealloc.dylib")
|
||||
}
|
||||
}
|
||||
UtilsKt.dependsOnPlatformLibs(it)
|
||||
|
||||
+1
-1
@@ -20,7 +20,7 @@ import kotlinx.cinterop.*
|
||||
|
||||
val timeout = 10.seconds
|
||||
|
||||
fun allocCollectable(ctor: () -> ULong): ULong = autoreleasepool {
|
||||
fun <T> allocCollectable(ctor: () -> T): T = autoreleasepool {
|
||||
ctor()
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,3 +1,3 @@
|
||||
language = Objective-C
|
||||
headerFilter = **/objclib.h
|
||||
linkerOpts = -lobjc_autorelease_from_dealloc
|
||||
linkerOpts = -lobjc_friendly_dealloc
|
||||
+3
-3
@@ -6,6 +6,6 @@
|
||||
-(uintptr_t)identity;
|
||||
@end
|
||||
|
||||
void retain(uint64_t);
|
||||
void release(uint64_t);
|
||||
void autorelease(uint64_t);
|
||||
void retain(uintptr_t);
|
||||
void release(uintptr_t);
|
||||
void autorelease(uintptr_t);
|
||||
+3
-3
@@ -23,14 +23,14 @@
|
||||
|
||||
@end
|
||||
|
||||
void retain(uint64_t obj) {
|
||||
void retain(uintptr_t obj) {
|
||||
[((id) obj) retain];
|
||||
}
|
||||
|
||||
void release(uint64_t obj) {
|
||||
void release(uintptr_t obj) {
|
||||
[((id) obj) release];
|
||||
}
|
||||
|
||||
void autorelease(uint64_t obj) {
|
||||
void autorelease(uintptr_t obj) {
|
||||
[((id) obj) autorelease];
|
||||
}
|
||||
Reference in New Issue
Block a user