From a85bf0c5e422c763089ef3a1a2a7aa55db29abda Mon Sep 17 00:00:00 2001 From: Sergey Bogolepov Date: Thu, 30 Jan 2020 11:09:21 +0700 Subject: [PATCH] [Interop][Test] Add test for allocation of vector variable --- backend.native/tests/interop/basics/types.kt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/backend.native/tests/interop/basics/types.kt b/backend.native/tests/interop/basics/types.kt index 2e05122541b..cc50a44a628 100644 --- a/backend.native/tests/interop/basics/types.kt +++ b/backend.native/tests/interop/basics/types.kt @@ -29,5 +29,12 @@ fun main() { assertEquals(49, sendV4I(vectorOf(1, 2, 3, 4))) assertEquals(49, (sendV4F(vectorOf(1f, 2f, 3f, 4f)) + 0.00001).toInt()) + + memScoped { + val vector = alloc().also { + it.value = vectorOf(1, 2, 3, 4) + } + assertEquals(vector.value, vectorOf(1, 2, 3, 4)) + } }