From baaee2b8161fa8ec21053cdaf8fe0416c5260105 Mon Sep 17 00:00:00 2001 From: Alexander Gorshenev Date: Fri, 23 Feb 2018 15:14:53 +0300 Subject: [PATCH] A test for IrVarargElement and IrSpreadElement serializations. --- backend.native/tests/build.gradle | 6 ++++++ backend.native/tests/serialization/vararg.kt | 9 +++++++++ 2 files changed, 15 insertions(+) create mode 100644 backend.native/tests/serialization/vararg.kt diff --git a/backend.native/tests/build.gradle b/backend.native/tests/build.gradle index f742c5432ad..c14a2aaed28 100644 --- a/backend.native/tests/build.gradle +++ b/backend.native/tests/build.gradle @@ -2228,6 +2228,12 @@ task serialized_doWhile(type: LinkKonanTest) { goldValue = "999\n" } +task serialized_vararg(type: LinkKonanTest) { + source = "serialization/use.kt" + lib = "serialization/vararg.kt" + goldValue = "17\n19\n23\n29\n31\nsize: 5\n" +} + task testing_annotations(type: RunStandaloneKonanTest) { source = "testing/annotations.kt" flags = ['-tr'] diff --git a/backend.native/tests/serialization/vararg.kt b/backend.native/tests/serialization/vararg.kt new file mode 100644 index 00000000000..655362bf541 --- /dev/null +++ b/backend.native/tests/serialization/vararg.kt @@ -0,0 +1,9 @@ +fun bar(vararg x: Int) { + x.forEach { + println(it) + } + println("size: ${x.size}") +} + +inline fun foo() = bar(17, 19, 23, *intArrayOf(29, 31)) +