diff --git a/backend.native/tests/objcexport/expectedLazy.h b/backend.native/tests/objcexport/expectedLazy.h index 807bc2cd87d..c96ee87923e 100644 --- a/backend.native/tests/objcexport/expectedLazy.h +++ b/backend.native/tests/objcexport/expectedLazy.h @@ -611,6 +611,8 @@ __attribute__((objc_subclassing_restricted)) __attribute__((swift_name("TopLevelManglingAKt"))) @interface KtTopLevelManglingAKt : KtBase + (NSString *)foo __attribute__((swift_name("foo()"))); ++ (int32_t)sameNumberValue:(int32_t)value __attribute__((swift_name("sameNumber(value:)"))); ++ (int64_t)sameNumberValue:(int64_t)value __attribute__((swift_name("sameNumber(value:)"))); @property (class, readonly) NSString *bar __attribute__((swift_name("bar"))); @end; diff --git a/backend.native/tests/objcexport/topLevelMangling.swift b/backend.native/tests/objcexport/topLevelMangling.swift index 09f1762cc86..f22966e8f2e 100644 --- a/backend.native/tests/objcexport/topLevelMangling.swift +++ b/backend.native/tests/objcexport/topLevelMangling.swift @@ -10,11 +10,17 @@ private func testPropertiesInDifferentFilesAreNotMangled() throws { try assertEquals(actual: TopLevelManglingBKt.bar, expected: "b2") } +private func testFunctionsInSameFileAreMangled() throws { + try assertEquals(actual: TopLevelManglingAKt.sameNumber(value: Int32(1)), expected: 1) + try assertEquals(actual: TopLevelManglingAKt.sameNumber(value_: Int64(2)), expected: 2) +} + class TopLevelManglingTests : SimpleTestProvider { override init() { super.init() test("TestFunctionsInDifferentFilesAreNotMangled", testFunctionsInDifferentFilesAreNotMangled) test("TestPropertiesInDifferentFilesAreNotMangled", testPropertiesInDifferentFilesAreNotMangled) + test("TestFunctionsInSameFileAreMangled", testFunctionsInSameFileAreMangled) } } diff --git a/backend.native/tests/objcexport/topLevelManglingA.kt b/backend.native/tests/objcexport/topLevelManglingA.kt index f192fcfac30..870261322bb 100644 --- a/backend.native/tests/objcexport/topLevelManglingA.kt +++ b/backend.native/tests/objcexport/topLevelManglingA.kt @@ -2,3 +2,6 @@ package topLevelManglingA fun foo() = "a1" val bar = "a2" + +fun sameNumber(value: Int) = value +fun sameNumber(value: Long) = value