From b70c240f7d81daaadaa7d4e6c99c9bcad1d943fe Mon Sep 17 00:00:00 2001 From: Igor Chevdar Date: Tue, 6 Aug 2019 18:46:29 +0300 Subject: [PATCH] Added test on big arity --- backend.native/tests/build.gradle | 5 +++++ .../codegen/function/referenceBigArity.kt | 21 +++++++++++++++++++ 2 files changed, 26 insertions(+) create mode 100644 backend.native/tests/codegen/function/referenceBigArity.kt diff --git a/backend.native/tests/build.gradle b/backend.native/tests/build.gradle index e95000c6637..c248d8b5447 100644 --- a/backend.native/tests/build.gradle +++ b/backend.native/tests/build.gradle @@ -1855,6 +1855,11 @@ task eqeq(type: KonanLocalTest) { source = "codegen/function/eqeq.kt" } +task function_referenceBigArity(type: KonanLocalTest) { + goldValue = "528\n" + source = "codegen/function/referenceBigArity" +} + task cycle(type: KonanLocalTest) { source = "codegen/cycles/cycle.kt" } diff --git a/backend.native/tests/codegen/function/referenceBigArity.kt b/backend.native/tests/codegen/function/referenceBigArity.kt new file mode 100644 index 00000000000..0490124f03c --- /dev/null +++ b/backend.native/tests/codegen/function/referenceBigArity.kt @@ -0,0 +1,21 @@ +/* + * Copyright 2010-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license + * that can be found in the LICENSE file. + */ + +package codegen.function.referenceBigArity + +import kotlin.test.* + +fun фу(а: Int, б: Int, в: Int, г: Int, д: Int, е: Int, ё: Int, ж: Int, з: Int, и: Int, й: Int, к: Int, + л: Int, м: Int, н: Int, о: Int, п: Int, р: Int, с: Int, т: Int, у: Int, ф: Int, х: Int, ц: Int, + ч: Int, ш: Int, щ: Int, ъ: Int, ы: Int, ь: Int, э: Int, ю: Int, я: Int): Int { + return а + б + в + г + д + е + ё + ж + з + и + й + к + л + м + н + о + + п + р + с + т + у + ф + х + ц + ч + ш + щ + ъ + ы + ь + э + ю + я +} + +@Test fun runTest() { + val ref = ::фу + println(ref(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, + 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32)) +} \ No newline at end of file