diff --git a/analysis/low-level-api-fir/low-level-api-fir-native/tests-gen/org/jetbrains/kotlin/analysis/low/level/api/fir/konan/compiler/based/LLFirNativeTestGenerated.java b/analysis/low-level-api-fir/low-level-api-fir-native/tests-gen/org/jetbrains/kotlin/analysis/low/level/api/fir/konan/compiler/based/LLFirNativeTestGenerated.java index 7c4fd64eb66..6eed8011fa2 100644 --- a/analysis/low-level-api-fir/low-level-api-fir-native/tests-gen/org/jetbrains/kotlin/analysis/low/level/api/fir/konan/compiler/based/LLFirNativeTestGenerated.java +++ b/analysis/low-level-api-fir/low-level-api-fir-native/tests-gen/org/jetbrains/kotlin/analysis/low/level/api/fir/konan/compiler/based/LLFirNativeTestGenerated.java @@ -115,4 +115,464 @@ public class LLFirNativeTestGenerated extends AbstractLLFirNativeTest { public void testTopLevelSingleton() throws Exception { runTest("compiler/testData/diagnostics/nativeTests/topLevelSingleton.kt"); } + + @Nested + @TestMetadata("compiler/testData/diagnostics/nativeTests/specialBackendChecks") + @TestDataPath("$PROJECT_ROOT") + @Tag("llFirNative") + public class SpecialBackendChecks { + @Test + public void testAllFilesPresentInSpecialBackendChecks() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/nativeTests/specialBackendChecks"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.(reversed|fir|ll)\\.kts?$"), true); + } + + @Nested + @TestMetadata("compiler/testData/diagnostics/nativeTests/specialBackendChecks/cInterop") + @TestDataPath("$PROJECT_ROOT") + @Tag("llFirNative") + public class CInterop { + @Test + public void testAllFilesPresentInCInterop() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/nativeTests/specialBackendChecks/cInterop"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.(reversed|fir|ll)\\.kts?$"), true); + } + + @Test + @TestMetadata("t1.kt") + public void testT1() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/cInterop/t1.kt"); + } + + @Test + @TestMetadata("t10.kt") + public void testT10() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/cInterop/t10.kt"); + } + + @Test + @TestMetadata("t11.kt") + public void testT11() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/cInterop/t11.kt"); + } + + @Test + @TestMetadata("t12.kt") + public void testT12() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/cInterop/t12.kt"); + } + + @Test + @TestMetadata("t13.kt") + public void testT13() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/cInterop/t13.kt"); + } + + @Test + @TestMetadata("t14.kt") + public void testT14() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/cInterop/t14.kt"); + } + + @Test + @TestMetadata("t37.kt") + public void testT37() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/cInterop/t37.kt"); + } + + @Test + @TestMetadata("t38.kt") + public void testT38() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/cInterop/t38.kt"); + } + + @Test + @TestMetadata("t40.kt") + public void testT40() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/cInterop/t40.kt"); + } + + @Test + @TestMetadata("t41.kt") + public void testT41() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/cInterop/t41.kt"); + } + + @Test + @TestMetadata("t42.kt") + public void testT42() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/cInterop/t42.kt"); + } + + @Test + @TestMetadata("t43.kt") + public void testT43() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/cInterop/t43.kt"); + } + + @Test + @TestMetadata("t44.kt") + public void testT44() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/cInterop/t44.kt"); + } + + @Test + @TestMetadata("t45.kt") + public void testT45() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/cInterop/t45.kt"); + } + + @Test + @TestMetadata("t46.kt") + public void testT46() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/cInterop/t46.kt"); + } + + @Test + @TestMetadata("t47.kt") + public void testT47() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/cInterop/t47.kt"); + } + + @Test + @TestMetadata("t60.kt") + public void testT60() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/cInterop/t60.kt"); + } + + @Test + @TestMetadata("t63.kt") + public void testT63() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/cInterop/t63.kt"); + } + + @Test + @TestMetadata("t64.kt") + public void testT64() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/cInterop/t64.kt"); + } + + @Test + @TestMetadata("t8.kt") + public void testT8() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/cInterop/t8.kt"); + } + + @Test + @TestMetadata("t9.kt") + public void testT9() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/cInterop/t9.kt"); + } + } + + @Nested + @TestMetadata("compiler/testData/diagnostics/nativeTests/specialBackendChecks/concurrent") + @TestDataPath("$PROJECT_ROOT") + @Tag("llFirNative") + public class Concurrent { + @Test + public void testAllFilesPresentInConcurrent() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/nativeTests/specialBackendChecks/concurrent"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.(reversed|fir|ll)\\.kts?$"), true); + } + + @Test + @TestMetadata("t48.kt") + public void testT48() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/concurrent/t48.kt"); + } + + @Test + @TestMetadata("t49.kt") + public void testT49() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/concurrent/t49.kt"); + } + + @Test + @TestMetadata("t50.kt") + public void testT50() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/concurrent/t50.kt"); + } + + @Test + @TestMetadata("t51.kt") + public void testT51() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/concurrent/t51.kt"); + } + } + + @Nested + @TestMetadata("compiler/testData/diagnostics/nativeTests/specialBackendChecks/immutableBlobOf") + @TestDataPath("$PROJECT_ROOT") + @Tag("llFirNative") + public class ImmutableBlobOf { + @Test + public void testAllFilesPresentInImmutableBlobOf() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/nativeTests/specialBackendChecks/immutableBlobOf"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.(reversed|fir|ll)\\.kts?$"), true); + } + + @Test + @TestMetadata("t54.kt") + public void testT54() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/immutableBlobOf/t54.kt"); + } + + @Test + @TestMetadata("t55.kt") + public void testT55() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/immutableBlobOf/t55.kt"); + } + + @Test + @TestMetadata("t56.kt") + public void testT56() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/immutableBlobOf/t56.kt"); + } + + @Test + @TestMetadata("t57.kt") + public void testT57() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/immutableBlobOf/t57.kt"); + } + } + + @Nested + @TestMetadata("compiler/testData/diagnostics/nativeTests/specialBackendChecks/nativeRef") + @TestDataPath("$PROJECT_ROOT") + @Tag("llFirNative") + public class NativeRef { + @Test + public void testAllFilesPresentInNativeRef() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/nativeTests/specialBackendChecks/nativeRef"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.(reversed|fir|ll)\\.kts?$"), true); + } + + @Test + @TestMetadata("t52.kt") + public void testT52() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/nativeRef/t52.kt"); + } + + @Test + @TestMetadata("t53.kt") + public void testT53() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/nativeRef/t53.kt"); + } + } + + @Nested + @TestMetadata("compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop") + @TestDataPath("$PROJECT_ROOT") + @Tag("llFirNative") + public class ObjCInterop { + @Test + public void testAllFilesPresentInObjCInterop() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.(reversed|fir|ll)\\.kts?$"), true); + } + + @Test + @TestMetadata("t15.kt") + public void testT15() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t15.kt"); + } + + @Test + @TestMetadata("t16.kt") + public void testT16() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t16.kt"); + } + + @Test + @TestMetadata("t17.kt") + public void testT17() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t17.kt"); + } + + @Test + @TestMetadata("t18.kt") + public void testT18() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t18.kt"); + } + + @Test + @TestMetadata("t2.kt") + public void testT2() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t2.kt"); + } + + @Test + @TestMetadata("t20.kt") + public void testT20() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t20.kt"); + } + + @Test + @TestMetadata("t21.kt") + public void testT21() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t21.kt"); + } + + @Test + @TestMetadata("t22.kt") + public void testT22() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t22.kt"); + } + + @Test + @TestMetadata("t23.kt") + public void testT23() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t23.kt"); + } + + @Test + @TestMetadata("t24.kt") + public void testT24() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t24.kt"); + } + + @Test + @TestMetadata("t25.kt") + public void testT25() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t25.kt"); + } + + @Test + @TestMetadata("t26.kt") + public void testT26() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t26.kt"); + } + + @Test + @TestMetadata("t27.kt") + public void testT27() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t27.kt"); + } + + @Test + @TestMetadata("t28.kt") + public void testT28() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t28.kt"); + } + + @Test + @TestMetadata("t29.kt") + public void testT29() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t29.kt"); + } + + @Test + @TestMetadata("t30.kt") + public void testT30() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t30.kt"); + } + + @Test + @TestMetadata("t31.kt") + public void testT31() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t31.kt"); + } + + @Test + @TestMetadata("t32.kt") + public void testT32() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t32.kt"); + } + + @Test + @TestMetadata("t33.kt") + public void testT33() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t33.kt"); + } + + @Test + @TestMetadata("t34.kt") + public void testT34() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t34.kt"); + } + + @Test + @TestMetadata("t35.kt") + public void testT35() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t35.kt"); + } + + @Test + @TestMetadata("t4.kt") + public void testT4() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t4.kt"); + } + + @Test + @TestMetadata("t5.kt") + public void testT5() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t5.kt"); + } + + @Test + @TestMetadata("t6.kt") + public void testT6() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t6.kt"); + } + + @Test + @TestMetadata("t61.kt") + public void testT61() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t61.kt"); + } + + @Test + @TestMetadata("t62.kt") + public void testT62() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t62.kt"); + } + + @Test + @TestMetadata("t7.kt") + public void testT7() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t7.kt"); + } + } + + @Nested + @TestMetadata("compiler/testData/diagnostics/nativeTests/specialBackendChecks/posix") + @TestDataPath("$PROJECT_ROOT") + @Tag("llFirNative") + public class Posix { + @Test + public void testAllFilesPresentInPosix() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/nativeTests/specialBackendChecks/posix"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.(reversed|fir|ll)\\.kts?$"), true); + } + + @Test + @TestMetadata("t3.kt") + public void testT3() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/posix/t3.kt"); + } + + @Test + @TestMetadata("t36.kt") + public void testT36() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/posix/t36.kt"); + } + } + + @Nested + @TestMetadata("compiler/testData/diagnostics/nativeTests/specialBackendChecks/reflect") + @TestDataPath("$PROJECT_ROOT") + @Tag("llFirNative") + public class Reflect { + @Test + public void testAllFilesPresentInReflect() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/nativeTests/specialBackendChecks/reflect"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.(reversed|fir|ll)\\.kts?$"), true); + } + + @Test + @TestMetadata("t58.kt") + public void testT58() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/reflect/t58.kt"); + } + + @Test + @TestMetadata("t59.kt") + public void testT59() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/reflect/t59.kt"); + } + } + } } diff --git a/analysis/low-level-api-fir/low-level-api-fir-native/tests-gen/org/jetbrains/kotlin/analysis/low/level/api/fir/konan/compiler/based/LLFirReversedNativeTestGenerated.java b/analysis/low-level-api-fir/low-level-api-fir-native/tests-gen/org/jetbrains/kotlin/analysis/low/level/api/fir/konan/compiler/based/LLFirReversedNativeTestGenerated.java index cc0ae8c2029..2c1f480893a 100644 --- a/analysis/low-level-api-fir/low-level-api-fir-native/tests-gen/org/jetbrains/kotlin/analysis/low/level/api/fir/konan/compiler/based/LLFirReversedNativeTestGenerated.java +++ b/analysis/low-level-api-fir/low-level-api-fir-native/tests-gen/org/jetbrains/kotlin/analysis/low/level/api/fir/konan/compiler/based/LLFirReversedNativeTestGenerated.java @@ -115,4 +115,464 @@ public class LLFirReversedNativeTestGenerated extends AbstractLLFirReversedNativ public void testTopLevelSingleton() throws Exception { runTest("compiler/testData/diagnostics/nativeTests/topLevelSingleton.kt"); } + + @Nested + @TestMetadata("compiler/testData/diagnostics/nativeTests/specialBackendChecks") + @TestDataPath("$PROJECT_ROOT") + @Tag("llFirNative") + public class SpecialBackendChecks { + @Test + public void testAllFilesPresentInSpecialBackendChecks() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/nativeTests/specialBackendChecks"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.(reversed|fir|ll)\\.kts?$"), true); + } + + @Nested + @TestMetadata("compiler/testData/diagnostics/nativeTests/specialBackendChecks/cInterop") + @TestDataPath("$PROJECT_ROOT") + @Tag("llFirNative") + public class CInterop { + @Test + public void testAllFilesPresentInCInterop() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/nativeTests/specialBackendChecks/cInterop"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.(reversed|fir|ll)\\.kts?$"), true); + } + + @Test + @TestMetadata("t1.kt") + public void testT1() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/cInterop/t1.kt"); + } + + @Test + @TestMetadata("t10.kt") + public void testT10() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/cInterop/t10.kt"); + } + + @Test + @TestMetadata("t11.kt") + public void testT11() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/cInterop/t11.kt"); + } + + @Test + @TestMetadata("t12.kt") + public void testT12() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/cInterop/t12.kt"); + } + + @Test + @TestMetadata("t13.kt") + public void testT13() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/cInterop/t13.kt"); + } + + @Test + @TestMetadata("t14.kt") + public void testT14() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/cInterop/t14.kt"); + } + + @Test + @TestMetadata("t37.kt") + public void testT37() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/cInterop/t37.kt"); + } + + @Test + @TestMetadata("t38.kt") + public void testT38() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/cInterop/t38.kt"); + } + + @Test + @TestMetadata("t40.kt") + public void testT40() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/cInterop/t40.kt"); + } + + @Test + @TestMetadata("t41.kt") + public void testT41() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/cInterop/t41.kt"); + } + + @Test + @TestMetadata("t42.kt") + public void testT42() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/cInterop/t42.kt"); + } + + @Test + @TestMetadata("t43.kt") + public void testT43() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/cInterop/t43.kt"); + } + + @Test + @TestMetadata("t44.kt") + public void testT44() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/cInterop/t44.kt"); + } + + @Test + @TestMetadata("t45.kt") + public void testT45() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/cInterop/t45.kt"); + } + + @Test + @TestMetadata("t46.kt") + public void testT46() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/cInterop/t46.kt"); + } + + @Test + @TestMetadata("t47.kt") + public void testT47() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/cInterop/t47.kt"); + } + + @Test + @TestMetadata("t60.kt") + public void testT60() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/cInterop/t60.kt"); + } + + @Test + @TestMetadata("t63.kt") + public void testT63() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/cInterop/t63.kt"); + } + + @Test + @TestMetadata("t64.kt") + public void testT64() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/cInterop/t64.kt"); + } + + @Test + @TestMetadata("t8.kt") + public void testT8() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/cInterop/t8.kt"); + } + + @Test + @TestMetadata("t9.kt") + public void testT9() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/cInterop/t9.kt"); + } + } + + @Nested + @TestMetadata("compiler/testData/diagnostics/nativeTests/specialBackendChecks/concurrent") + @TestDataPath("$PROJECT_ROOT") + @Tag("llFirNative") + public class Concurrent { + @Test + public void testAllFilesPresentInConcurrent() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/nativeTests/specialBackendChecks/concurrent"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.(reversed|fir|ll)\\.kts?$"), true); + } + + @Test + @TestMetadata("t48.kt") + public void testT48() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/concurrent/t48.kt"); + } + + @Test + @TestMetadata("t49.kt") + public void testT49() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/concurrent/t49.kt"); + } + + @Test + @TestMetadata("t50.kt") + public void testT50() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/concurrent/t50.kt"); + } + + @Test + @TestMetadata("t51.kt") + public void testT51() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/concurrent/t51.kt"); + } + } + + @Nested + @TestMetadata("compiler/testData/diagnostics/nativeTests/specialBackendChecks/immutableBlobOf") + @TestDataPath("$PROJECT_ROOT") + @Tag("llFirNative") + public class ImmutableBlobOf { + @Test + public void testAllFilesPresentInImmutableBlobOf() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/nativeTests/specialBackendChecks/immutableBlobOf"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.(reversed|fir|ll)\\.kts?$"), true); + } + + @Test + @TestMetadata("t54.kt") + public void testT54() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/immutableBlobOf/t54.kt"); + } + + @Test + @TestMetadata("t55.kt") + public void testT55() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/immutableBlobOf/t55.kt"); + } + + @Test + @TestMetadata("t56.kt") + public void testT56() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/immutableBlobOf/t56.kt"); + } + + @Test + @TestMetadata("t57.kt") + public void testT57() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/immutableBlobOf/t57.kt"); + } + } + + @Nested + @TestMetadata("compiler/testData/diagnostics/nativeTests/specialBackendChecks/nativeRef") + @TestDataPath("$PROJECT_ROOT") + @Tag("llFirNative") + public class NativeRef { + @Test + public void testAllFilesPresentInNativeRef() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/nativeTests/specialBackendChecks/nativeRef"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.(reversed|fir|ll)\\.kts?$"), true); + } + + @Test + @TestMetadata("t52.kt") + public void testT52() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/nativeRef/t52.kt"); + } + + @Test + @TestMetadata("t53.kt") + public void testT53() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/nativeRef/t53.kt"); + } + } + + @Nested + @TestMetadata("compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop") + @TestDataPath("$PROJECT_ROOT") + @Tag("llFirNative") + public class ObjCInterop { + @Test + public void testAllFilesPresentInObjCInterop() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.(reversed|fir|ll)\\.kts?$"), true); + } + + @Test + @TestMetadata("t15.kt") + public void testT15() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t15.kt"); + } + + @Test + @TestMetadata("t16.kt") + public void testT16() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t16.kt"); + } + + @Test + @TestMetadata("t17.kt") + public void testT17() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t17.kt"); + } + + @Test + @TestMetadata("t18.kt") + public void testT18() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t18.kt"); + } + + @Test + @TestMetadata("t2.kt") + public void testT2() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t2.kt"); + } + + @Test + @TestMetadata("t20.kt") + public void testT20() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t20.kt"); + } + + @Test + @TestMetadata("t21.kt") + public void testT21() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t21.kt"); + } + + @Test + @TestMetadata("t22.kt") + public void testT22() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t22.kt"); + } + + @Test + @TestMetadata("t23.kt") + public void testT23() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t23.kt"); + } + + @Test + @TestMetadata("t24.kt") + public void testT24() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t24.kt"); + } + + @Test + @TestMetadata("t25.kt") + public void testT25() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t25.kt"); + } + + @Test + @TestMetadata("t26.kt") + public void testT26() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t26.kt"); + } + + @Test + @TestMetadata("t27.kt") + public void testT27() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t27.kt"); + } + + @Test + @TestMetadata("t28.kt") + public void testT28() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t28.kt"); + } + + @Test + @TestMetadata("t29.kt") + public void testT29() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t29.kt"); + } + + @Test + @TestMetadata("t30.kt") + public void testT30() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t30.kt"); + } + + @Test + @TestMetadata("t31.kt") + public void testT31() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t31.kt"); + } + + @Test + @TestMetadata("t32.kt") + public void testT32() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t32.kt"); + } + + @Test + @TestMetadata("t33.kt") + public void testT33() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t33.kt"); + } + + @Test + @TestMetadata("t34.kt") + public void testT34() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t34.kt"); + } + + @Test + @TestMetadata("t35.kt") + public void testT35() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t35.kt"); + } + + @Test + @TestMetadata("t4.kt") + public void testT4() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t4.kt"); + } + + @Test + @TestMetadata("t5.kt") + public void testT5() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t5.kt"); + } + + @Test + @TestMetadata("t6.kt") + public void testT6() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t6.kt"); + } + + @Test + @TestMetadata("t61.kt") + public void testT61() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t61.kt"); + } + + @Test + @TestMetadata("t62.kt") + public void testT62() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t62.kt"); + } + + @Test + @TestMetadata("t7.kt") + public void testT7() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t7.kt"); + } + } + + @Nested + @TestMetadata("compiler/testData/diagnostics/nativeTests/specialBackendChecks/posix") + @TestDataPath("$PROJECT_ROOT") + @Tag("llFirNative") + public class Posix { + @Test + public void testAllFilesPresentInPosix() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/nativeTests/specialBackendChecks/posix"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.(reversed|fir|ll)\\.kts?$"), true); + } + + @Test + @TestMetadata("t3.kt") + public void testT3() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/posix/t3.kt"); + } + + @Test + @TestMetadata("t36.kt") + public void testT36() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/posix/t36.kt"); + } + } + + @Nested + @TestMetadata("compiler/testData/diagnostics/nativeTests/specialBackendChecks/reflect") + @TestDataPath("$PROJECT_ROOT") + @Tag("llFirNative") + public class Reflect { + @Test + public void testAllFilesPresentInReflect() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/nativeTests/specialBackendChecks/reflect"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.(reversed|fir|ll)\\.kts?$"), true); + } + + @Test + @TestMetadata("t58.kt") + public void testT58() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/reflect/t58.kt"); + } + + @Test + @TestMetadata("t59.kt") + public void testT59() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/reflect/t59.kt"); + } + } + } } diff --git a/compiler/ir/serialization.common/src/org/jetbrains/kotlin/backend/common/CommonKLibResolver.kt b/compiler/ir/serialization.common/src/org/jetbrains/kotlin/backend/common/CommonKLibResolver.kt index 89f317af018..d92c2e1efd2 100644 --- a/compiler/ir/serialization.common/src/org/jetbrains/kotlin/backend/common/CommonKLibResolver.kt +++ b/compiler/ir/serialization.common/src/org/jetbrains/kotlin/backend/common/CommonKLibResolver.kt @@ -22,12 +22,14 @@ object CommonKLibResolver { logger: Logger, zipAccessor: ZipFileSystemAccessor? = null, lenient: Boolean = false, + knownIrProviders: List = listOf(), ): KotlinLibraryResolveResult = resolveWithoutDependencies( libraries, logger, zipAccessor, lenient, + knownIrProviders, ).resolveWithDependencies() fun resolveWithoutDependencies( @@ -35,6 +37,7 @@ object CommonKLibResolver { logger: Logger, zipAccessor: ZipFileSystemAccessor?, lenient: Boolean = false, + knownIrProviders: List = listOf(), ): KLibResolution { val unresolvedLibraries = libraries.map { UnresolvedLibrary(it, null, lenient) } val libraryAbsolutePaths = libraries.map { File(it).absolutePath } @@ -46,7 +49,8 @@ object CommonKLibResolver { localKotlinDir = null, skipCurrentDir = false, logger = logger, - zipAccessor = zipAccessor + zipAccessor = zipAccessor, + knownIrProviders = knownIrProviders, ).libraryResolver() return KLibResolution( @@ -79,7 +83,8 @@ private class KLibResolverHelper( localKotlinDir: String?, skipCurrentDir: Boolean, logger: Logger, - private val zipAccessor: ZipFileSystemAccessor? + private val zipAccessor: ZipFileSystemAccessor?, + knownIrProviders: List, ) : KotlinLibraryProperResolverWithAttributes( repositories, directLibs, @@ -87,7 +92,7 @@ private class KLibResolverHelper( localKotlinDir, skipCurrentDir, logger, - emptyList() + knownIrProviders, ) { // Stick with the default KotlinLibrary for now. override fun libraryComponentBuilder(file: File, isDefault: Boolean) = createKotlinLibraryComponents(file, isDefault, zipAccessor) diff --git a/compiler/test-infrastructure/tests/org/jetbrains/kotlin/test/directives/ConfigurationDirectives.kt b/compiler/test-infrastructure/tests/org/jetbrains/kotlin/test/directives/ConfigurationDirectives.kt index 1fabe55222a..eb8081e6f99 100644 --- a/compiler/test-infrastructure/tests/org/jetbrains/kotlin/test/directives/ConfigurationDirectives.kt +++ b/compiler/test-infrastructure/tests/org/jetbrains/kotlin/test/directives/ConfigurationDirectives.kt @@ -13,4 +13,6 @@ object ConfigurationDirectives : SimpleDirectivesContainer() { ) val WITH_STDLIB by directive("Add Kotlin stdlib to classpath") + + val WITH_PLATFORM_LIBS by directive("Add platform libs to classpath") } diff --git a/compiler/testData/diagnostics/nativeTests/specialBackendChecks/README.md b/compiler/testData/diagnostics/nativeTests/specialBackendChecks/README.md index f6d16655416..8d38836c26a 100644 --- a/compiler/testData/diagnostics/nativeTests/specialBackendChecks/README.md +++ b/compiler/testData/diagnostics/nativeTests/specialBackendChecks/README.md @@ -1,10 +1,10 @@ This testsuit fir specialBackendChecks on Mac hosts relies on platform libs are installed. To run testsuit locally, make sure the above is executed first: -- `./gradlew :kotlin-native:platformLibs:macos_arm64Install` or +- `./gradlew :kotlin-native:platformLibs:macos_arm64Install` or - `./gradlew :kotlin-native:platformLibs:macos_x64Install` This testsuit is run differently for K1 and K2 frontends: -- K1/N manual: run `compiler/testData/diagnostics/nativeTests/specialBackendChecks/runtests.sh -language-version 1.9`, +- K1/N manual: run `compiler/testData/diagnostics/nativeTests/specialBackendChecks/runtests.sh -language-version 1.9`, - K2/N manual: run `compiler/testData/diagnostics/nativeTests/specialBackendChecks/runtests.sh`, - K2/N tests are also run in scope of `FirLightTreeOldFrontendNativeDiagnosticsTestGenerated` and `FirPsiOldFrontendNativeDiagnosticsTestGenerated`. @@ -57,4 +57,100 @@ compiler/testData/diagnostics/nativeTests/specialBackendChecks/cInterop/t64.kt compiler/testData/diagnostics/nativeTests/specialBackendChecks/cInterop/t8.kt /tmp/t8.kt:8:5: error: type kotlin.Function0<*> of callback parameter 1 is not supported here: * as return type compiler/testData/diagnostics/nativeTests/specialBackendChecks/cInterop/t9.kt +/tmp/t41.kt:9:5: error: kotlinx.cinterop.staticCFunction must take an unbound, non-capturing function or lambda, but captures at: + /tmp/t41.kt:7:17: x +compiler/testData/diagnostics/nativeTests/specialBackendChecks/concurrent/t48.kt +/tmp/t48.kt:11:12: error: kotlin.native.concurrent.Worker.execute must take an unbound, non-capturing function or lambda, but captures at: + /tmp/t48.kt:11:50 +compiler/testData/diagnostics/nativeTests/specialBackendChecks/concurrent/t49.kt +/tmp/t49.kt:7:12: error: kotlin.native.concurrent.Worker.execute must take an unbound, non-capturing function or lambda, but captures at: + /tmp/t49.kt:7:61: x +compiler/testData/diagnostics/nativeTests/specialBackendChecks/concurrent/t50.kt +/tmp/t50.kt:12:16: error: kotlin.native.concurrent.Worker.execute must take an unbound, non-capturing function or lambda, but captures at: + /tmp/t50.kt:12:54 +compiler/testData/diagnostics/nativeTests/specialBackendChecks/concurrent/t51.kt +/tmp/t51.kt:10:28: error: kotlin.native.concurrent.Worker.execute must take an unbound, non-capturing function or lambda, but captures at: + /tmp/t51.kt:10:66 +compiler/testData/diagnostics/nativeTests/specialBackendChecks/immutableBlobOf/t54.kt +/tmp/t54.kt:2:44: error: no spread elements allowed here +compiler/testData/diagnostics/nativeTests/specialBackendChecks/immutableBlobOf/t55.kt +/tmp/t55.kt:2:37: error: all elements of binary blob must be constants +compiler/testData/diagnostics/nativeTests/specialBackendChecks/immutableBlobOf/t56.kt +/tmp/t56.kt:2:29: error: incorrect value for binary data: 1000 +compiler/testData/diagnostics/nativeTests/specialBackendChecks/immutableBlobOf/t57.kt +/tmp/t57.kt:2:13: error: expected at least one element +compiler/testData/diagnostics/nativeTests/specialBackendChecks/nativeRef/t52.kt +/tmp/t52.kt:6:5: error: kotlin.native.ref.createCleaner must take an unbound, non-capturing function or lambda, but captures at: + /tmp/t52.kt:6:33: x +compiler/testData/diagnostics/nativeTests/specialBackendChecks/nativeRef/t53.kt +/tmp/t53.kt:10:5: error: kotlin.native.ref.createCleaner must take an unbound, non-capturing function or lambda, but captures at: + /tmp/t53.kt:10:23 +compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t15.kt +/tmp/t15.kt:6:26: error: type kotlin.Function0 is not supported here: not supported as variadic argument +compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t16.kt +/tmp/t16.kt:8:26: error: type .Z is not supported here: doesn't correspond to any C type +compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t17.kt +/tmp/t17.kt:8:15: error: super calls to Objective-C protocols are not allowed +compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t18.kt +/tmp/t18.kt:8:19: error: super calls to Objective-C meta classes are not supported yet +compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t2.kt +/tmp/t2.kt:6:5: error: 'handleFailureInFunction' overrides nothing. + override fun handleFailureInFunction(functionName: String, file: String, lineNumber: NSInteger /* = Long */, description: String?, vararg args: Any?) { } + ^ +compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t20.kt +/tmp/t20.kt:6:1: error: only classes are supported as subtypes of Objective-C types +compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t21.kt +/tmp/t21.kt:6:1: error: non-final Kotlin subclasses of Objective-C classes are not yet supported +compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t22.kt +/tmp/t22.kt:6:1: error: fields are not supported for Companion of subclass of ObjC type +compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t23.kt +/tmp/t23.kt:8:1: error: mixing Kotlin and Objective-C supertypes is not supported +compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t24.kt +/tmp/t24.kt:6:1: error: only companion objects of subclasses of Objective-C classes can inherit from Objective-C metaclasses +compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t25.kt +/tmp/t25.kt:7:5: error: can't override 'toString', override 'description' instead +compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t26.kt +/tmp/t26.kt:11:9: error: @kotlinx.cinterop.ObjCAction method must not have extension receiver +compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t27.kt +/tmp/t27.kt:11:13: error: unexpected @kotlinx.cinterop.ObjCAction method parameter type: kotlin.String +Only Objective-C object types are supported here +compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t28.kt +/tmp/t28.kt:8:5: error: unexpected @kotlinx.cinterop.ObjCAction method return type: kotlin.Int +Only 'Unit' is supported here +compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t29.kt +/tmp/t29.kt:9:5: error: @kotlinx.cinterop.ObjCOutlet property must be var +compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t30.kt +/tmp/t30.kt:10:9: error: @kotlinx.cinterop.ObjCOutlet must not have extension receiver +compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t31.kt +/tmp/t31.kt:8:5: error: unexpected @kotlinx.cinterop.ObjCOutlet type: kotlin.String +Only Objective-C object types are supported here +compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t32.kt +/tmp/t32.kt:8:5: error: constructor with @kotlinx.cinterop.ObjCObjectBase.OverrideInit doesn't override any super class constructor. +It must completely match by parameter names and types. +compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t33.kt +/tmp/t33.kt:8:5: error: constructor with @kotlinx.cinterop.ObjCObjectBase.OverrideInit overrides initializer that is already overridden explicitly +compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t34.kt +/tmp/t34.kt:8:5: error: only 0, 1 or 2 parameters are supported here +compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t35.kt +/tmp/t35.kt:7:13: error: unable to call non-designated initializer as super constructor +compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t4.kt +/tmp/t4.kt:6:21: error: callable references to variadic Objective-C methods are not supported +compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t5.kt +/tmp/t5.kt:6:82: error: passing String as variadic Objective-C argument is ambiguous; cast it to NSString or pass with '.cstr' as C string +compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t6.kt +/tmp/t6.kt:6:96: error: when calling variadic Objective-C methods spread operator is supported only for *arrayOf(...) +compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t61.kt +/tmp/t61.kt:4:5: error: only companion objects of subclasses of Objective-C classes can inherit from Objective-C metaclasses +compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t62.kt +/tmp/t62.kt:3:1: error: only companion objects of subclasses of Objective-C classes can inherit from Objective-C metaclasses +compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t7.kt +/tmp/t7.kt:6:40: error: when calling variadic C functions spread operator is supported only for *arrayOf(...) +compiler/testData/diagnostics/nativeTests/specialBackendChecks/posix/t3.kt +/tmp/t3.kt:6:13: error: callable references to variadic C functions are not supported +compiler/testData/diagnostics/nativeTests/specialBackendChecks/posix/t36.kt +/tmp/t36.kt:6:13: error: native interop types constructors must not be called directly +compiler/testData/diagnostics/nativeTests/specialBackendChecks/reflect/t58.kt +/tmp/t58.kt:6:5: error: non-reified type parameters with recursive bounds are not supported yet: TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Comparable.foo>] reified:false +compiler/testData/diagnostics/nativeTests/specialBackendChecks/reflect/t59.kt +/tmp/t59.kt:6:5: error: non-reified type parameters with recursive bounds are not supported yet: TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Comparable.foo>] reified:false ``` \ No newline at end of file diff --git a/compiler/testData/diagnostics/nativeTests/specialBackendChecks/cInterop/t1.kt b/compiler/testData/diagnostics/nativeTests/specialBackendChecks/cInterop/t1.kt index e81a3254c87..032442baeb5 100644 --- a/compiler/testData/diagnostics/nativeTests/specialBackendChecks/cInterop/t1.kt +++ b/compiler/testData/diagnostics/nativeTests/specialBackendChecks/cInterop/t1.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL import kotlinx.cinterop.* fun foo(x: Int, vararg s: String): Int { @@ -6,6 +7,7 @@ fun foo(x: Int, vararg s: String): Int { return sum } +@OptIn(kotlinx.cinterop.ExperimentalForeignApi::class) fun bar() { staticCFunction(::foo) } diff --git a/compiler/testData/diagnostics/nativeTests/specialBackendChecks/cInterop/t10.kt b/compiler/testData/diagnostics/nativeTests/specialBackendChecks/cInterop/t10.kt index fbbbba0954a..f8ba0b14799 100644 --- a/compiler/testData/diagnostics/nativeTests/specialBackendChecks/cInterop/t10.kt +++ b/compiler/testData/diagnostics/nativeTests/specialBackendChecks/cInterop/t10.kt @@ -1,7 +1,9 @@ +// FIR_IDENTICAL import kotlinx.cinterop.* fun foo(f: Function1<*, Int>) = f +@OptIn(kotlinx.cinterop.ExperimentalForeignApi::class) fun bar() { staticCFunction(::foo) } diff --git a/compiler/testData/diagnostics/nativeTests/specialBackendChecks/cInterop/t11.kt b/compiler/testData/diagnostics/nativeTests/specialBackendChecks/cInterop/t11.kt index 707553a0c4b..be05209d754 100644 --- a/compiler/testData/diagnostics/nativeTests/specialBackendChecks/cInterop/t11.kt +++ b/compiler/testData/diagnostics/nativeTests/specialBackendChecks/cInterop/t11.kt @@ -1,7 +1,9 @@ +// FIR_IDENTICAL import kotlinx.cinterop.* fun foo(f: Function1) = f +@OptIn(kotlinx.cinterop.ExperimentalForeignApi::class) fun bar() { staticCFunction(::foo) } diff --git a/compiler/testData/diagnostics/nativeTests/specialBackendChecks/cInterop/t12.kt b/compiler/testData/diagnostics/nativeTests/specialBackendChecks/cInterop/t12.kt index b904dae2d67..7bd311b852a 100644 --- a/compiler/testData/diagnostics/nativeTests/specialBackendChecks/cInterop/t12.kt +++ b/compiler/testData/diagnostics/nativeTests/specialBackendChecks/cInterop/t12.kt @@ -1,3 +1,5 @@ +// FIR_IDENTICAL +@file:OptIn(kotlinx.cinterop.ExperimentalForeignApi::class) import kotlinx.cinterop.* fun foo(x: CValue<*>?) = x diff --git a/compiler/testData/diagnostics/nativeTests/specialBackendChecks/cInterop/t13.kt b/compiler/testData/diagnostics/nativeTests/specialBackendChecks/cInterop/t13.kt index 0874088c4c9..df7ab240db7 100644 --- a/compiler/testData/diagnostics/nativeTests/specialBackendChecks/cInterop/t13.kt +++ b/compiler/testData/diagnostics/nativeTests/specialBackendChecks/cInterop/t13.kt @@ -1,5 +1,7 @@ +// FIR_IDENTICAL import kotlinx.cinterop.* +@OptIn(kotlinx.cinterop.ExperimentalForeignApi::class) fun bar() { fun foo(x: CValue) = x diff --git a/compiler/testData/diagnostics/nativeTests/specialBackendChecks/cInterop/t14.kt b/compiler/testData/diagnostics/nativeTests/specialBackendChecks/cInterop/t14.kt index 05f27179537..0910d33b40c 100644 --- a/compiler/testData/diagnostics/nativeTests/specialBackendChecks/cInterop/t14.kt +++ b/compiler/testData/diagnostics/nativeTests/specialBackendChecks/cInterop/t14.kt @@ -1,3 +1,5 @@ +// FIR_IDENTICAL +@file:OptIn(kotlinx.cinterop.ExperimentalForeignApi::class) import kotlinx.cinterop.* class Z(rawPtr: NativePtr): CStructVar(rawPtr) diff --git a/compiler/testData/diagnostics/nativeTests/specialBackendChecks/cInterop/t37.kt b/compiler/testData/diagnostics/nativeTests/specialBackendChecks/cInterop/t37.kt index be41239bc02..9e281b6a532 100644 --- a/compiler/testData/diagnostics/nativeTests/specialBackendChecks/cInterop/t37.kt +++ b/compiler/testData/diagnostics/nativeTests/specialBackendChecks/cInterop/t37.kt @@ -1,6 +1,9 @@ +// FIR_IDENTICAL +// OPT_IN: kotlin.native.internal.InternalForKotlinNative import kotlinx.cinterop.* import kotlinx.cinterop.internal.* +@OptIn(kotlinx.cinterop.ExperimentalForeignApi::class) @CStruct(spelling = "struct { }") class Z constructor(rawPtr: NativePtr) : CStructVar(rawPtr) { val x: Pair? = null @CStruct.MemberAt(offset = 0L) get diff --git a/compiler/testData/diagnostics/nativeTests/specialBackendChecks/cInterop/t38.kt b/compiler/testData/diagnostics/nativeTests/specialBackendChecks/cInterop/t38.kt index 893994fde2d..ce219d3de6e 100644 --- a/compiler/testData/diagnostics/nativeTests/specialBackendChecks/cInterop/t38.kt +++ b/compiler/testData/diagnostics/nativeTests/specialBackendChecks/cInterop/t38.kt @@ -1,6 +1,9 @@ +// FIR_IDENTICAL +// OPT_IN: kotlin.native.internal.InternalForKotlinNative import kotlinx.cinterop.* import kotlinx.cinterop.internal.* +@OptIn(kotlinx.cinterop.ExperimentalForeignApi::class) @CStruct(spelling = "struct { }") class Z constructor(rawPtr: NativePtr) : CStructVar(rawPtr) { var x: Pair? = null @CStruct.MemberAt(offset = 0L) get diff --git a/compiler/testData/diagnostics/nativeTests/specialBackendChecks/cInterop/t40.kt b/compiler/testData/diagnostics/nativeTests/specialBackendChecks/cInterop/t40.kt index 4dfde08192e..8032219d1c1 100644 --- a/compiler/testData/diagnostics/nativeTests/specialBackendChecks/cInterop/t40.kt +++ b/compiler/testData/diagnostics/nativeTests/specialBackendChecks/cInterop/t40.kt @@ -1,9 +1,11 @@ +// FIR_IDENTICAL import kotlinx.cinterop.* class Z { fun foo(x: Int) = x } +@OptIn(kotlinx.cinterop.ExperimentalForeignApi::class) fun bar() { staticCFunction(Z()::foo) } diff --git a/compiler/testData/diagnostics/nativeTests/specialBackendChecks/cInterop/t41.kt b/compiler/testData/diagnostics/nativeTests/specialBackendChecks/cInterop/t41.kt index e50949ca4d3..5d7e49f8b0f 100644 --- a/compiler/testData/diagnostics/nativeTests/specialBackendChecks/cInterop/t41.kt +++ b/compiler/testData/diagnostics/nativeTests/specialBackendChecks/cInterop/t41.kt @@ -1,5 +1,7 @@ +// FIR_IDENTICAL import kotlinx.cinterop.* +@OptIn(kotlinx.cinterop.ExperimentalForeignApi::class) fun bar(x: Int) { fun foo() = x diff --git a/compiler/testData/diagnostics/nativeTests/specialBackendChecks/cInterop/t42.kt b/compiler/testData/diagnostics/nativeTests/specialBackendChecks/cInterop/t42.kt index 8f409411fb9..fd779e89be1 100644 --- a/compiler/testData/diagnostics/nativeTests/specialBackendChecks/cInterop/t42.kt +++ b/compiler/testData/diagnostics/nativeTests/specialBackendChecks/cInterop/t42.kt @@ -1,7 +1,9 @@ +// FIR_IDENTICAL import kotlinx.cinterop.* fun foo(x: Any) = x +@OptIn(kotlinx.cinterop.ExperimentalForeignApi::class) fun bar() { staticCFunction(::foo) } diff --git a/compiler/testData/diagnostics/nativeTests/specialBackendChecks/cInterop/t43.kt b/compiler/testData/diagnostics/nativeTests/specialBackendChecks/cInterop/t43.kt index b30ae793fd1..d70e5ef7917 100644 --- a/compiler/testData/diagnostics/nativeTests/specialBackendChecks/cInterop/t43.kt +++ b/compiler/testData/diagnostics/nativeTests/specialBackendChecks/cInterop/t43.kt @@ -1,3 +1,5 @@ +// FIR_IDENTICAL import kotlinx.cinterop.* +@Suppress("DEPRECATION") fun bar(x: Float) = x.signExtend() diff --git a/compiler/testData/diagnostics/nativeTests/specialBackendChecks/cInterop/t44.kt b/compiler/testData/diagnostics/nativeTests/specialBackendChecks/cInterop/t44.kt index 069546b5c34..3d66ca80777 100644 --- a/compiler/testData/diagnostics/nativeTests/specialBackendChecks/cInterop/t44.kt +++ b/compiler/testData/diagnostics/nativeTests/specialBackendChecks/cInterop/t44.kt @@ -1,3 +1,5 @@ +// FIR_IDENTICAL import kotlinx.cinterop.* +@Suppress("DEPRECATION") fun bar(x: Int) = x.signExtend() diff --git a/compiler/testData/diagnostics/nativeTests/specialBackendChecks/cInterop/t45.kt b/compiler/testData/diagnostics/nativeTests/specialBackendChecks/cInterop/t45.kt index 19c83ebf6d5..4f69fa3201d 100644 --- a/compiler/testData/diagnostics/nativeTests/specialBackendChecks/cInterop/t45.kt +++ b/compiler/testData/diagnostics/nativeTests/specialBackendChecks/cInterop/t45.kt @@ -1,3 +1,5 @@ +// FIR_IDENTICAL import kotlinx.cinterop.* +@Suppress("DEPRECATION") fun bar(x: Int) = x.signExtend() diff --git a/compiler/testData/diagnostics/nativeTests/specialBackendChecks/cInterop/t46.kt b/compiler/testData/diagnostics/nativeTests/specialBackendChecks/cInterop/t46.kt index 3b4e7ab349a..d50ed850b93 100644 --- a/compiler/testData/diagnostics/nativeTests/specialBackendChecks/cInterop/t46.kt +++ b/compiler/testData/diagnostics/nativeTests/specialBackendChecks/cInterop/t46.kt @@ -1,3 +1,5 @@ +// FIR_IDENTICAL import kotlinx.cinterop.* +@Suppress("DEPRECATION") fun bar(x: Int) = x.narrow() diff --git a/compiler/testData/diagnostics/nativeTests/specialBackendChecks/cInterop/t47.kt b/compiler/testData/diagnostics/nativeTests/specialBackendChecks/cInterop/t47.kt index 63ce4ea0c23..6df10be6909 100644 --- a/compiler/testData/diagnostics/nativeTests/specialBackendChecks/cInterop/t47.kt +++ b/compiler/testData/diagnostics/nativeTests/specialBackendChecks/cInterop/t47.kt @@ -1,3 +1,5 @@ +// FIR_IDENTICAL +@file:OptIn(kotlinx.cinterop.ExperimentalForeignApi::class) import kotlinx.cinterop.* fun bar(x: Int) = x.convert() diff --git a/compiler/testData/diagnostics/nativeTests/specialBackendChecks/cInterop/t60.kt b/compiler/testData/diagnostics/nativeTests/specialBackendChecks/cInterop/t60.kt index 0b234eac4d6..8c1b8e4f49f 100644 --- a/compiler/testData/diagnostics/nativeTests/specialBackendChecks/cInterop/t60.kt +++ b/compiler/testData/diagnostics/nativeTests/specialBackendChecks/cInterop/t60.kt @@ -1,3 +1,5 @@ +// FIR_IDENTICAL +@file:OptIn(kotlinx.cinterop.ExperimentalForeignApi::class) import kotlinx.cinterop.* class Vertex constructor(rawPtr: NativePtr) : CStructVar(rawPtr) { @@ -6,5 +8,6 @@ class Vertex constructor(rawPtr: NativePtr) : CStructVar(rawPtr) { var r: Float = 0f var g: Float = 0f var b: Float = 0f + @Suppress("DEPRECATION") companion object : CStructVar.Type(40, 8) } diff --git a/compiler/testData/diagnostics/nativeTests/specialBackendChecks/cInterop/t63.kt b/compiler/testData/diagnostics/nativeTests/specialBackendChecks/cInterop/t63.kt index 84ba827c764..d36410f49f1 100644 --- a/compiler/testData/diagnostics/nativeTests/specialBackendChecks/cInterop/t63.kt +++ b/compiler/testData/diagnostics/nativeTests/specialBackendChecks/cInterop/t63.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL import kotlinx.cinterop.* import kotlin.coroutines.* @@ -17,6 +18,7 @@ fun startCoroutine(block: suspend () -> Unit) { block.startCoroutine(EmptyContinuation) } +@OptIn(kotlinx.cinterop.BetaInteropApi::class) fun main() { autoreleasepool { startCoroutine { diff --git a/compiler/testData/diagnostics/nativeTests/specialBackendChecks/cInterop/t64.kt b/compiler/testData/diagnostics/nativeTests/specialBackendChecks/cInterop/t64.kt index 6ff41a4b873..e52f85e68c9 100644 --- a/compiler/testData/diagnostics/nativeTests/specialBackendChecks/cInterop/t64.kt +++ b/compiler/testData/diagnostics/nativeTests/specialBackendChecks/cInterop/t64.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL import kotlinx.cinterop.* import kotlin.coroutines.* @@ -17,8 +18,10 @@ fun startCoroutine(block: suspend () -> Unit) { block.startCoroutine(EmptyContinuation) } +@OptIn(kotlinx.cinterop.BetaInteropApi::class) inline fun myAutoreleasepool(block: () -> T) = autoreleasepool(block) +@OptIn(kotlinx.cinterop.BetaInteropApi::class) fun main() { autoreleasepool { startCoroutine { diff --git a/compiler/testData/diagnostics/nativeTests/specialBackendChecks/cInterop/t8.kt b/compiler/testData/diagnostics/nativeTests/specialBackendChecks/cInterop/t8.kt index 91280d2d9ca..15cb3bb074a 100644 --- a/compiler/testData/diagnostics/nativeTests/specialBackendChecks/cInterop/t8.kt +++ b/compiler/testData/diagnostics/nativeTests/specialBackendChecks/cInterop/t8.kt @@ -1,7 +1,9 @@ +// FIR_IDENTICAL import kotlinx.cinterop.* fun foo(f: Function0<*>) = f +@OptIn(kotlinx.cinterop.ExperimentalForeignApi::class) fun bar() { staticCFunction(::foo) } diff --git a/compiler/testData/diagnostics/nativeTests/specialBackendChecks/cInterop/t9.kt b/compiler/testData/diagnostics/nativeTests/specialBackendChecks/cInterop/t9.kt index f65f2ebe230..34ac706737f 100644 --- a/compiler/testData/diagnostics/nativeTests/specialBackendChecks/cInterop/t9.kt +++ b/compiler/testData/diagnostics/nativeTests/specialBackendChecks/cInterop/t9.kt @@ -1,7 +1,9 @@ +// FIR_IDENTICAL import kotlinx.cinterop.* fun foo(f: Function0) = f +@OptIn(kotlinx.cinterop.ExperimentalForeignApi::class) fun bar() { staticCFunction(::foo) } diff --git a/compiler/testData/diagnostics/nativeTests/specialBackendChecks/concurrent/t48.kt b/compiler/testData/diagnostics/nativeTests/specialBackendChecks/concurrent/t48.kt index 5ae065ceebf..20d4190ad09 100644 --- a/compiler/testData/diagnostics/nativeTests/specialBackendChecks/concurrent/t48.kt +++ b/compiler/testData/diagnostics/nativeTests/specialBackendChecks/concurrent/t48.kt @@ -1,9 +1,11 @@ +// FIR_IDENTICAL import kotlin.native.concurrent.* class Z(val x: Int) { fun bar(s: String) = s + x.toString() } +@OptIn(ObsoleteWorkersApi::class) fun foo(x: Int) { val worker = Worker.start() worker.execute(TransferMode.SAFE, { "zzz" }, Z(x)::bar) diff --git a/compiler/testData/diagnostics/nativeTests/specialBackendChecks/concurrent/t49.kt b/compiler/testData/diagnostics/nativeTests/specialBackendChecks/concurrent/t49.kt index 2188c38b023..bc8be1e4ea6 100644 --- a/compiler/testData/diagnostics/nativeTests/specialBackendChecks/concurrent/t49.kt +++ b/compiler/testData/diagnostics/nativeTests/specialBackendChecks/concurrent/t49.kt @@ -1,5 +1,7 @@ +// FIR_IDENTICAL import kotlin.native.concurrent.* +@OptIn(ObsoleteWorkersApi::class) fun foo(x: Int) { val worker = Worker.start() worker.execute(TransferMode.SAFE, { "zzz" }) { s -> s + x.toString() } diff --git a/compiler/testData/diagnostics/nativeTests/specialBackendChecks/concurrent/t50.kt b/compiler/testData/diagnostics/nativeTests/specialBackendChecks/concurrent/t50.kt index c02e6326c4e..a8aea6470a8 100644 --- a/compiler/testData/diagnostics/nativeTests/specialBackendChecks/concurrent/t50.kt +++ b/compiler/testData/diagnostics/nativeTests/specialBackendChecks/concurrent/t50.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL @file:OptIn(ObsoleteWorkersApi::class) import kotlin.native.concurrent.* diff --git a/compiler/testData/diagnostics/nativeTests/specialBackendChecks/concurrent/t51.kt b/compiler/testData/diagnostics/nativeTests/specialBackendChecks/concurrent/t51.kt index 5de666d7a36..3d1d045a1bf 100644 --- a/compiler/testData/diagnostics/nativeTests/specialBackendChecks/concurrent/t51.kt +++ b/compiler/testData/diagnostics/nativeTests/specialBackendChecks/concurrent/t51.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL @file:OptIn(ObsoleteWorkersApi::class) import kotlin.native.concurrent.* diff --git a/compiler/testData/diagnostics/nativeTests/specialBackendChecks/immutableBlobOf/t54.kt b/compiler/testData/diagnostics/nativeTests/specialBackendChecks/immutableBlobOf/t54.kt index fe3d45cd7b3..a786eb0c092 100644 --- a/compiler/testData/diagnostics/nativeTests/specialBackendChecks/immutableBlobOf/t54.kt +++ b/compiler/testData/diagnostics/nativeTests/specialBackendChecks/immutableBlobOf/t54.kt @@ -1 +1,2 @@ +// FIR_IDENTICAL fun foo(arr: ShortArray) = immutableBlobOf(*arr) diff --git a/compiler/testData/diagnostics/nativeTests/specialBackendChecks/immutableBlobOf/t55.kt b/compiler/testData/diagnostics/nativeTests/specialBackendChecks/immutableBlobOf/t55.kt index 561fa724bf8..aa5824c0ec1 100644 --- a/compiler/testData/diagnostics/nativeTests/specialBackendChecks/immutableBlobOf/t55.kt +++ b/compiler/testData/diagnostics/nativeTests/specialBackendChecks/immutableBlobOf/t55.kt @@ -1 +1,2 @@ +// FIR_IDENTICAL fun foo(x: Short) = immutableBlobOf(x) diff --git a/compiler/testData/diagnostics/nativeTests/specialBackendChecks/immutableBlobOf/t56.kt b/compiler/testData/diagnostics/nativeTests/specialBackendChecks/immutableBlobOf/t56.kt index d286a28d7be..74495021c15 100644 --- a/compiler/testData/diagnostics/nativeTests/specialBackendChecks/immutableBlobOf/t56.kt +++ b/compiler/testData/diagnostics/nativeTests/specialBackendChecks/immutableBlobOf/t56.kt @@ -1 +1,2 @@ +// FIR_IDENTICAL fun foo() = immutableBlobOf(1000) diff --git a/compiler/testData/diagnostics/nativeTests/specialBackendChecks/immutableBlobOf/t57.kt b/compiler/testData/diagnostics/nativeTests/specialBackendChecks/immutableBlobOf/t57.kt index d947c4e05c9..21f0c5d6b5d 100644 --- a/compiler/testData/diagnostics/nativeTests/specialBackendChecks/immutableBlobOf/t57.kt +++ b/compiler/testData/diagnostics/nativeTests/specialBackendChecks/immutableBlobOf/t57.kt @@ -1 +1,2 @@ +// FIR_IDENTICAL fun foo() = immutableBlobOf() diff --git a/compiler/testData/diagnostics/nativeTests/specialBackendChecks/nativeRef/t52.kt b/compiler/testData/diagnostics/nativeTests/specialBackendChecks/nativeRef/t52.kt index a22ddeafb2e..b1752241623 100644 --- a/compiler/testData/diagnostics/nativeTests/specialBackendChecks/nativeRef/t52.kt +++ b/compiler/testData/diagnostics/nativeTests/specialBackendChecks/nativeRef/t52.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL import kotlin.native.ref.* @OptIn(kotlin.experimental.ExperimentalNativeApi::class) diff --git a/compiler/testData/diagnostics/nativeTests/specialBackendChecks/nativeRef/t53.kt b/compiler/testData/diagnostics/nativeTests/specialBackendChecks/nativeRef/t53.kt index ac156cec282..2337f1ffe20 100644 --- a/compiler/testData/diagnostics/nativeTests/specialBackendChecks/nativeRef/t53.kt +++ b/compiler/testData/diagnostics/nativeTests/specialBackendChecks/nativeRef/t53.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL import kotlin.native.ref.* class C(val x: Int) { diff --git a/compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t15.kt b/compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t15.kt index 8f9b60dd74b..c21941b55f1 100644 --- a/compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t15.kt +++ b/compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t15.kt @@ -1,3 +1,5 @@ +// FIR_IDENTICAL +// WITH_PLATFORM_LIBS import platform.darwin.* import platform.Foundation.* diff --git a/compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t16.kt b/compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t16.kt index 69e31415fe1..dfdbd37c77b 100644 --- a/compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t16.kt +++ b/compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t16.kt @@ -1,3 +1,5 @@ +// FIR_IDENTICAL +// WITH_PLATFORM_LIBS import platform.darwin.* import platform.Foundation.* diff --git a/compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t17.kt b/compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t17.kt index fce3da8a57c..73461e38522 100644 --- a/compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t17.kt +++ b/compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t17.kt @@ -1,3 +1,5 @@ +// FIR_IDENTICAL +// WITH_PLATFORM_LIBS import platform.darwin.* import platform.Foundation.* diff --git a/compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t18.kt b/compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t18.kt index 6ca701a7d4b..29a8d7b5a53 100644 --- a/compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t18.kt +++ b/compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t18.kt @@ -1,3 +1,5 @@ +// FIR_IDENTICAL +// WITH_PLATFORM_LIBS import platform.darwin.* class Foo : NSObject() { diff --git a/compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t2.kt b/compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t2.kt index 03be45bb590..505300dd6e6 100644 --- a/compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t2.kt +++ b/compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t2.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL import platform.darwin.* import platform.Foundation.* diff --git a/compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t20.kt b/compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t20.kt index 50e2de5cc32..e3ec8f4c811 100644 --- a/compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t20.kt +++ b/compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t20.kt @@ -1,3 +1,5 @@ +// FIR_IDENTICAL +// WITH_PLATFORM_LIBS import platform.darwin.* import platform.Foundation.* diff --git a/compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t21.kt b/compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t21.kt index 6a0f459b8d5..90752071b66 100644 --- a/compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t21.kt +++ b/compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t21.kt @@ -1,3 +1,5 @@ +// FIR_IDENTICAL +// WITH_PLATFORM_LIBS import platform.darwin.* import platform.Foundation.* diff --git a/compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t22.kt b/compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t22.kt index a095f936c1a..c20419438a1 100644 --- a/compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t22.kt +++ b/compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t22.kt @@ -1,3 +1,5 @@ +// FIR_IDENTICAL +// WITH_PLATFORM_LIBS import platform.darwin.* import platform.Foundation.* diff --git a/compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t23.kt b/compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t23.kt index e4d06a2efe8..970b6e990c9 100644 --- a/compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t23.kt +++ b/compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t23.kt @@ -1,3 +1,5 @@ +// FIR_IDENTICAL +// WITH_PLATFORM_LIBS import platform.darwin.* import platform.Foundation.* diff --git a/compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t24.kt b/compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t24.kt index 1e996546be2..80d9d7bbf0a 100644 --- a/compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t24.kt +++ b/compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t24.kt @@ -1,3 +1,5 @@ +// FIR_IDENTICAL +// WITH_PLATFORM_LIBS import platform.darwin.* import platform.Foundation.* diff --git a/compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t25.kt b/compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t25.kt index b57b8fabeb4..70047202320 100644 --- a/compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t25.kt +++ b/compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t25.kt @@ -1,3 +1,5 @@ +// FIR_IDENTICAL +// WITH_PLATFORM_LIBS import platform.darwin.* import platform.Foundation.* diff --git a/compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t26.kt b/compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t26.kt index dd79c6bff10..ed624bd3cd6 100644 --- a/compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t26.kt +++ b/compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t26.kt @@ -1,8 +1,12 @@ +// FIR_IDENTICAL +// WITH_PLATFORM_LIBS import kotlinx.cinterop.* import platform.darwin.* import platform.Foundation.* +@OptIn(kotlinx.cinterop.ExperimentalForeignApi::class) class Zzz : NSAssertionHandler() { + @OptIn(kotlinx.cinterop.BetaInteropApi::class) @ObjCAction fun String.foo() = println(this) } diff --git a/compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t27.kt b/compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t27.kt index ca088a337b2..f44251df25b 100644 --- a/compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t27.kt +++ b/compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t27.kt @@ -1,8 +1,12 @@ +// FIR_IDENTICAL +// WITH_PLATFORM_LIBS import kotlinx.cinterop.* import platform.darwin.* import platform.Foundation.* +@OptIn(kotlinx.cinterop.ExperimentalForeignApi::class) class Zzz : NSAssertionHandler() { + @OptIn(kotlinx.cinterop.BetaInteropApi::class) @ObjCAction fun foo(x: String) = println(x) } diff --git a/compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t28.kt b/compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t28.kt index 70de49cc2c6..abcff49ae8f 100644 --- a/compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t28.kt +++ b/compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t28.kt @@ -1,8 +1,11 @@ +// FIR_IDENTICAL +// WITH_PLATFORM_LIBS import kotlinx.cinterop.* import platform.darwin.* import platform.Foundation.* class Zzz : NSAssertionHandler() { + @OptIn(kotlinx.cinterop.BetaInteropApi::class) @ObjCAction fun foo() = 42 } diff --git a/compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t29.kt b/compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t29.kt index 99600ea848d..121a26658e4 100644 --- a/compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t29.kt +++ b/compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t29.kt @@ -1,8 +1,12 @@ +// FIR_IDENTICAL +// WITH_PLATFORM_LIBS import kotlinx.cinterop.* import platform.darwin.* import platform.Foundation.* +@OptIn(kotlinx.cinterop.ExperimentalForeignApi::class) class Zzz : NSAssertionHandler() { + @OptIn(kotlinx.cinterop.BetaInteropApi::class) @ObjCOutlet val x: NSObject get() = this } diff --git a/compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t30.kt b/compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t30.kt index c7726d491ed..49744ebe5fb 100644 --- a/compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t30.kt +++ b/compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t30.kt @@ -1,8 +1,11 @@ +// FIR_IDENTICAL +// WITH_PLATFORM_LIBS import kotlinx.cinterop.* import platform.darwin.* import platform.Foundation.* class Zzz : NSAssertionHandler() { + @OptIn(kotlinx.cinterop.BetaInteropApi::class) @ObjCOutlet var NSObject.x: NSObject get() = this diff --git a/compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t31.kt b/compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t31.kt index df6b62782a9..09a8cb9cdf2 100644 --- a/compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t31.kt +++ b/compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t31.kt @@ -1,8 +1,11 @@ +// FIR_IDENTICAL +// WITH_PLATFORM_LIBS import kotlinx.cinterop.* import platform.darwin.* import platform.Foundation.* class Zzz : NSAssertionHandler() { + @OptIn(kotlinx.cinterop.BetaInteropApi::class) @ObjCOutlet var x: String get() = "zzz" diff --git a/compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t32.kt b/compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t32.kt index 60be6649f8d..b1d155e3941 100644 --- a/compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t32.kt +++ b/compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t32.kt @@ -1,8 +1,11 @@ +// FIR_IDENTICAL +// WITH_PLATFORM_LIBS import kotlinx.cinterop.* import platform.darwin.* import platform.Foundation.* class Zzz : NSAssertionHandler { + @OptIn(kotlinx.cinterop.BetaInteropApi::class) @OverrideInit constructor(x: Int) { } } diff --git a/compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t33.kt b/compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t33.kt index a628b0bd1a9..51e3f534fcd 100644 --- a/compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t33.kt +++ b/compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t33.kt @@ -1,10 +1,14 @@ +// FIR_IDENTICAL +// WITH_PLATFORM_LIBS import kotlinx.cinterop.* import platform.darwin.* import platform.Foundation.* class Zzz : NSString { + @OptIn(kotlinx.cinterop.BetaInteropApi::class) @OverrideInit constructor(coder: NSCoder) { } + @Suppress("OVERRIDE_DEPRECATION") override fun initWithCoder(coder: NSCoder): String? = "zzz" } diff --git a/compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t34.kt b/compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t34.kt index bca42e1ec95..0259910c63c 100644 --- a/compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t34.kt +++ b/compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t34.kt @@ -1,8 +1,11 @@ +// FIR_IDENTICAL +// WITH_PLATFORM_LIBS import kotlinx.cinterop.* import platform.darwin.* import platform.Foundation.* class Zzz : NSAssertionHandler() { + @OptIn(kotlinx.cinterop.BetaInteropApi::class) @ObjCAction fun foo(x: NSObject, y: NSObject, z: NSObject) { } } diff --git a/compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t35.kt b/compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t35.kt index 8af8740565a..b6057c067fb 100644 --- a/compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t35.kt +++ b/compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t35.kt @@ -1,3 +1,5 @@ +// FIR_IDENTICAL +// WITH_PLATFORM_LIBS import kotlinx.cinterop.* import platform.darwin.* import platform.Foundation.* diff --git a/compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t4.kt b/compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t4.kt index 221d7844690..1f5df038c16 100644 --- a/compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t4.kt +++ b/compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t4.kt @@ -1,3 +1,5 @@ +// FIR_IDENTICAL +// WITH_PLATFORM_LIBS import platform.darwin.* import platform.Foundation.* diff --git a/compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t5.kt b/compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t5.kt index 0b6fa0bbc49..a75ef60910e 100644 --- a/compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t5.kt +++ b/compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t5.kt @@ -1,3 +1,5 @@ +// FIR_IDENTICAL +// WITH_PLATFORM_LIBS import platform.darwin.* import platform.Foundation.* diff --git a/compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t6.kt b/compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t6.kt index ea60cfb3c3e..720aa63e6a4 100644 --- a/compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t6.kt +++ b/compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t6.kt @@ -1,3 +1,5 @@ +// FIR_IDENTICAL +// WITH_PLATFORM_LIBS import platform.darwin.* import platform.Foundation.* diff --git a/compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t61.kt b/compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t61.kt index b6e95e3927e..ba692a7d9b0 100644 --- a/compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t61.kt +++ b/compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t61.kt @@ -1,8 +1,4 @@ -/* - * Copyright 2010-2022 JetBrains s.r.o. and Kotlin Programming Language contributors. - * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. - */ - +// FIR_IDENTICAL // KT-50109 class Foo { companion object : platform.darwin.NSObjectMeta() diff --git a/compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t62.kt b/compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t62.kt index 19529d448e4..0939d185d3d 100644 --- a/compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t62.kt +++ b/compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t62.kt @@ -1,7 +1,3 @@ -/* - * Copyright 2010-2022 JetBrains s.r.o. and Kotlin Programming Language contributors. - * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. - */ - +// FIR_IDENTICAL // KT-50109 class Foo : platform.darwin.NSObjectMeta() \ No newline at end of file diff --git a/compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t7.kt b/compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t7.kt index 1b85b8f3a31..24fe1778abe 100644 --- a/compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t7.kt +++ b/compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t7.kt @@ -1,3 +1,5 @@ +// FIR_IDENTICAL +// WITH_PLATFORM_LIBS import platform.darwin.* import platform.Foundation.* diff --git a/compiler/testData/diagnostics/nativeTests/specialBackendChecks/posix/t3.kt b/compiler/testData/diagnostics/nativeTests/specialBackendChecks/posix/t3.kt index 990b6549265..ff85b76bd7d 100644 --- a/compiler/testData/diagnostics/nativeTests/specialBackendChecks/posix/t3.kt +++ b/compiler/testData/diagnostics/nativeTests/specialBackendChecks/posix/t3.kt @@ -1,3 +1,5 @@ +// FIR_IDENTICAL +// WITH_PLATFORM_LIBS import platform.posix.* fun main() { diff --git a/compiler/testData/diagnostics/nativeTests/specialBackendChecks/posix/t36.kt b/compiler/testData/diagnostics/nativeTests/specialBackendChecks/posix/t36.kt index 024836e1705..f5297289015 100644 --- a/compiler/testData/diagnostics/nativeTests/specialBackendChecks/posix/t36.kt +++ b/compiler/testData/diagnostics/nativeTests/specialBackendChecks/posix/t36.kt @@ -1,4 +1,6 @@ +// FIR_IDENTICAL import kotlinx.cinterop.* import platform.posix.* +@OptIn(kotlinx.cinterop.ExperimentalForeignApi::class) fun foo() = stat(malloc(42u)!!.rawValue) diff --git a/compiler/testData/diagnostics/nativeTests/specialBackendChecks/reflect/t58.kt b/compiler/testData/diagnostics/nativeTests/specialBackendChecks/reflect/t58.kt index e1a9ec73ef0..6632ed9f05b 100644 --- a/compiler/testData/diagnostics/nativeTests/specialBackendChecks/reflect/t58.kt +++ b/compiler/testData/diagnostics/nativeTests/specialBackendChecks/reflect/t58.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL import kotlin.reflect.* @OptIn(kotlin.ExperimentalStdlibApi::class) diff --git a/compiler/testData/diagnostics/nativeTests/specialBackendChecks/reflect/t59.kt b/compiler/testData/diagnostics/nativeTests/specialBackendChecks/reflect/t59.kt index 8eef6f61848..bc13a35cfd8 100644 --- a/compiler/testData/diagnostics/nativeTests/specialBackendChecks/reflect/t59.kt +++ b/compiler/testData/diagnostics/nativeTests/specialBackendChecks/reflect/t59.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL import kotlin.reflect.* @OptIn(kotlin.ExperimentalStdlibApi::class) diff --git a/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/frontend/fir/TestFirNativeSessionFactory.kt b/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/frontend/fir/TestFirNativeSessionFactory.kt index 128ff5f3670..9d182ffb786 100644 --- a/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/frontend/fir/TestFirNativeSessionFactory.kt +++ b/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/frontend/fir/TestFirNativeSessionFactory.kt @@ -5,6 +5,7 @@ package org.jetbrains.kotlin.test.frontend.fir +import org.jetbrains.kotlin.backend.common.CommonKLibResolver import org.jetbrains.kotlin.config.CompilerConfiguration import org.jetbrains.kotlin.config.LanguageVersionSettings import org.jetbrains.kotlin.fir.FirSession @@ -12,6 +13,7 @@ import org.jetbrains.kotlin.fir.deserialization.ModuleDataProvider import org.jetbrains.kotlin.fir.extensions.FirExtensionRegistrar import org.jetbrains.kotlin.fir.java.FirProjectSessionProvider import org.jetbrains.kotlin.fir.session.FirNativeSessionFactory +import org.jetbrains.kotlin.ir.backend.js.resolverLogger import org.jetbrains.kotlin.test.services.configuration.NativeEnvironmentConfigurator import org.jetbrains.kotlin.name.Name import org.jetbrains.kotlin.test.model.TestModule @@ -29,7 +31,11 @@ object TestFirNativeSessionFactory { languageVersionSettings: LanguageVersionSettings, registerExtraComponents: (FirSession) -> Unit = {}, ): FirSession { - val resolvedLibraries = resolveLibraries(configuration, getAllNativeDependenciesPaths(module, testServices)) + val resolvedLibraries = CommonKLibResolver.resolve( + getAllNativeDependenciesPaths(module, testServices), + configuration.resolverLogger, + knownIrProviders = listOf("kotlin.native.cinterop"), // FIXME use KonanLibraryProperResolver instead, as in production. + ).getFullResolvedList() return FirNativeSessionFactory.createLibrarySession( mainModuleName, diff --git a/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/services/configuration/NativeEnvironmentConfigurator.kt b/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/services/configuration/NativeEnvironmentConfigurator.kt index 4a6d1160f98..bebf9199817 100644 --- a/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/services/configuration/NativeEnvironmentConfigurator.kt +++ b/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/services/configuration/NativeEnvironmentConfigurator.kt @@ -5,6 +5,7 @@ package org.jetbrains.kotlin.test.services.configuration +import org.jetbrains.kotlin.konan.target.TargetSupportException import org.jetbrains.kotlin.test.directives.ConfigurationDirectives import org.jetbrains.kotlin.test.model.TestModule import org.jetbrains.kotlin.test.services.EnvironmentConfigurator @@ -25,6 +26,13 @@ class NativeEnvironmentConfigurator(testServices: TestServices) : EnvironmentCon result += File("$nativeHome/klib/common/stdlib").absolutePath } + if (ConfigurationDirectives.WITH_PLATFORM_LIBS in module.directives) { + // Diagnostic tests are agnostic of native target, so host is enforced to be a target. + File("$nativeHome/klib/platform/${hostOsArch()}").listFiles()?.forEach { + result += it.absolutePath + } + } + testServices.runtimeClasspathProviders .flatMap { it.runtimeClassPaths(module) } .mapTo(result) { it.absolutePath } @@ -32,4 +40,27 @@ class NativeEnvironmentConfigurator(testServices: TestServices) : EnvironmentCon return result } } -} \ No newline at end of file +} + +private fun hostOsArch() = "${hostOs()}_${hostArch()}" + +// `:native` module cannot be imported here, so functions are just copy/pasted here. +// `hostOs()` and `hostArch()` are similar to functions in org.jetbrains.kotlin.konan.target.HostManager +private fun hostOs(): String { + val javaOsName = System.getProperty("os.name") + return when { + javaOsName == "Mac OS X" -> "macos" + javaOsName == "Linux" -> "linux" + javaOsName.startsWith("Windows") -> "mingw" + else -> throw TargetSupportException("Unknown operating system: $javaOsName") + } +} + +fun hostArch(): String = + when (val arch = System.getProperty("os.arch")) { + "x86_64" -> "x64" + "amd64" -> "x64" + "arm64" -> "arm64" + "aarch64" -> "arm64" + else -> throw TargetSupportException("Unknown hardware platform: $arch") + } diff --git a/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/test/diagnostics/DiagnosticsNativeTestGenerated.java b/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/test/diagnostics/DiagnosticsNativeTestGenerated.java index d0f208101c0..ed6d4e31fca 100644 --- a/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/test/diagnostics/DiagnosticsNativeTestGenerated.java +++ b/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/test/diagnostics/DiagnosticsNativeTestGenerated.java @@ -21,7 +21,7 @@ import java.util.regex.Pattern; public class DiagnosticsNativeTestGenerated extends AbstractDiagnosticsNativeTest { @Test public void testAllFilesPresentInNativeTests() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/nativeTests"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.(reversed|fir|ll)\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/nativeTests"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.(reversed|fir|ll)\\.kts?$"), true, "specialBackendChecks"); } @Test diff --git a/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/test/diagnostics/FirLightTreeOldFrontendNativeDiagnosticsTestGenerated.java b/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/test/diagnostics/FirLightTreeOldFrontendNativeDiagnosticsTestGenerated.java index cadd17a3caf..f66e20cf052 100644 --- a/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/test/diagnostics/FirLightTreeOldFrontendNativeDiagnosticsTestGenerated.java +++ b/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/test/diagnostics/FirLightTreeOldFrontendNativeDiagnosticsTestGenerated.java @@ -117,4 +117,472 @@ public class FirLightTreeOldFrontendNativeDiagnosticsTestGenerated extends Abstr public void testTopLevelSingleton() throws Exception { runTest("compiler/testData/diagnostics/nativeTests/topLevelSingleton.kt"); } + + @Nested + @TestMetadata("compiler/testData/diagnostics/nativeTests/specialBackendChecks") + @TestDataPath("$PROJECT_ROOT") + @Tag("frontend-fir") + @FirPipeline() + public class SpecialBackendChecks { + @Test + public void testAllFilesPresentInSpecialBackendChecks() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/nativeTests/specialBackendChecks"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.(reversed|fir|ll)\\.kts?$"), true); + } + + @Nested + @TestMetadata("compiler/testData/diagnostics/nativeTests/specialBackendChecks/cInterop") + @TestDataPath("$PROJECT_ROOT") + @Tag("frontend-fir") + @FirPipeline() + public class CInterop { + @Test + public void testAllFilesPresentInCInterop() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/nativeTests/specialBackendChecks/cInterop"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.(reversed|fir|ll)\\.kts?$"), true); + } + + @Test + @TestMetadata("t1.kt") + public void testT1() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/cInterop/t1.kt"); + } + + @Test + @TestMetadata("t10.kt") + public void testT10() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/cInterop/t10.kt"); + } + + @Test + @TestMetadata("t11.kt") + public void testT11() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/cInterop/t11.kt"); + } + + @Test + @TestMetadata("t12.kt") + public void testT12() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/cInterop/t12.kt"); + } + + @Test + @TestMetadata("t13.kt") + public void testT13() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/cInterop/t13.kt"); + } + + @Test + @TestMetadata("t14.kt") + public void testT14() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/cInterop/t14.kt"); + } + + @Test + @TestMetadata("t37.kt") + public void testT37() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/cInterop/t37.kt"); + } + + @Test + @TestMetadata("t38.kt") + public void testT38() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/cInterop/t38.kt"); + } + + @Test + @TestMetadata("t40.kt") + public void testT40() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/cInterop/t40.kt"); + } + + @Test + @TestMetadata("t41.kt") + public void testT41() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/cInterop/t41.kt"); + } + + @Test + @TestMetadata("t42.kt") + public void testT42() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/cInterop/t42.kt"); + } + + @Test + @TestMetadata("t43.kt") + public void testT43() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/cInterop/t43.kt"); + } + + @Test + @TestMetadata("t44.kt") + public void testT44() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/cInterop/t44.kt"); + } + + @Test + @TestMetadata("t45.kt") + public void testT45() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/cInterop/t45.kt"); + } + + @Test + @TestMetadata("t46.kt") + public void testT46() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/cInterop/t46.kt"); + } + + @Test + @TestMetadata("t47.kt") + public void testT47() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/cInterop/t47.kt"); + } + + @Test + @TestMetadata("t60.kt") + public void testT60() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/cInterop/t60.kt"); + } + + @Test + @TestMetadata("t63.kt") + public void testT63() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/cInterop/t63.kt"); + } + + @Test + @TestMetadata("t64.kt") + public void testT64() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/cInterop/t64.kt"); + } + + @Test + @TestMetadata("t8.kt") + public void testT8() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/cInterop/t8.kt"); + } + + @Test + @TestMetadata("t9.kt") + public void testT9() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/cInterop/t9.kt"); + } + } + + @Nested + @TestMetadata("compiler/testData/diagnostics/nativeTests/specialBackendChecks/concurrent") + @TestDataPath("$PROJECT_ROOT") + @Tag("frontend-fir") + @FirPipeline() + public class Concurrent { + @Test + public void testAllFilesPresentInConcurrent() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/nativeTests/specialBackendChecks/concurrent"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.(reversed|fir|ll)\\.kts?$"), true); + } + + @Test + @TestMetadata("t48.kt") + public void testT48() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/concurrent/t48.kt"); + } + + @Test + @TestMetadata("t49.kt") + public void testT49() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/concurrent/t49.kt"); + } + + @Test + @TestMetadata("t50.kt") + public void testT50() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/concurrent/t50.kt"); + } + + @Test + @TestMetadata("t51.kt") + public void testT51() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/concurrent/t51.kt"); + } + } + + @Nested + @TestMetadata("compiler/testData/diagnostics/nativeTests/specialBackendChecks/immutableBlobOf") + @TestDataPath("$PROJECT_ROOT") + @Tag("frontend-fir") + @FirPipeline() + public class ImmutableBlobOf { + @Test + public void testAllFilesPresentInImmutableBlobOf() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/nativeTests/specialBackendChecks/immutableBlobOf"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.(reversed|fir|ll)\\.kts?$"), true); + } + + @Test + @TestMetadata("t54.kt") + public void testT54() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/immutableBlobOf/t54.kt"); + } + + @Test + @TestMetadata("t55.kt") + public void testT55() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/immutableBlobOf/t55.kt"); + } + + @Test + @TestMetadata("t56.kt") + public void testT56() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/immutableBlobOf/t56.kt"); + } + + @Test + @TestMetadata("t57.kt") + public void testT57() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/immutableBlobOf/t57.kt"); + } + } + + @Nested + @TestMetadata("compiler/testData/diagnostics/nativeTests/specialBackendChecks/nativeRef") + @TestDataPath("$PROJECT_ROOT") + @Tag("frontend-fir") + @FirPipeline() + public class NativeRef { + @Test + public void testAllFilesPresentInNativeRef() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/nativeTests/specialBackendChecks/nativeRef"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.(reversed|fir|ll)\\.kts?$"), true); + } + + @Test + @TestMetadata("t52.kt") + public void testT52() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/nativeRef/t52.kt"); + } + + @Test + @TestMetadata("t53.kt") + public void testT53() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/nativeRef/t53.kt"); + } + } + + @Nested + @TestMetadata("compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop") + @TestDataPath("$PROJECT_ROOT") + @Tag("frontend-fir") + @FirPipeline() + public class ObjCInterop { + @Test + public void testAllFilesPresentInObjCInterop() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.(reversed|fir|ll)\\.kts?$"), true); + } + + @Test + @TestMetadata("t15.kt") + public void testT15() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t15.kt"); + } + + @Test + @TestMetadata("t16.kt") + public void testT16() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t16.kt"); + } + + @Test + @TestMetadata("t17.kt") + public void testT17() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t17.kt"); + } + + @Test + @TestMetadata("t18.kt") + public void testT18() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t18.kt"); + } + + @Test + @TestMetadata("t2.kt") + public void testT2() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t2.kt"); + } + + @Test + @TestMetadata("t20.kt") + public void testT20() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t20.kt"); + } + + @Test + @TestMetadata("t21.kt") + public void testT21() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t21.kt"); + } + + @Test + @TestMetadata("t22.kt") + public void testT22() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t22.kt"); + } + + @Test + @TestMetadata("t23.kt") + public void testT23() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t23.kt"); + } + + @Test + @TestMetadata("t24.kt") + public void testT24() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t24.kt"); + } + + @Test + @TestMetadata("t25.kt") + public void testT25() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t25.kt"); + } + + @Test + @TestMetadata("t26.kt") + public void testT26() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t26.kt"); + } + + @Test + @TestMetadata("t27.kt") + public void testT27() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t27.kt"); + } + + @Test + @TestMetadata("t28.kt") + public void testT28() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t28.kt"); + } + + @Test + @TestMetadata("t29.kt") + public void testT29() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t29.kt"); + } + + @Test + @TestMetadata("t30.kt") + public void testT30() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t30.kt"); + } + + @Test + @TestMetadata("t31.kt") + public void testT31() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t31.kt"); + } + + @Test + @TestMetadata("t32.kt") + public void testT32() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t32.kt"); + } + + @Test + @TestMetadata("t33.kt") + public void testT33() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t33.kt"); + } + + @Test + @TestMetadata("t34.kt") + public void testT34() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t34.kt"); + } + + @Test + @TestMetadata("t35.kt") + public void testT35() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t35.kt"); + } + + @Test + @TestMetadata("t4.kt") + public void testT4() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t4.kt"); + } + + @Test + @TestMetadata("t5.kt") + public void testT5() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t5.kt"); + } + + @Test + @TestMetadata("t6.kt") + public void testT6() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t6.kt"); + } + + @Test + @TestMetadata("t61.kt") + public void testT61() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t61.kt"); + } + + @Test + @TestMetadata("t62.kt") + public void testT62() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t62.kt"); + } + + @Test + @TestMetadata("t7.kt") + public void testT7() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t7.kt"); + } + } + + @Nested + @TestMetadata("compiler/testData/diagnostics/nativeTests/specialBackendChecks/posix") + @TestDataPath("$PROJECT_ROOT") + @Tag("frontend-fir") + @FirPipeline() + public class Posix { + @Test + public void testAllFilesPresentInPosix() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/nativeTests/specialBackendChecks/posix"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.(reversed|fir|ll)\\.kts?$"), true); + } + + @Test + @TestMetadata("t3.kt") + public void testT3() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/posix/t3.kt"); + } + + @Test + @TestMetadata("t36.kt") + public void testT36() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/posix/t36.kt"); + } + } + + @Nested + @TestMetadata("compiler/testData/diagnostics/nativeTests/specialBackendChecks/reflect") + @TestDataPath("$PROJECT_ROOT") + @Tag("frontend-fir") + @FirPipeline() + public class Reflect { + @Test + public void testAllFilesPresentInReflect() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/nativeTests/specialBackendChecks/reflect"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.(reversed|fir|ll)\\.kts?$"), true); + } + + @Test + @TestMetadata("t58.kt") + public void testT58() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/reflect/t58.kt"); + } + + @Test + @TestMetadata("t59.kt") + public void testT59() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/reflect/t59.kt"); + } + } + } } diff --git a/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/test/diagnostics/FirPsiOldFrontendNativeDiagnosticsTestGenerated.java b/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/test/diagnostics/FirPsiOldFrontendNativeDiagnosticsTestGenerated.java index fd46067b7ea..58809415daf 100644 --- a/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/test/diagnostics/FirPsiOldFrontendNativeDiagnosticsTestGenerated.java +++ b/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/test/diagnostics/FirPsiOldFrontendNativeDiagnosticsTestGenerated.java @@ -117,4 +117,472 @@ public class FirPsiOldFrontendNativeDiagnosticsTestGenerated extends AbstractFir public void testTopLevelSingleton() throws Exception { runTest("compiler/testData/diagnostics/nativeTests/topLevelSingleton.kt"); } + + @Nested + @TestMetadata("compiler/testData/diagnostics/nativeTests/specialBackendChecks") + @TestDataPath("$PROJECT_ROOT") + @Tag("frontend-fir") + @FirPipeline() + public class SpecialBackendChecks { + @Test + public void testAllFilesPresentInSpecialBackendChecks() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/nativeTests/specialBackendChecks"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.(reversed|fir|ll)\\.kts?$"), true); + } + + @Nested + @TestMetadata("compiler/testData/diagnostics/nativeTests/specialBackendChecks/cInterop") + @TestDataPath("$PROJECT_ROOT") + @Tag("frontend-fir") + @FirPipeline() + public class CInterop { + @Test + public void testAllFilesPresentInCInterop() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/nativeTests/specialBackendChecks/cInterop"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.(reversed|fir|ll)\\.kts?$"), true); + } + + @Test + @TestMetadata("t1.kt") + public void testT1() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/cInterop/t1.kt"); + } + + @Test + @TestMetadata("t10.kt") + public void testT10() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/cInterop/t10.kt"); + } + + @Test + @TestMetadata("t11.kt") + public void testT11() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/cInterop/t11.kt"); + } + + @Test + @TestMetadata("t12.kt") + public void testT12() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/cInterop/t12.kt"); + } + + @Test + @TestMetadata("t13.kt") + public void testT13() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/cInterop/t13.kt"); + } + + @Test + @TestMetadata("t14.kt") + public void testT14() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/cInterop/t14.kt"); + } + + @Test + @TestMetadata("t37.kt") + public void testT37() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/cInterop/t37.kt"); + } + + @Test + @TestMetadata("t38.kt") + public void testT38() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/cInterop/t38.kt"); + } + + @Test + @TestMetadata("t40.kt") + public void testT40() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/cInterop/t40.kt"); + } + + @Test + @TestMetadata("t41.kt") + public void testT41() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/cInterop/t41.kt"); + } + + @Test + @TestMetadata("t42.kt") + public void testT42() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/cInterop/t42.kt"); + } + + @Test + @TestMetadata("t43.kt") + public void testT43() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/cInterop/t43.kt"); + } + + @Test + @TestMetadata("t44.kt") + public void testT44() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/cInterop/t44.kt"); + } + + @Test + @TestMetadata("t45.kt") + public void testT45() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/cInterop/t45.kt"); + } + + @Test + @TestMetadata("t46.kt") + public void testT46() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/cInterop/t46.kt"); + } + + @Test + @TestMetadata("t47.kt") + public void testT47() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/cInterop/t47.kt"); + } + + @Test + @TestMetadata("t60.kt") + public void testT60() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/cInterop/t60.kt"); + } + + @Test + @TestMetadata("t63.kt") + public void testT63() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/cInterop/t63.kt"); + } + + @Test + @TestMetadata("t64.kt") + public void testT64() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/cInterop/t64.kt"); + } + + @Test + @TestMetadata("t8.kt") + public void testT8() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/cInterop/t8.kt"); + } + + @Test + @TestMetadata("t9.kt") + public void testT9() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/cInterop/t9.kt"); + } + } + + @Nested + @TestMetadata("compiler/testData/diagnostics/nativeTests/specialBackendChecks/concurrent") + @TestDataPath("$PROJECT_ROOT") + @Tag("frontend-fir") + @FirPipeline() + public class Concurrent { + @Test + public void testAllFilesPresentInConcurrent() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/nativeTests/specialBackendChecks/concurrent"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.(reversed|fir|ll)\\.kts?$"), true); + } + + @Test + @TestMetadata("t48.kt") + public void testT48() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/concurrent/t48.kt"); + } + + @Test + @TestMetadata("t49.kt") + public void testT49() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/concurrent/t49.kt"); + } + + @Test + @TestMetadata("t50.kt") + public void testT50() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/concurrent/t50.kt"); + } + + @Test + @TestMetadata("t51.kt") + public void testT51() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/concurrent/t51.kt"); + } + } + + @Nested + @TestMetadata("compiler/testData/diagnostics/nativeTests/specialBackendChecks/immutableBlobOf") + @TestDataPath("$PROJECT_ROOT") + @Tag("frontend-fir") + @FirPipeline() + public class ImmutableBlobOf { + @Test + public void testAllFilesPresentInImmutableBlobOf() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/nativeTests/specialBackendChecks/immutableBlobOf"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.(reversed|fir|ll)\\.kts?$"), true); + } + + @Test + @TestMetadata("t54.kt") + public void testT54() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/immutableBlobOf/t54.kt"); + } + + @Test + @TestMetadata("t55.kt") + public void testT55() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/immutableBlobOf/t55.kt"); + } + + @Test + @TestMetadata("t56.kt") + public void testT56() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/immutableBlobOf/t56.kt"); + } + + @Test + @TestMetadata("t57.kt") + public void testT57() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/immutableBlobOf/t57.kt"); + } + } + + @Nested + @TestMetadata("compiler/testData/diagnostics/nativeTests/specialBackendChecks/nativeRef") + @TestDataPath("$PROJECT_ROOT") + @Tag("frontend-fir") + @FirPipeline() + public class NativeRef { + @Test + public void testAllFilesPresentInNativeRef() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/nativeTests/specialBackendChecks/nativeRef"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.(reversed|fir|ll)\\.kts?$"), true); + } + + @Test + @TestMetadata("t52.kt") + public void testT52() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/nativeRef/t52.kt"); + } + + @Test + @TestMetadata("t53.kt") + public void testT53() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/nativeRef/t53.kt"); + } + } + + @Nested + @TestMetadata("compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop") + @TestDataPath("$PROJECT_ROOT") + @Tag("frontend-fir") + @FirPipeline() + public class ObjCInterop { + @Test + public void testAllFilesPresentInObjCInterop() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.(reversed|fir|ll)\\.kts?$"), true); + } + + @Test + @TestMetadata("t15.kt") + public void testT15() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t15.kt"); + } + + @Test + @TestMetadata("t16.kt") + public void testT16() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t16.kt"); + } + + @Test + @TestMetadata("t17.kt") + public void testT17() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t17.kt"); + } + + @Test + @TestMetadata("t18.kt") + public void testT18() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t18.kt"); + } + + @Test + @TestMetadata("t2.kt") + public void testT2() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t2.kt"); + } + + @Test + @TestMetadata("t20.kt") + public void testT20() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t20.kt"); + } + + @Test + @TestMetadata("t21.kt") + public void testT21() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t21.kt"); + } + + @Test + @TestMetadata("t22.kt") + public void testT22() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t22.kt"); + } + + @Test + @TestMetadata("t23.kt") + public void testT23() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t23.kt"); + } + + @Test + @TestMetadata("t24.kt") + public void testT24() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t24.kt"); + } + + @Test + @TestMetadata("t25.kt") + public void testT25() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t25.kt"); + } + + @Test + @TestMetadata("t26.kt") + public void testT26() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t26.kt"); + } + + @Test + @TestMetadata("t27.kt") + public void testT27() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t27.kt"); + } + + @Test + @TestMetadata("t28.kt") + public void testT28() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t28.kt"); + } + + @Test + @TestMetadata("t29.kt") + public void testT29() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t29.kt"); + } + + @Test + @TestMetadata("t30.kt") + public void testT30() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t30.kt"); + } + + @Test + @TestMetadata("t31.kt") + public void testT31() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t31.kt"); + } + + @Test + @TestMetadata("t32.kt") + public void testT32() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t32.kt"); + } + + @Test + @TestMetadata("t33.kt") + public void testT33() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t33.kt"); + } + + @Test + @TestMetadata("t34.kt") + public void testT34() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t34.kt"); + } + + @Test + @TestMetadata("t35.kt") + public void testT35() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t35.kt"); + } + + @Test + @TestMetadata("t4.kt") + public void testT4() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t4.kt"); + } + + @Test + @TestMetadata("t5.kt") + public void testT5() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t5.kt"); + } + + @Test + @TestMetadata("t6.kt") + public void testT6() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t6.kt"); + } + + @Test + @TestMetadata("t61.kt") + public void testT61() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t61.kt"); + } + + @Test + @TestMetadata("t62.kt") + public void testT62() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t62.kt"); + } + + @Test + @TestMetadata("t7.kt") + public void testT7() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/objCInterop/t7.kt"); + } + } + + @Nested + @TestMetadata("compiler/testData/diagnostics/nativeTests/specialBackendChecks/posix") + @TestDataPath("$PROJECT_ROOT") + @Tag("frontend-fir") + @FirPipeline() + public class Posix { + @Test + public void testAllFilesPresentInPosix() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/nativeTests/specialBackendChecks/posix"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.(reversed|fir|ll)\\.kts?$"), true); + } + + @Test + @TestMetadata("t3.kt") + public void testT3() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/posix/t3.kt"); + } + + @Test + @TestMetadata("t36.kt") + public void testT36() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/posix/t36.kt"); + } + } + + @Nested + @TestMetadata("compiler/testData/diagnostics/nativeTests/specialBackendChecks/reflect") + @TestDataPath("$PROJECT_ROOT") + @Tag("frontend-fir") + @FirPipeline() + public class Reflect { + @Test + public void testAllFilesPresentInReflect() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/nativeTests/specialBackendChecks/reflect"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.(reversed|fir|ll)\\.kts?$"), true); + } + + @Test + @TestMetadata("t58.kt") + public void testT58() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/reflect/t58.kt"); + } + + @Test + @TestMetadata("t59.kt") + public void testT59() throws Exception { + runTest("compiler/testData/diagnostics/nativeTests/specialBackendChecks/reflect/t59.kt"); + } + } + } } diff --git a/native/native.tests/tests/org/jetbrains/kotlin/generators/tests/GenerateNativeTests.kt b/native/native.tests/tests/org/jetbrains/kotlin/generators/tests/GenerateNativeTests.kt index 0820b5c5f0d..c6c9eb7e17a 100644 --- a/native/native.tests/tests/org/jetbrains/kotlin/generators/tests/GenerateNativeTests.kt +++ b/native/native.tests/tests/org/jetbrains/kotlin/generators/tests/GenerateNativeTests.kt @@ -321,7 +321,13 @@ fun main() { // New frontend test infrastructure tests testGroup(testsRoot = "native/native.tests/tests-gen", testDataRoot = "compiler/testData") { testClass { - model("diagnostics/nativeTests", excludedPattern = CUSTOM_TEST_DATA_EXTENSION_PATTERN) + model( + "diagnostics/nativeTests", + excludedPattern = CUSTOM_TEST_DATA_EXTENSION_PATTERN, + // There are no special native-specific diagnostics in K1 frontend. + // These checks happen in native backend instead, in SpecialBackendChecks class. + excludeDirs = listOf("specialBackendChecks"), + ) } testClass( diff --git a/native/native.tests/tests/org/jetbrains/kotlin/konan/test/diagnostics/AbstractDiagnosticsNativeTest.kt b/native/native.tests/tests/org/jetbrains/kotlin/konan/test/diagnostics/AbstractDiagnosticsNativeTest.kt index 8c174910c1e..76f3634a19f 100644 --- a/native/native.tests/tests/org/jetbrains/kotlin/konan/test/diagnostics/AbstractDiagnosticsNativeTest.kt +++ b/native/native.tests/tests/org/jetbrains/kotlin/konan/test/diagnostics/AbstractDiagnosticsNativeTest.kt @@ -5,13 +5,16 @@ package org.jetbrains.kotlin.konan.test.diagnostics +import org.jetbrains.kotlin.konan.target.HostManager import org.jetbrains.kotlin.platform.konan.NativePlatforms import org.jetbrains.kotlin.test.Constructor import org.jetbrains.kotlin.test.FirParser +import org.jetbrains.kotlin.test.InTextDirectivesUtils import org.jetbrains.kotlin.test.builders.TestConfigurationBuilder import org.jetbrains.kotlin.test.builders.classicFrontendHandlersStep import org.jetbrains.kotlin.test.builders.firHandlersStep import org.jetbrains.kotlin.test.directives.* +import org.jetbrains.kotlin.test.directives.ConfigurationDirectives.WITH_PLATFORM_LIBS import org.jetbrains.kotlin.test.frontend.classic.ClassicFrontendFacade import org.jetbrains.kotlin.test.frontend.classic.ClassicFrontendOutputArtifact import org.jetbrains.kotlin.test.frontend.classic.handlers.ClassicDiagnosticsHandler @@ -29,6 +32,8 @@ import org.jetbrains.kotlin.test.services.configuration.CommonEnvironmentConfigu import org.jetbrains.kotlin.test.services.configuration.NativeEnvironmentConfigurator import org.jetbrains.kotlin.test.services.sourceProviders.AdditionalDiagnosticsSourceFilesProvider import org.jetbrains.kotlin.test.services.sourceProviders.CoroutineHelpersSourceFilesProvider +import org.junit.jupiter.api.Assumptions +import java.io.File abstract class AbstractDiagnosticsNativeTestBase> : AbstractKotlinCompilerTest() { abstract val targetFrontend: FrontendKind @@ -44,6 +49,17 @@ abstract class AbstractDiagnosticsNativeTestBase("Diagnostic tests using platform libs are not supported at non-Mac hosts. Test source: $filePath") + } } fun > TestConfigurationBuilder.baseNativeDiagnosticTestConfiguration(