From 6bfa710e34d2e6b676f5199ecf8fbe3a91117dd0 Mon Sep 17 00:00:00 2001 From: Elena Lepilkina Date: Tue, 5 Oct 2021 10:21:21 +0300 Subject: [PATCH] [K/N][tests] Added test for @ character in library name --- kotlin-native/backend.native/tests/build.gradle | 6 ++++++ kotlin-native/backend.native/tests/link/klib_name/lib.kt | 8 ++++++++ .../backend.native/tests/link/klib_name/prog.kt | 9 +++++++++ .../backend.native/tests/link/klib_name/prog.out | 1 + 4 files changed, 24 insertions(+) create mode 100644 kotlin-native/backend.native/tests/link/klib_name/lib.kt create mode 100644 kotlin-native/backend.native/tests/link/klib_name/prog.kt create mode 100644 kotlin-native/backend.native/tests/link/klib_name/prog.out diff --git a/kotlin-native/backend.native/tests/build.gradle b/kotlin-native/backend.native/tests/build.gradle index 990ce89c063..1dae9a941fa 100644 --- a/kotlin-native/backend.native/tests/build.gradle +++ b/kotlin-native/backend.native/tests/build.gradle @@ -2428,6 +2428,12 @@ linkTest("no_purge_for_dependencies") { UtilsKt.dependsOnPlatformLibs(it) } +linkTest("lib@name") { + useGoldenData = true + source = "link/klib_name/prog.kt" + lib = "link/klib_name/lib.kt" +} + task for0(type: KonanLocalTest) { useGoldenData = true source = "runtime/basic/for0.kt" diff --git a/kotlin-native/backend.native/tests/link/klib_name/lib.kt b/kotlin-native/backend.native/tests/link/klib_name/lib.kt new file mode 100644 index 00000000000..a266651b0c0 --- /dev/null +++ b/kotlin-native/backend.native/tests/link/klib_name/lib.kt @@ -0,0 +1,8 @@ +/* + * Copyright 2010-2021 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. + */ + +fun foo() { + println("linked library") +} diff --git a/kotlin-native/backend.native/tests/link/klib_name/prog.kt b/kotlin-native/backend.native/tests/link/klib_name/prog.kt new file mode 100644 index 00000000000..07f5d6d4727 --- /dev/null +++ b/kotlin-native/backend.native/tests/link/klib_name/prog.kt @@ -0,0 +1,9 @@ +/* + * Copyright 2010-2021 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. + */ + + +fun main(args: Array) { + foo() +} diff --git a/kotlin-native/backend.native/tests/link/klib_name/prog.out b/kotlin-native/backend.native/tests/link/klib_name/prog.out new file mode 100644 index 00000000000..8db1afa0f58 --- /dev/null +++ b/kotlin-native/backend.native/tests/link/klib_name/prog.out @@ -0,0 +1 @@ +linked library