diff --git a/kotlin-native/backend.native/tests/build.gradle b/kotlin-native/backend.native/tests/build.gradle index 52a44e6f0e1..73edc9962ea 100644 --- a/kotlin-native/backend.native/tests/build.gradle +++ b/kotlin-native/backend.native/tests/build.gradle @@ -3740,6 +3740,10 @@ createInterop("embedStaticLibraries") { it.extraOpts '-staticLibrary', "2.a" } +createInterop("kt43265") { + it.defFile 'interop/kt43265/kt43265.def' +} + if (PlatformInfo.isAppleTarget(project)) { createInterop("objcSmoke") { it.defFile 'interop/objc/objcSmoke.def' @@ -4040,6 +4044,12 @@ interopTest("interop_array_pointers") { source = "interop/basics/arrayPointers.kt" } +interopTest("interop_kt43265") { + disabled = (project.testTarget == 'wasm32') // No interop for wasm yet. + interop = 'kt43265' + source = "interop/kt43265/usage.kt" +} + standaloneTest("interop_pinning") { disabled = (project.testTarget == 'wasm32') // Uses exceptions. source = "interop/basics/pinning.kt" diff --git a/kotlin-native/backend.native/tests/interop/kt43265/kt43265.def b/kotlin-native/backend.native/tests/interop/kt43265/kt43265.def new file mode 100644 index 00000000000..d77837c3eef --- /dev/null +++ b/kotlin-native/backend.native/tests/interop/kt43265/kt43265.def @@ -0,0 +1,7 @@ +strictEnums = bcm2835FunctionSelect +--- +enum bcm2835FunctionSelect { + BCM2835_GPIO_FSEL_INPT = 0x00, BCM2835_GPIO_FSEL_OUTP = 0x01, BCM2835_GPIO_FSEL_ALT0 = 0x04, BCM2835_GPIO_FSEL_ALT1 = 0x05, + BCM2835_GPIO_FSEL_ALT2 = 0x06, BCM2835_GPIO_FSEL_ALT3 = 0x07, BCM2835_GPIO_FSEL_ALT4 = 0x03, BCM2835_GPIO_FSEL_ALT5 = 0x02, + BCM2835_GPIO_FSEL_MASK = 0x07 +}; \ No newline at end of file diff --git a/kotlin-native/backend.native/tests/interop/kt43265/usage.kt b/kotlin-native/backend.native/tests/interop/kt43265/usage.kt new file mode 100644 index 00000000000..7ccdca15207 --- /dev/null +++ b/kotlin-native/backend.native/tests/interop/kt43265/usage.kt @@ -0,0 +1,6 @@ +import kt43265.* +import kotlin.test.* + +fun main() { + assertEquals(bcm2835FunctionSelect.BCM2835_GPIO_FSEL_ALT3, bcm2835FunctionSelect.BCM2835_GPIO_FSEL_MASK) +} \ No newline at end of file