From e0e2715864737457e3cfe944f2adcbf3811638a5 Mon Sep 17 00:00:00 2001 From: Shagen Ogandzhanian Date: Tue, 30 Mar 2021 16:53:12 +0200 Subject: [PATCH] [js] Fix constant folding for unsigned aithmetic in IR this resolves KT-44138 --- .../FirBlackBoxCodegenTestGenerated.java | 12 +- .../optimizations/FoldConstantLowering.kt | 38 +- .../box/constants/foldingBinaryOpsUnsigned.kt | 42 ++ .../codegen/box/unsignedTypes/kt30402.kt | 14 - .../codegen/BlackBoxCodegenTestGenerated.java | 12 +- .../IrBlackBoxCodegenTestGenerated.java | 12 +- .../LightAnalysisModeTestGenerated.java | 10 +- .../VisualizerBlackBoxTestGenerated.java | 708 ++++++++++++++---- .../gradle/GradleFacetImportTest.kt | 2 +- .../IrJsCodegenBoxES6TestGenerated.java | 10 +- .../IrJsCodegenBoxTestGenerated.java | 10 +- .../semantics/JsCodegenBoxTestGenerated.java | 10 +- .../IrCodegenBoxWasmTestGenerated.java | 10 +- 13 files changed, 677 insertions(+), 213 deletions(-) create mode 100644 compiler/testData/codegen/box/constants/foldingBinaryOpsUnsigned.kt delete mode 100644 compiler/testData/codegen/box/unsignedTypes/kt30402.kt diff --git a/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirBlackBoxCodegenTestGenerated.java b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirBlackBoxCodegenTestGenerated.java index 841a5f02872..1e69b35c4f2 100644 --- a/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirBlackBoxCodegenTestGenerated.java +++ b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirBlackBoxCodegenTestGenerated.java @@ -7142,6 +7142,12 @@ public class FirBlackBoxCodegenTestGenerated extends AbstractFirBlackBoxCodegenT runTest("compiler/testData/codegen/box/constants/float.kt"); } + @Test + @TestMetadata("foldingBinaryOpsUnsigned.kt") + public void testFoldingBinaryOpsUnsigned() throws Exception { + runTest("compiler/testData/codegen/box/constants/foldingBinaryOpsUnsigned.kt"); + } + @Test @TestMetadata("kt9532.kt") public void testKt9532() throws Exception { @@ -40360,12 +40366,6 @@ public class FirBlackBoxCodegenTestGenerated extends AbstractFirBlackBoxCodegenT runTest("compiler/testData/codegen/box/unsignedTypes/kt25784.kt"); } - @Test - @TestMetadata("kt30402.kt") - public void testKt30402() throws Exception { - runTest("compiler/testData/codegen/box/unsignedTypes/kt30402.kt"); - } - @Test @TestMetadata("kt43286.kt") public void testKt43286() throws Exception { diff --git a/compiler/ir/backend.common/src/org/jetbrains/kotlin/backend/common/lower/optimizations/FoldConstantLowering.kt b/compiler/ir/backend.common/src/org/jetbrains/kotlin/backend/common/lower/optimizations/FoldConstantLowering.kt index b2bb459d844..810433ada42 100644 --- a/compiler/ir/backend.common/src/org/jetbrains/kotlin/backend/common/lower/optimizations/FoldConstantLowering.kt +++ b/compiler/ir/backend.common/src/org/jetbrains/kotlin/backend/common/lower/optimizations/FoldConstantLowering.kt @@ -166,13 +166,13 @@ class FoldConstantLowering( evaluateBinary( call.symbol.owner.name.toString(), lhs.kind.toString(), - lhs.value!!, + normalizeUnsignedValue(lhs)!!, // 1. Although some operators have nullable parameters, evaluators deals with non-nullable types only. // The passed parameters are guaranteed to be non-null, since they are from IrConst. // 2. The operators are registered with prototype as if virtual member functions. They are identified by // actual_receiver_type.operator_name(parameter_type_in_prototype). call.symbol.owner.valueParameters[0].type.typeConstructorName(), - rhs.value!! + normalizeUnsignedValue(rhs)!! ) ?: return call } catch (e: Exception) { // Don't cast a runtime exception into compile time. E.g., division by zero. @@ -201,7 +201,24 @@ class FoldConstantLowering( return buildIrConstant(call.startOffset, call.endOffset, call.type, evaluated) } - // Unsigned constants are represented through signed constants with a different IrType. + private fun normalizeUnsignedValue(const: IrConst<*>): Any? { + // Unsigned constants are represented through signed constants with a different IrType + if (const.type.isUnsigned()) { + @OptIn(ExperimentalUnsignedTypes::class) + when (val kind = const.kind) { + is IrConstKind.Byte -> + return kind.valueOf(const).toUByte() + is IrConstKind.Short -> + return kind.valueOf(const).toUShort() + is IrConstKind.Int -> + return kind.valueOf(const).toUInt() + is IrConstKind.Long -> + return kind.valueOf(const).toULong() + } + } + return const.value + } + private fun constToString(const: IrConst<*>): String { if (floatSpecial) { when (val kind = const.kind) { @@ -224,20 +241,7 @@ class FoldConstantLowering( } } - if (const.type.isUnsigned()) { - @OptIn(ExperimentalUnsignedTypes::class) - when (val kind = const.kind) { - is IrConstKind.Byte -> - return kind.valueOf(const).toUByte().toString() - is IrConstKind.Short -> - return kind.valueOf(const).toUShort().toString() - is IrConstKind.Int -> - return kind.valueOf(const).toUInt().toString() - is IrConstKind.Long -> - return kind.valueOf(const).toULong().toString() - } - } - return const.value.toString() + return normalizeUnsignedValue(const).toString() } @ExperimentalUnsignedTypes diff --git a/compiler/testData/codegen/box/constants/foldingBinaryOpsUnsigned.kt b/compiler/testData/codegen/box/constants/foldingBinaryOpsUnsigned.kt new file mode 100644 index 00000000000..0c84fd37519 --- /dev/null +++ b/compiler/testData/codegen/box/constants/foldingBinaryOpsUnsigned.kt @@ -0,0 +1,42 @@ +// WITH_RUNTIME +// IGNORE_BACKEND: JVM +// IGNORE_BACKEND: WASM + +val a = "INT " + 0x8fffffffU +val b = "BYTE " + 0x8ffU +val c = "LONG " + 0xffff_ffff_ffffU + +val uint = 0x8fffffffU +val ubyte = 0x8ffU +val ulong = 0xffff_ffff_ffffU + +val aa = "INT " + uint +val bb = "BYTE " + ubyte +val cc = "LONG " + ulong + + +fun box(): String { + if (a != "INT 2415919103") { + return "FAIL 0: $a" + } + if (aa != "INT 2415919103") { + return "FAIL 1: $aa" + } + + if (b != "BYTE 2303") { + return "FAIL 2: $b" + } + if (bb != "BYTE 2303") { + return "FAIL 3: $bb" + } + + + if (c != "LONG 281474976710655") { + return "FAIL 4: $c" + } + if (cc != "LONG 281474976710655") { + return "FAIL 5: $cc" + } + + return "OK" +} diff --git a/compiler/testData/codegen/box/unsignedTypes/kt30402.kt b/compiler/testData/codegen/box/unsignedTypes/kt30402.kt deleted file mode 100644 index 8c2e612b4cb..00000000000 --- a/compiler/testData/codegen/box/unsignedTypes/kt30402.kt +++ /dev/null @@ -1,14 +0,0 @@ -// WITH_RUNTIME -// IGNORE_BACKEND: JVM -// IGNORE_BACKEND: JS_IR -// IGNORE_LIGHT_ANALYSIS - -val unsigned = 0x8fffffffU -val good = "123 " + unsigned -val bad = "123 " + 0x8fffffffU - -fun box(): String { - if (good != "123 2415919103") return "good: '$good'" - if (bad != "123 2415919103") return "bad: '$bad'" - return "OK" -} \ No newline at end of file diff --git a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/BlackBoxCodegenTestGenerated.java b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/BlackBoxCodegenTestGenerated.java index 85887f4307e..e169b93bd59 100644 --- a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/BlackBoxCodegenTestGenerated.java +++ b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/BlackBoxCodegenTestGenerated.java @@ -7142,6 +7142,12 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest { runTest("compiler/testData/codegen/box/constants/float.kt"); } + @Test + @TestMetadata("foldingBinaryOpsUnsigned.kt") + public void testFoldingBinaryOpsUnsigned() throws Exception { + runTest("compiler/testData/codegen/box/constants/foldingBinaryOpsUnsigned.kt"); + } + @Test @TestMetadata("kt9532.kt") public void testKt9532() throws Exception { @@ -40342,12 +40348,6 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest { runTest("compiler/testData/codegen/box/unsignedTypes/kt25784.kt"); } - @Test - @TestMetadata("kt30402.kt") - public void testKt30402() throws Exception { - runTest("compiler/testData/codegen/box/unsignedTypes/kt30402.kt"); - } - @Test @TestMetadata("kt43286.kt") public void testKt43286() throws Exception { diff --git a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenTestGenerated.java b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenTestGenerated.java index 43a6f58deeb..f1aaa6b23e9 100644 --- a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenTestGenerated.java +++ b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenTestGenerated.java @@ -7142,6 +7142,12 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes runTest("compiler/testData/codegen/box/constants/float.kt"); } + @Test + @TestMetadata("foldingBinaryOpsUnsigned.kt") + public void testFoldingBinaryOpsUnsigned() throws Exception { + runTest("compiler/testData/codegen/box/constants/foldingBinaryOpsUnsigned.kt"); + } + @Test @TestMetadata("kt9532.kt") public void testKt9532() throws Exception { @@ -40360,12 +40366,6 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes runTest("compiler/testData/codegen/box/unsignedTypes/kt25784.kt"); } - @Test - @TestMetadata("kt30402.kt") - public void testKt30402() throws Exception { - runTest("compiler/testData/codegen/box/unsignedTypes/kt30402.kt"); - } - @Test @TestMetadata("kt43286.kt") public void testKt43286() throws Exception { diff --git a/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java b/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java index 1784d6e0a55..4f2f23347fd 100644 --- a/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java +++ b/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java @@ -5377,6 +5377,11 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) public static class Constants extends AbstractLightAnalysisModeTest { + @TestMetadata("foldingBinaryOpsUnsigned.kt") + public void ignoreFoldingBinaryOpsUnsigned() throws Exception { + runTest("compiler/testData/codegen/box/constants/foldingBinaryOpsUnsigned.kt"); + } + private void runTest(String testDataFilePath) throws Exception { KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); } @@ -32278,11 +32283,6 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) public static class UnsignedTypes extends AbstractLightAnalysisModeTest { - @TestMetadata("kt30402.kt") - public void ignoreKt30402() throws Exception { - runTest("compiler/testData/codegen/box/unsignedTypes/kt30402.kt"); - } - private void runTest(String testDataFilePath) throws Exception { KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); } diff --git a/compiler/visualizer/tests-gen/org/jetbrains/kotlin/visualizer/VisualizerBlackBoxTestGenerated.java b/compiler/visualizer/tests-gen/org/jetbrains/kotlin/visualizer/VisualizerBlackBoxTestGenerated.java index fdfa9a7f08c..875998c8d14 100644 --- a/compiler/visualizer/tests-gen/org/jetbrains/kotlin/visualizer/VisualizerBlackBoxTestGenerated.java +++ b/compiler/visualizer/tests-gen/org/jetbrains/kotlin/visualizer/VisualizerBlackBoxTestGenerated.java @@ -135,6 +135,12 @@ public class VisualizerBlackBoxTestGenerated extends AbstractVisualizerBlackBoxT runTest("compiler/testData/codegen/box/annotations/fileClassWithFileAnnotation.kt"); } + @Test + @TestMetadata("genericAnnotations.kt") + public void testGenericAnnotations() throws Exception { + runTest("compiler/testData/codegen/box/annotations/genericAnnotations.kt"); + } + @Test @TestMetadata("javaAnnotationArrayValueDefault.kt") public void testJavaAnnotationArrayValueDefault() throws Exception { @@ -165,6 +171,12 @@ public class VisualizerBlackBoxTestGenerated extends AbstractVisualizerBlackBoxT runTest("compiler/testData/codegen/box/annotations/javaAnnotationOnProperty.kt"); } + @Test + @TestMetadata("javaAnnotationOnSecondaryConstructorOfLocalClass.kt") + public void testJavaAnnotationOnSecondaryConstructorOfLocalClass() throws Exception { + runTest("compiler/testData/codegen/box/annotations/javaAnnotationOnSecondaryConstructorOfLocalClass.kt"); + } + @Test @TestMetadata("javaNegativePropertyAsAnnotationParameter.kt") public void testJavaNegativePropertyAsAnnotationParameter() throws Exception { @@ -845,6 +857,12 @@ public class VisualizerBlackBoxTestGenerated extends AbstractVisualizerBlackBoxT runTest("compiler/testData/codegen/box/arrays/kt4118.kt"); } + @Test + @TestMetadata("kt42932.kt") + public void testKt42932() throws Exception { + runTest("compiler/testData/codegen/box/arrays/kt42932.kt"); + } + @Test @TestMetadata("kt4348.kt") public void testKt4348() throws Exception { @@ -857,6 +875,12 @@ public class VisualizerBlackBoxTestGenerated extends AbstractVisualizerBlackBoxT runTest("compiler/testData/codegen/box/arrays/kt4357.kt"); } + @Test + @TestMetadata("kt45410.kt") + public void testKt45410() throws Exception { + runTest("compiler/testData/codegen/box/arrays/kt45410.kt"); + } + @Test @TestMetadata("kt503.kt") public void testKt503() throws Exception { @@ -1333,6 +1357,12 @@ public class VisualizerBlackBoxTestGenerated extends AbstractVisualizerBlackBoxT runTest("compiler/testData/codegen/box/binaryOp/bitwiseOpNullable.kt"); } + @Test + @TestMetadata("boxingOfLiteralReceiverWithIntegerValueType.kt") + public void testBoxingOfLiteralReceiverWithIntegerValueType() throws Exception { + runTest("compiler/testData/codegen/box/binaryOp/boxingOfLiteralReceiverWithIntegerValueType.kt"); + } + @Test @TestMetadata("call.kt") public void testCall() throws Exception { @@ -1447,6 +1477,12 @@ public class VisualizerBlackBoxTestGenerated extends AbstractVisualizerBlackBoxT runTest("compiler/testData/codegen/box/binaryOp/kt23030_properIeee754comparisons.kt"); } + @Test + @TestMetadata("kt44402.kt") + public void testKt44402() throws Exception { + runTest("compiler/testData/codegen/box/binaryOp/kt44402.kt"); + } + @Test @TestMetadata("kt6747_identityEquals.kt") public void testKt6747_identityEquals() throws Exception { @@ -2503,6 +2539,12 @@ public class VisualizerBlackBoxTestGenerated extends AbstractVisualizerBlackBoxT @TestMetadata("compiler/testData/codegen/box/callableReference/adaptedReferences") @TestDataPath("$PROJECT_ROOT") public class AdaptedReferences { + @Test + @TestMetadata("adaptedVarargFunImportedFromObject.kt") + public void testAdaptedVarargFunImportedFromObject() throws Exception { + runTest("compiler/testData/codegen/box/callableReference/adaptedReferences/adaptedVarargFunImportedFromObject.kt"); + } + @Test public void testAllFilesPresentInAdaptedReferences() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/callableReference/adaptedReferences"), Pattern.compile("^(.+)\\.kt$"), null, true); @@ -5768,6 +5810,12 @@ public class VisualizerBlackBoxTestGenerated extends AbstractVisualizerBlackBoxT runTest("compiler/testData/codegen/box/closures/capturedVarsOptimization/kt44347.kt"); } + @Test + @TestMetadata("kt45446.kt") + public void testKt45446() throws Exception { + runTest("compiler/testData/codegen/box/closures/capturedVarsOptimization/kt45446.kt"); + } + @Test @TestMetadata("sharedSlotsWithCapturedVars.kt") public void testSharedSlotsWithCapturedVars() throws Exception { @@ -6147,18 +6195,6 @@ public class VisualizerBlackBoxTestGenerated extends AbstractVisualizerBlackBoxT runTest("compiler/testData/codegen/box/compileKotlinAgainstKotlin/annotationsOnTypeAliases.kt"); } - @Test - @TestMetadata("callDeserializedPropertyOnInlineClassType.kt") - public void testCallDeserializedPropertyOnInlineClassType() throws Exception { - runTest("compiler/testData/codegen/box/compileKotlinAgainstKotlin/callDeserializedPropertyOnInlineClassType.kt"); - } - - @Test - @TestMetadata("callDeserializedPropertyOnInlineClassTypeOldMangling.kt") - public void testCallDeserializedPropertyOnInlineClassTypeOldMangling() throws Exception { - runTest("compiler/testData/codegen/box/compileKotlinAgainstKotlin/callDeserializedPropertyOnInlineClassTypeOldMangling.kt"); - } - @Test @TestMetadata("callsToMultifileClassFromOtherPackage.kt") public void testCallsToMultifileClassFromOtherPackage() throws Exception { @@ -6201,18 +6237,6 @@ public class VisualizerBlackBoxTestGenerated extends AbstractVisualizerBlackBoxT runTest("compiler/testData/codegen/box/compileKotlinAgainstKotlin/constructorVararg.kt"); } - @Test - @TestMetadata("constructorWithInlineClassParametersInBinaryDependencies.kt") - public void testConstructorWithInlineClassParametersInBinaryDependencies() throws Exception { - runTest("compiler/testData/codegen/box/compileKotlinAgainstKotlin/constructorWithInlineClassParametersInBinaryDependencies.kt"); - } - - @Test - @TestMetadata("constructorWithInlineClassParametersInBinaryDependenciesOldMangling.kt") - public void testConstructorWithInlineClassParametersInBinaryDependenciesOldMangling() throws Exception { - runTest("compiler/testData/codegen/box/compileKotlinAgainstKotlin/constructorWithInlineClassParametersInBinaryDependenciesOldMangling.kt"); - } - @Test @TestMetadata("copySamOnInline.kt") public void testCopySamOnInline() throws Exception { @@ -6249,18 +6273,6 @@ public class VisualizerBlackBoxTestGenerated extends AbstractVisualizerBlackBoxT runTest("compiler/testData/codegen/box/compileKotlinAgainstKotlin/defaultLambdaRegeneration2.kt"); } - @Test - @TestMetadata("defaultWithInlineClassAndReceivers.kt") - public void testDefaultWithInlineClassAndReceivers() throws Exception { - runTest("compiler/testData/codegen/box/compileKotlinAgainstKotlin/defaultWithInlineClassAndReceivers.kt"); - } - - @Test - @TestMetadata("defaultWithInlineClassAndReceiversOldMangling.kt") - public void testDefaultWithInlineClassAndReceiversOldMangling() throws Exception { - runTest("compiler/testData/codegen/box/compileKotlinAgainstKotlin/defaultWithInlineClassAndReceiversOldMangling.kt"); - } - @Test @TestMetadata("delegatedDefault.kt") public void testDelegatedDefault() throws Exception { @@ -6303,60 +6315,6 @@ public class VisualizerBlackBoxTestGenerated extends AbstractVisualizerBlackBoxT runTest("compiler/testData/codegen/box/compileKotlinAgainstKotlin/importCompanion.kt"); } - @Test - @TestMetadata("inlineClassFakeOverrideMangling.kt") - public void testInlineClassFakeOverrideMangling() throws Exception { - runTest("compiler/testData/codegen/box/compileKotlinAgainstKotlin/inlineClassFakeOverrideMangling.kt"); - } - - @Test - @TestMetadata("inlineClassFakeOverrideManglingOldMangling.kt") - public void testInlineClassFakeOverrideManglingOldMangling() throws Exception { - runTest("compiler/testData/codegen/box/compileKotlinAgainstKotlin/inlineClassFakeOverrideManglingOldMangling.kt"); - } - - @Test - @TestMetadata("inlineClassFromBinaryDependencies.kt") - public void testInlineClassFromBinaryDependencies() throws Exception { - runTest("compiler/testData/codegen/box/compileKotlinAgainstKotlin/inlineClassFromBinaryDependencies.kt"); - } - - @Test - @TestMetadata("inlineClassFromBinaryDependenciesOldMangling.kt") - public void testInlineClassFromBinaryDependenciesOldMangling() throws Exception { - runTest("compiler/testData/codegen/box/compileKotlinAgainstKotlin/inlineClassFromBinaryDependenciesOldMangling.kt"); - } - - @Test - @TestMetadata("inlineClassInlineFunctionCall.kt") - public void testInlineClassInlineFunctionCall() throws Exception { - runTest("compiler/testData/codegen/box/compileKotlinAgainstKotlin/inlineClassInlineFunctionCall.kt"); - } - - @Test - @TestMetadata("inlineClassInlineFunctionCallOldMangling.kt") - public void testInlineClassInlineFunctionCallOldMangling() throws Exception { - runTest("compiler/testData/codegen/box/compileKotlinAgainstKotlin/inlineClassInlineFunctionCallOldMangling.kt"); - } - - @Test - @TestMetadata("inlineClassInlineProperty.kt") - public void testInlineClassInlineProperty() throws Exception { - runTest("compiler/testData/codegen/box/compileKotlinAgainstKotlin/inlineClassInlineProperty.kt"); - } - - @Test - @TestMetadata("inlineClassInlinePropertyOldMangling.kt") - public void testInlineClassInlinePropertyOldMangling() throws Exception { - runTest("compiler/testData/codegen/box/compileKotlinAgainstKotlin/inlineClassInlinePropertyOldMangling.kt"); - } - - @Test - @TestMetadata("inlineClassesOldMangling.kt") - public void testInlineClassesOldMangling() throws Exception { - runTest("compiler/testData/codegen/box/compileKotlinAgainstKotlin/inlineClassesOldMangling.kt"); - } - @Test @TestMetadata("inlinedConstants.kt") public void testInlinedConstants() throws Exception { @@ -6387,12 +6345,6 @@ public class VisualizerBlackBoxTestGenerated extends AbstractVisualizerBlackBoxT runTest("compiler/testData/codegen/box/compileKotlinAgainstKotlin/internalWithDefaultArgs.kt"); } - @Test - @TestMetadata("internalWithInlineClass.kt") - public void testInternalWithInlineClass() throws Exception { - runTest("compiler/testData/codegen/box/compileKotlinAgainstKotlin/internalWithInlineClass.kt"); - } - @Test @TestMetadata("internalWithOtherModuleName.kt") public void testInternalWithOtherModuleName() throws Exception { @@ -6567,30 +6519,6 @@ public class VisualizerBlackBoxTestGenerated extends AbstractVisualizerBlackBoxT runTest("compiler/testData/codegen/box/compileKotlinAgainstKotlin/platformTypes.kt"); } - @Test - @TestMetadata("privateCompanionObjectValInDifferentModule.kt") - public void testPrivateCompanionObjectValInDifferentModule() throws Exception { - runTest("compiler/testData/codegen/box/compileKotlinAgainstKotlin/privateCompanionObjectValInDifferentModule.kt"); - } - - @Test - @TestMetadata("privateCompanionObjectValInDifferentModuleOldMangling.kt") - public void testPrivateCompanionObjectValInDifferentModuleOldMangling() throws Exception { - runTest("compiler/testData/codegen/box/compileKotlinAgainstKotlin/privateCompanionObjectValInDifferentModuleOldMangling.kt"); - } - - @Test - @TestMetadata("privateTopLevelValInDifferentModule.kt") - public void testPrivateTopLevelValInDifferentModule() throws Exception { - runTest("compiler/testData/codegen/box/compileKotlinAgainstKotlin/privateTopLevelValInDifferentModule.kt"); - } - - @Test - @TestMetadata("privateTopLevelValInDifferentModuleOldMangling.kt") - public void testPrivateTopLevelValInDifferentModuleOldMangling() throws Exception { - runTest("compiler/testData/codegen/box/compileKotlinAgainstKotlin/privateTopLevelValInDifferentModuleOldMangling.kt"); - } - @Test @TestMetadata("propertyReference.kt") public void testPropertyReference() throws Exception { @@ -6645,18 +6573,6 @@ public class VisualizerBlackBoxTestGenerated extends AbstractVisualizerBlackBoxT runTest("compiler/testData/codegen/box/compileKotlinAgainstKotlin/starImportEnum.kt"); } - @Test - @TestMetadata("suspendFunWithDefaultMangling.kt") - public void testSuspendFunWithDefaultMangling() throws Exception { - runTest("compiler/testData/codegen/box/compileKotlinAgainstKotlin/suspendFunWithDefaultMangling.kt"); - } - - @Test - @TestMetadata("suspendFunWithDefaultOldMangling.kt") - public void testSuspendFunWithDefaultOldMangling() throws Exception { - runTest("compiler/testData/codegen/box/compileKotlinAgainstKotlin/suspendFunWithDefaultOldMangling.kt"); - } - @Test @TestMetadata("targetedJvmName.kt") public void testTargetedJvmName() throws Exception { @@ -6721,6 +6637,182 @@ public class VisualizerBlackBoxTestGenerated extends AbstractVisualizerBlackBoxT } } + @Nested + @TestMetadata("compiler/testData/codegen/box/compileKotlinAgainstKotlin/inlineClasses") + @TestDataPath("$PROJECT_ROOT") + public class InlineClasses { + @Test + public void testAllFilesPresentInInlineClasses() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/compileKotlinAgainstKotlin/inlineClasses"), Pattern.compile("^(.+)\\.kt$"), null, true); + } + + @Test + @TestMetadata("callDeserializedPropertyOnInlineClassType.kt") + public void testCallDeserializedPropertyOnInlineClassType() throws Exception { + runTest("compiler/testData/codegen/box/compileKotlinAgainstKotlin/inlineClasses/callDeserializedPropertyOnInlineClassType.kt"); + } + + @Test + @TestMetadata("constructorWithInlineClassParametersInBinaryDependencies.kt") + public void testConstructorWithInlineClassParametersInBinaryDependencies() throws Exception { + runTest("compiler/testData/codegen/box/compileKotlinAgainstKotlin/inlineClasses/constructorWithInlineClassParametersInBinaryDependencies.kt"); + } + + @Test + @TestMetadata("defaultWithInlineClassAndReceivers.kt") + public void testDefaultWithInlineClassAndReceivers() throws Exception { + runTest("compiler/testData/codegen/box/compileKotlinAgainstKotlin/inlineClasses/defaultWithInlineClassAndReceivers.kt"); + } + + @Test + @TestMetadata("inlineClassFakeOverrideMangling.kt") + public void testInlineClassFakeOverrideMangling() throws Exception { + runTest("compiler/testData/codegen/box/compileKotlinAgainstKotlin/inlineClasses/inlineClassFakeOverrideMangling.kt"); + } + + @Test + @TestMetadata("inlineClassFromBinaryDependencies.kt") + public void testInlineClassFromBinaryDependencies() throws Exception { + runTest("compiler/testData/codegen/box/compileKotlinAgainstKotlin/inlineClasses/inlineClassFromBinaryDependencies.kt"); + } + + @Test + @TestMetadata("inlineClassInlineFunctionCall.kt") + public void testInlineClassInlineFunctionCall() throws Exception { + runTest("compiler/testData/codegen/box/compileKotlinAgainstKotlin/inlineClasses/inlineClassInlineFunctionCall.kt"); + } + + @Test + @TestMetadata("inlineClassInlineProperty.kt") + public void testInlineClassInlineProperty() throws Exception { + runTest("compiler/testData/codegen/box/compileKotlinAgainstKotlin/inlineClasses/inlineClassInlineProperty.kt"); + } + + @Test + @TestMetadata("internalWithInlineClass.kt") + public void testInternalWithInlineClass() throws Exception { + runTest("compiler/testData/codegen/box/compileKotlinAgainstKotlin/inlineClasses/internalWithInlineClass.kt"); + } + + @Test + @TestMetadata("privateCompanionObjectValInDifferentModule.kt") + public void testPrivateCompanionObjectValInDifferentModule() throws Exception { + runTest("compiler/testData/codegen/box/compileKotlinAgainstKotlin/inlineClasses/privateCompanionObjectValInDifferentModule.kt"); + } + + @Test + @TestMetadata("privateConstructor.kt") + public void testPrivateConstructor() throws Exception { + runTest("compiler/testData/codegen/box/compileKotlinAgainstKotlin/inlineClasses/privateConstructor.kt"); + } + + @Test + @TestMetadata("privateConstructorWithPrivateField.kt") + public void testPrivateConstructorWithPrivateField() throws Exception { + runTest("compiler/testData/codegen/box/compileKotlinAgainstKotlin/inlineClasses/privateConstructorWithPrivateField.kt"); + } + + @Test + @TestMetadata("privateTopLevelValInDifferentModule.kt") + public void testPrivateTopLevelValInDifferentModule() throws Exception { + runTest("compiler/testData/codegen/box/compileKotlinAgainstKotlin/inlineClasses/privateTopLevelValInDifferentModule.kt"); + } + + @Test + @TestMetadata("suspendFunWithDefaultMangling.kt") + public void testSuspendFunWithDefaultMangling() throws Exception { + runTest("compiler/testData/codegen/box/compileKotlinAgainstKotlin/inlineClasses/suspendFunWithDefaultMangling.kt"); + } + + @Nested + @TestMetadata("compiler/testData/codegen/box/compileKotlinAgainstKotlin/inlineClasses/oldMangling") + @TestDataPath("$PROJECT_ROOT") + public class OldMangling { + @Test + public void testAllFilesPresentInOldMangling() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/compileKotlinAgainstKotlin/inlineClasses/oldMangling"), Pattern.compile("^(.+)\\.kt$"), null, true); + } + + @Test + @TestMetadata("callDeserializedPropertyOnInlineClassType.kt") + public void testCallDeserializedPropertyOnInlineClassType() throws Exception { + runTest("compiler/testData/codegen/box/compileKotlinAgainstKotlin/inlineClasses/oldMangling/callDeserializedPropertyOnInlineClassType.kt"); + } + + @Test + @TestMetadata("constructorWithInlineClassParametersInBinaryDependencies.kt") + public void testConstructorWithInlineClassParametersInBinaryDependencies() throws Exception { + runTest("compiler/testData/codegen/box/compileKotlinAgainstKotlin/inlineClasses/oldMangling/constructorWithInlineClassParametersInBinaryDependencies.kt"); + } + + @Test + @TestMetadata("defaultWithInlineClassAndReceivers.kt") + public void testDefaultWithInlineClassAndReceivers() throws Exception { + runTest("compiler/testData/codegen/box/compileKotlinAgainstKotlin/inlineClasses/oldMangling/defaultWithInlineClassAndReceivers.kt"); + } + + @Test + @TestMetadata("inlineClassFakeOverrideMangling.kt") + public void testInlineClassFakeOverrideMangling() throws Exception { + runTest("compiler/testData/codegen/box/compileKotlinAgainstKotlin/inlineClasses/oldMangling/inlineClassFakeOverrideMangling.kt"); + } + + @Test + @TestMetadata("inlineClassFromBinaryDependencies.kt") + public void testInlineClassFromBinaryDependencies() throws Exception { + runTest("compiler/testData/codegen/box/compileKotlinAgainstKotlin/inlineClasses/oldMangling/inlineClassFromBinaryDependencies.kt"); + } + + @Test + @TestMetadata("inlineClassInlineFunctionCall.kt") + public void testInlineClassInlineFunctionCall() throws Exception { + runTest("compiler/testData/codegen/box/compileKotlinAgainstKotlin/inlineClasses/oldMangling/inlineClassInlineFunctionCall.kt"); + } + + @Test + @TestMetadata("inlineClassInlineProperty.kt") + public void testInlineClassInlineProperty() throws Exception { + runTest("compiler/testData/codegen/box/compileKotlinAgainstKotlin/inlineClasses/oldMangling/inlineClassInlineProperty.kt"); + } + + @Test + @TestMetadata("privateCompanionObjectValInDifferentModule.kt") + public void testPrivateCompanionObjectValInDifferentModule() throws Exception { + runTest("compiler/testData/codegen/box/compileKotlinAgainstKotlin/inlineClasses/oldMangling/privateCompanionObjectValInDifferentModule.kt"); + } + + @Test + @TestMetadata("privateConstructor.kt") + public void testPrivateConstructor() throws Exception { + runTest("compiler/testData/codegen/box/compileKotlinAgainstKotlin/inlineClasses/oldMangling/privateConstructor.kt"); + } + + @Test + @TestMetadata("privateConstructorWithPrivateField.kt") + public void testPrivateConstructorWithPrivateField() throws Exception { + runTest("compiler/testData/codegen/box/compileKotlinAgainstKotlin/inlineClasses/oldMangling/privateConstructorWithPrivateField.kt"); + } + + @Test + @TestMetadata("privateTopLevelValInDifferentModule.kt") + public void testPrivateTopLevelValInDifferentModule() throws Exception { + runTest("compiler/testData/codegen/box/compileKotlinAgainstKotlin/inlineClasses/oldMangling/privateTopLevelValInDifferentModule.kt"); + } + + @Test + @TestMetadata("suspendFunWithDefaultOldMangling.kt") + public void testSuspendFunWithDefaultOldMangling() throws Exception { + runTest("compiler/testData/codegen/box/compileKotlinAgainstKotlin/inlineClasses/oldMangling/suspendFunWithDefaultOldMangling.kt"); + } + + @Test + @TestMetadata("useOldMangling.kt") + public void testUseOldMangling() throws Exception { + runTest("compiler/testData/codegen/box/compileKotlinAgainstKotlin/inlineClasses/oldMangling/useOldMangling.kt"); + } + } + } + @Nested @TestMetadata("compiler/testData/codegen/box/compileKotlinAgainstKotlin/jvm8") @TestDataPath("$PROJECT_ROOT") @@ -7067,6 +7159,12 @@ public class VisualizerBlackBoxTestGenerated extends AbstractVisualizerBlackBoxT runTest("compiler/testData/codegen/box/constants/float.kt"); } + @Test + @TestMetadata("foldingBinaryOpsUnsigned.kt") + public void testFoldingBinaryOpsUnsigned() throws Exception { + runTest("compiler/testData/codegen/box/constants/foldingBinaryOpsUnsigned.kt"); + } + @Test @TestMetadata("kt9532.kt") public void testKt9532() throws Exception { @@ -7830,6 +7928,12 @@ public class VisualizerBlackBoxTestGenerated extends AbstractVisualizerBlackBoxT runTest("compiler/testData/codegen/box/controlStructures/breakContinueInExpressions/breakInExpr.kt"); } + @Test + @TestMetadata("breakInLoopConditions.kt") + public void testBreakInLoopConditions() throws Exception { + runTest("compiler/testData/codegen/box/controlStructures/breakContinueInExpressions/breakInLoopConditions.kt"); + } + @Test @TestMetadata("continueInDoWhile.kt") public void testContinueInDoWhile() throws Exception { @@ -8985,6 +9089,12 @@ public class VisualizerBlackBoxTestGenerated extends AbstractVisualizerBlackBoxT runTest("compiler/testData/codegen/box/coroutines/kt44221.kt"); } + @Test + @TestMetadata("kt45377.kt") + public void testKt45377() throws Exception { + runTest("compiler/testData/codegen/box/coroutines/kt45377.kt"); + } + @Test @TestMetadata("lastExpressionIsLoop.kt") public void testLastExpressionIsLoop() throws Exception { @@ -9891,6 +10001,12 @@ public class VisualizerBlackBoxTestGenerated extends AbstractVisualizerBlackBoxT runTest("compiler/testData/codegen/box/coroutines/inlineClasses/direct/boxReturnValueOfSuspendLambda.kt"); } + @Test + @TestMetadata("boxTypeParameterOfSuperType.kt") + public void testBoxTypeParameterOfSuperType() throws Exception { + runTest("compiler/testData/codegen/box/coroutines/inlineClasses/direct/boxTypeParameterOfSuperType.kt"); + } + @Test @TestMetadata("boxUnboxInsideCoroutine.kt") public void testBoxUnboxInsideCoroutine() throws Exception { @@ -10159,6 +10275,12 @@ public class VisualizerBlackBoxTestGenerated extends AbstractVisualizerBlackBoxT runTest("compiler/testData/codegen/box/coroutines/inlineClasses/resume/boxReturnValueOfSuspendLambda.kt"); } + @Test + @TestMetadata("boxTypeParameterOfSuperType.kt") + public void testBoxTypeParameterOfSuperType() throws Exception { + runTest("compiler/testData/codegen/box/coroutines/inlineClasses/resume/boxTypeParameterOfSuperType.kt"); + } + @Test @TestMetadata("boxUnboxInsideCoroutine.kt") public void testBoxUnboxInsideCoroutine() throws Exception { @@ -10427,6 +10549,12 @@ public class VisualizerBlackBoxTestGenerated extends AbstractVisualizerBlackBoxT runTest("compiler/testData/codegen/box/coroutines/inlineClasses/resumeWithException/boxReturnValueOfSuspendLambda.kt"); } + @Test + @TestMetadata("boxTypeParameterOfSuperType.kt") + public void testBoxTypeParameterOfSuperType() throws Exception { + runTest("compiler/testData/codegen/box/coroutines/inlineClasses/resumeWithException/boxTypeParameterOfSuperType.kt"); + } + @Test @TestMetadata("boxUnboxInsideCoroutine.kt") public void testBoxUnboxInsideCoroutine() throws Exception { @@ -12041,6 +12169,24 @@ public class VisualizerBlackBoxTestGenerated extends AbstractVisualizerBlackBoxT runTest("compiler/testData/codegen/box/defaultArguments/inheritedFromInterfaceViaAbstractSuperclass.kt"); } + @Test + @TestMetadata("kt36853.kt") + public void testKt36853() throws Exception { + runTest("compiler/testData/codegen/box/defaultArguments/kt36853.kt"); + } + + @Test + @TestMetadata("kt36853_nestedObject.kt") + public void testKt36853_nestedObject() throws Exception { + runTest("compiler/testData/codegen/box/defaultArguments/kt36853_nestedObject.kt"); + } + + @Test + @TestMetadata("kt36853a.kt") + public void testKt36853a() throws Exception { + runTest("compiler/testData/codegen/box/defaultArguments/kt36853a.kt"); + } + @Test @TestMetadata("kt36972_companion.kt") public void testKt36972_companion() throws Exception { @@ -12695,6 +12841,12 @@ public class VisualizerBlackBoxTestGenerated extends AbstractVisualizerBlackBoxT runTest("compiler/testData/codegen/box/delegatedProperty/insideInlinedObjectMultiModule.kt"); } + @Test + @TestMetadata("javaDelegateTopLevel.kt") + public void testJavaDelegateTopLevel() throws Exception { + runTest("compiler/testData/codegen/box/delegatedProperty/javaDelegateTopLevel.kt"); + } + @Test @TestMetadata("kt35707.kt") public void testKt35707() throws Exception { @@ -12713,6 +12865,12 @@ public class VisualizerBlackBoxTestGenerated extends AbstractVisualizerBlackBoxT runTest("compiler/testData/codegen/box/delegatedProperty/kt4138.kt"); } + @Test + @TestMetadata("kt45431.kt") + public void testKt45431() throws Exception { + runTest("compiler/testData/codegen/box/delegatedProperty/kt45431.kt"); + } + @Test @TestMetadata("kt6722.kt") public void testKt6722() throws Exception { @@ -13221,6 +13379,12 @@ public class VisualizerBlackBoxTestGenerated extends AbstractVisualizerBlackBoxT runTest("compiler/testData/codegen/box/delegation/inClassDeclaration.kt"); } + @Test + @TestMetadata("inDataClass.kt") + public void testInDataClass() throws Exception { + runTest("compiler/testData/codegen/box/delegation/inDataClass.kt"); + } + @Test @TestMetadata("kt8154.kt") public void testKt8154() throws Exception { @@ -14041,6 +14205,18 @@ public class VisualizerBlackBoxTestGenerated extends AbstractVisualizerBlackBoxT runTest("compiler/testData/codegen/box/enum/kt38996.kt"); } + @Test + @TestMetadata("kt44744.kt") + public void testKt44744() throws Exception { + runTest("compiler/testData/codegen/box/enum/kt44744.kt"); + } + + @Test + @TestMetadata("kt44744_innerClass.kt") + public void testKt44744_innerClass() throws Exception { + runTest("compiler/testData/codegen/box/enum/kt44744_innerClass.kt"); + } + @Test @TestMetadata("kt7257.kt") public void testKt7257() throws Exception { @@ -14295,6 +14471,12 @@ public class VisualizerBlackBoxTestGenerated extends AbstractVisualizerBlackBoxT runTest("compiler/testData/codegen/box/evaluate/divide.kt"); } + @Test + @TestMetadata("floorDiv.kt") + public void testFloorDiv() throws Exception { + runTest("compiler/testData/codegen/box/evaluate/floorDiv.kt"); + } + @Test @TestMetadata("intrinsics.kt") public void testIntrinsics() throws Exception { @@ -14355,6 +14537,12 @@ public class VisualizerBlackBoxTestGenerated extends AbstractVisualizerBlackBoxT runTest("compiler/testData/codegen/box/evaluate/plus.kt"); } + @Test + @TestMetadata("rem.kt") + public void testRem() throws Exception { + runTest("compiler/testData/codegen/box/evaluate/rem.kt"); + } + @Test @TestMetadata("simpleCallBinary.kt") public void testSimpleCallBinary() throws Exception { @@ -14933,6 +15121,18 @@ public class VisualizerBlackBoxTestGenerated extends AbstractVisualizerBlackBoxT KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/fir"), Pattern.compile("^(.+)\\.kt$"), null, true); } + @Test + @TestMetadata("callableReferenceToJavaField.kt") + public void testCallableReferenceToJavaField() throws Exception { + runTest("compiler/testData/codegen/box/fir/callableReferenceToJavaField.kt"); + } + + @Test + @TestMetadata("callableReferenceToStaticFunction.kt") + public void testCallableReferenceToStaticFunction() throws Exception { + runTest("compiler/testData/codegen/box/fir/callableReferenceToStaticFunction.kt"); + } + @Test @TestMetadata("ClassBuilder.kt") public void testClassBuilder() throws Exception { @@ -14963,12 +15163,24 @@ public class VisualizerBlackBoxTestGenerated extends AbstractVisualizerBlackBoxT runTest("compiler/testData/codegen/box/fir/FakeOverrideBuilder.kt"); } + @Test + @TestMetadata("falsePositiveBoundSmartcast.kt") + public void testFalsePositiveBoundSmartcast() throws Exception { + runTest("compiler/testData/codegen/box/fir/falsePositiveBoundSmartcast.kt"); + } + @Test @TestMetadata("Fir2IrClassifierStorage.kt") public void testFir2IrClassifierStorage() throws Exception { runTest("compiler/testData/codegen/box/fir/Fir2IrClassifierStorage.kt"); } + @Test + @TestMetadata("incorrectBytecodeWithEnhancedNullability.kt") + public void testIncorrectBytecodeWithEnhancedNullability() throws Exception { + runTest("compiler/testData/codegen/box/fir/incorrectBytecodeWithEnhancedNullability.kt"); + } + @Test @TestMetadata("IrBuiltIns.kt") public void testIrBuiltIns() throws Exception { @@ -14993,6 +15205,12 @@ public class VisualizerBlackBoxTestGenerated extends AbstractVisualizerBlackBoxT runTest("compiler/testData/codegen/box/fir/NameHighlighter.kt"); } + @Test + @TestMetadata("noSymbolForIntRangeIterator.kt") + public void testNoSymbolForIntRangeIterator() throws Exception { + runTest("compiler/testData/codegen/box/fir/noSymbolForIntRangeIterator.kt"); + } + @Test @TestMetadata("SuspendExtension.kt") public void testSuspendExtension() throws Exception { @@ -15171,6 +15389,12 @@ public class VisualizerBlackBoxTestGenerated extends AbstractVisualizerBlackBoxT runTest("compiler/testData/codegen/box/funInterface/irrelevantPrivateDeclarations.kt"); } + @Test + @TestMetadata("kt44827_funInterface.kt") + public void testKt44827_funInterface() throws Exception { + runTest("compiler/testData/codegen/box/funInterface/kt44827_funInterface.kt"); + } + @Test @TestMetadata("multimodule.kt") public void testMultimodule() throws Exception { @@ -15533,6 +15757,12 @@ public class VisualizerBlackBoxTestGenerated extends AbstractVisualizerBlackBoxT runTest("compiler/testData/codegen/box/functions/max.kt"); } + @Test + @TestMetadata("mutualInline.kt") + public void testMutualInline() throws Exception { + runTest("compiler/testData/codegen/box/functions/mutualInline.kt"); + } + @Test @TestMetadata("nothisnoclosure.kt") public void testNothisnoclosure() throws Exception { @@ -16798,6 +17028,12 @@ public class VisualizerBlackBoxTestGenerated extends AbstractVisualizerBlackBoxT KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/inference/builderInference"), Pattern.compile("^(.+)\\.kt$"), null, true); } + @Test + @TestMetadata("builderCallAsReturnTypeInLocalClass.kt") + public void testBuilderCallAsReturnTypeInLocalClass() throws Exception { + runTest("compiler/testData/codegen/box/inference/builderInference/builderCallAsReturnTypeInLocalClass.kt"); + } + @Test @TestMetadata("callableReferenceAndCoercionToUnit.kt") public void testCallableReferenceAndCoercionToUnit() throws Exception { @@ -16875,6 +17111,30 @@ public class VisualizerBlackBoxTestGenerated extends AbstractVisualizerBlackBoxT public void testSubstitutelambdaExtensionReceiverType() throws Exception { runTest("compiler/testData/codegen/box/inference/builderInference/substitutelambdaExtensionReceiverType.kt"); } + + @Test + @TestMetadata("topDownCompletionBreakedByNonBuilderInferenceSession.kt") + public void testTopDownCompletionBreakedByNonBuilderInferenceSession() throws Exception { + runTest("compiler/testData/codegen/box/inference/builderInference/topDownCompletionBreakedByNonBuilderInferenceSession.kt"); + } + + @Test + @TestMetadata("topDownCompletionWithThreeBuilderInferenceCalls.kt") + public void testTopDownCompletionWithThreeBuilderInferenceCalls() throws Exception { + runTest("compiler/testData/codegen/box/inference/builderInference/topDownCompletionWithThreeBuilderInferenceCalls.kt"); + } + + @Test + @TestMetadata("topDownCompletionWithThreeBuilderInferenceCallsSameLevel.kt") + public void testTopDownCompletionWithThreeBuilderInferenceCallsSameLevel() throws Exception { + runTest("compiler/testData/codegen/box/inference/builderInference/topDownCompletionWithThreeBuilderInferenceCallsSameLevel.kt"); + } + + @Test + @TestMetadata("topDownCompletionWithTwoBuilderInferenceCalls.kt") + public void testTopDownCompletionWithTwoBuilderInferenceCalls() throws Exception { + runTest("compiler/testData/codegen/box/inference/builderInference/topDownCompletionWithTwoBuilderInferenceCalls.kt"); + } } } @@ -17661,6 +17921,12 @@ public class VisualizerBlackBoxTestGenerated extends AbstractVisualizerBlackBoxT runTest("compiler/testData/codegen/box/inlineClasses/kt44141.kt"); } + @Test + @TestMetadata("kt44867.kt") + public void testKt44867() throws Exception { + runTest("compiler/testData/codegen/box/inlineClasses/kt44867.kt"); + } + @Test @TestMetadata("mangledDefaultParameterFunction.kt") public void testMangledDefaultParameterFunction() throws Exception { @@ -17793,6 +18059,12 @@ public class VisualizerBlackBoxTestGenerated extends AbstractVisualizerBlackBoxT runTest("compiler/testData/codegen/box/inlineClasses/resultRunCatchingOrElse.kt"); } + @Test + @TestMetadata("safeAsOfTypeParameterWithInlineClassBound.kt") + public void testSafeAsOfTypeParameterWithInlineClassBound() throws Exception { + runTest("compiler/testData/codegen/box/inlineClasses/safeAsOfTypeParameterWithInlineClassBound.kt"); + } + @Test @TestMetadata("secondaryConstructorWithVararg.kt") public void testSecondaryConstructorWithVararg() throws Exception { @@ -18579,6 +18851,52 @@ public class VisualizerBlackBoxTestGenerated extends AbstractVisualizerBlackBoxT } } + @Nested + @TestMetadata("compiler/testData/codegen/box/inlineClasses/funInterface") + @TestDataPath("$PROJECT_ROOT") + public class FunInterface { + @Test + public void testAllFilesPresentInFunInterface() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/inlineClasses/funInterface"), Pattern.compile("^(.+)\\.kt$"), null, true); + } + + @Test + @TestMetadata("argumentIC.kt") + public void testArgumentIC() throws Exception { + runTest("compiler/testData/codegen/box/inlineClasses/funInterface/argumentIC.kt"); + } + + @Test + @TestMetadata("argumentResult.kt") + public void testArgumentResult() throws Exception { + runTest("compiler/testData/codegen/box/inlineClasses/funInterface/argumentResult.kt"); + } + + @Test + @TestMetadata("javaSam.kt") + public void testJavaSam() throws Exception { + runTest("compiler/testData/codegen/box/inlineClasses/funInterface/javaSam.kt"); + } + + @Test + @TestMetadata("javaSamReturnResult.kt") + public void testJavaSamReturnResult() throws Exception { + runTest("compiler/testData/codegen/box/inlineClasses/funInterface/javaSamReturnResult.kt"); + } + + @Test + @TestMetadata("returnIC.kt") + public void testReturnIC() throws Exception { + runTest("compiler/testData/codegen/box/inlineClasses/funInterface/returnIC.kt"); + } + + @Test + @TestMetadata("returnResult.kt") + public void testReturnResult() throws Exception { + runTest("compiler/testData/codegen/box/inlineClasses/funInterface/returnResult.kt"); + } + } + @Nested @TestMetadata("compiler/testData/codegen/box/inlineClasses/functionNameMangling") @TestDataPath("$PROJECT_ROOT") @@ -19345,6 +19663,12 @@ public class VisualizerBlackBoxTestGenerated extends AbstractVisualizerBlackBoxT runTest("compiler/testData/codegen/box/innerNested/createdNestedInOuterMember.kt"); } + @Test + @TestMetadata("extenderNestedClass.kt") + public void testExtenderNestedClass() throws Exception { + runTest("compiler/testData/codegen/box/innerNested/extenderNestedClass.kt"); + } + @Test @TestMetadata("extensionFun.kt") public void testExtensionFun() throws Exception { @@ -19920,6 +20244,12 @@ public class VisualizerBlackBoxTestGenerated extends AbstractVisualizerBlackBoxT runTest("compiler/testData/codegen/box/invokedynamic/lambdas/extensionLambda.kt"); } + @Test + @TestMetadata("genericLambdaSignature.kt") + public void testGenericLambdaSignature() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/lambdas/genericLambdaSignature.kt"); + } + @Test @TestMetadata("lambdaSerializable.kt") public void testLambdaSerializable() throws Exception { @@ -20102,6 +20432,12 @@ public class VisualizerBlackBoxTestGenerated extends AbstractVisualizerBlackBoxT runTest("compiler/testData/codegen/box/invokedynamic/sam/genericFunInterfaceWithPrimitive.kt"); } + @Test + @TestMetadata("genericLambdaSignature.kt") + public void testGenericLambdaSignature() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/sam/genericLambdaSignature.kt"); + } + @Test @TestMetadata("intReturnTypeAsNumber.kt") public void testIntReturnTypeAsNumber() throws Exception { @@ -20289,6 +20625,18 @@ public class VisualizerBlackBoxTestGenerated extends AbstractVisualizerBlackBoxT runTest("compiler/testData/codegen/box/invokedynamic/sam/functionRefToJavaInterface/boundMemberRef.kt"); } + @Test + @TestMetadata("boundRefToSuperClassMethod.kt") + public void testBoundRefToSuperClassMethod() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/sam/functionRefToJavaInterface/boundRefToSuperClassMethod.kt"); + } + + @Test + @TestMetadata("boundRefToSuperInterfaceMethod.kt") + public void testBoundRefToSuperInterfaceMethod() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/sam/functionRefToJavaInterface/boundRefToSuperInterfaceMethod.kt"); + } + @Test @TestMetadata("constructorRef.kt") public void testConstructorRef() throws Exception { @@ -20313,6 +20661,18 @@ public class VisualizerBlackBoxTestGenerated extends AbstractVisualizerBlackBoxT runTest("compiler/testData/codegen/box/invokedynamic/sam/functionRefToJavaInterface/intReturnTypeAsNumber.kt"); } + @Test + @TestMetadata("interfaceMemberRef.kt") + public void testInterfaceMemberRef() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/sam/functionRefToJavaInterface/interfaceMemberRef.kt"); + } + + @Test + @TestMetadata("kt45581.kt") + public void testKt45581() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/sam/functionRefToJavaInterface/kt45581.kt"); + } + @Test @TestMetadata("localFunction1.kt") public void testLocalFunction1() throws Exception { @@ -20871,6 +21231,12 @@ public class VisualizerBlackBoxTestGenerated extends AbstractVisualizerBlackBoxT runTest("compiler/testData/codegen/box/javaInterop/ambiguousJavaVararg.kt"); } + @Test + @TestMetadata("conflictingOverloadsForThrowableInheritors.kt") + public void testConflictingOverloadsForThrowableInheritors() throws Exception { + runTest("compiler/testData/codegen/box/javaInterop/conflictingOverloadsForThrowableInheritors.kt"); + } + @Test @TestMetadata("genericSamProjectedOut.kt") public void testGenericSamProjectedOut() throws Exception { @@ -20919,6 +21285,12 @@ public class VisualizerBlackBoxTestGenerated extends AbstractVisualizerBlackBoxT runTest("compiler/testData/codegen/box/javaInterop/samUnboundTypeParameter.kt"); } + @Test + @TestMetadata("superCallOfPrintStackTrace.kt") + public void testSuperCallOfPrintStackTrace() throws Exception { + runTest("compiler/testData/codegen/box/javaInterop/superCallOfPrintStackTrace.kt"); + } + @Nested @TestMetadata("compiler/testData/codegen/box/javaInterop/generics") @TestDataPath("$PROJECT_ROOT") @@ -22043,6 +22415,18 @@ public class VisualizerBlackBoxTestGenerated extends AbstractVisualizerBlackBoxT runTest("compiler/testData/codegen/box/jvm8/defaults/allCompatibility/privateFunInInterface.kt"); } + @Test + @TestMetadata("privateFunWithDefaultArg.kt") + public void testPrivateFunWithDefaultArg() throws Exception { + runTest("compiler/testData/codegen/box/jvm8/defaults/allCompatibility/privateFunWithDefaultArg.kt"); + } + + @Test + @TestMetadata("privateFunWithDefaultArg2.kt") + public void testPrivateFunWithDefaultArg2() throws Exception { + runTest("compiler/testData/codegen/box/jvm8/defaults/allCompatibility/privateFunWithDefaultArg2.kt"); + } + @Test @TestMetadata("privateSuspend.kt") public void testPrivateSuspend() throws Exception { @@ -22061,6 +22445,12 @@ public class VisualizerBlackBoxTestGenerated extends AbstractVisualizerBlackBoxT runTest("compiler/testData/codegen/box/jvm8/defaults/allCompatibility/simpleFunction.kt"); } + @Test + @TestMetadata("superCall.kt") + public void testSuperCall() throws Exception { + runTest("compiler/testData/codegen/box/jvm8/defaults/allCompatibility/superCall.kt"); + } + @Test @TestMetadata("suspendFunction.kt") public void testSuspendFunction() throws Exception { @@ -22389,6 +22779,12 @@ public class VisualizerBlackBoxTestGenerated extends AbstractVisualizerBlackBoxT runTest("compiler/testData/codegen/box/jvm8/defaults/noDefaultImpls/privateFunInInterface.kt"); } + @Test + @TestMetadata("privateFunWithDefaultArg.kt") + public void testPrivateFunWithDefaultArg() throws Exception { + runTest("compiler/testData/codegen/box/jvm8/defaults/noDefaultImpls/privateFunWithDefaultArg.kt"); + } + @Test @TestMetadata("privateSuspend.kt") public void testPrivateSuspend() throws Exception { @@ -23213,6 +23609,12 @@ public class VisualizerBlackBoxTestGenerated extends AbstractVisualizerBlackBoxT runTest("compiler/testData/codegen/box/jvmStatic/kt35716.kt"); } + @Test + @TestMetadata("kt45408.kt") + public void testKt45408() throws Exception { + runTest("compiler/testData/codegen/box/jvmStatic/kt45408.kt"); + } + @Test @TestMetadata("kt9897_static.kt") public void testKt9897_static() throws Exception { @@ -24521,6 +24923,12 @@ public class VisualizerBlackBoxTestGenerated extends AbstractVisualizerBlackBoxT runTest("compiler/testData/codegen/box/multiplatform/expectClassInJvmMultifileFacade.kt"); } + @Test + @TestMetadata("expectProperty.kt") + public void testExpectProperty() throws Exception { + runTest("compiler/testData/codegen/box/multiplatform/expectProperty.kt"); + } + @Test @TestMetadata("noArgActualConstructor.kt") public void testNoArgActualConstructor() throws Exception { @@ -25175,6 +25583,12 @@ public class VisualizerBlackBoxTestGenerated extends AbstractVisualizerBlackBoxT runTest("compiler/testData/codegen/box/objects/kt42758.kt"); } + @Test + @TestMetadata("kt45170.kt") + public void testKt45170() throws Exception { + runTest("compiler/testData/codegen/box/objects/kt45170.kt"); + } + @Test @TestMetadata("kt535.kt") public void testKt535() throws Exception { @@ -27529,6 +27943,12 @@ public class VisualizerBlackBoxTestGenerated extends AbstractVisualizerBlackBoxT runTest("compiler/testData/codegen/box/properties/typeInferredFromGetter.kt"); } + @Test + @TestMetadata("unreachableUninitializedProperty.kt") + public void testUnreachableUninitializedProperty() throws Exception { + runTest("compiler/testData/codegen/box/properties/unreachableUninitializedProperty.kt"); + } + @Nested @TestMetadata("compiler/testData/codegen/box/properties/const") @TestDataPath("$PROJECT_ROOT") @@ -36481,6 +36901,12 @@ public class VisualizerBlackBoxTestGenerated extends AbstractVisualizerBlackBoxT runTest("compiler/testData/codegen/box/regressions/kt4281.kt"); } + @Test + @TestMetadata("kt44993.kt") + public void testKt44993() throws Exception { + runTest("compiler/testData/codegen/box/regressions/kt44993.kt"); + } + @Test @TestMetadata("kt5056.kt") public void testKt5056() throws Exception { @@ -37157,6 +37583,12 @@ public class VisualizerBlackBoxTestGenerated extends AbstractVisualizerBlackBoxT runTest("compiler/testData/codegen/box/sam/kt31908.kt"); } + @Test + @TestMetadata("kt44827_sam.kt") + public void testKt44827_sam() throws Exception { + runTest("compiler/testData/codegen/box/sam/kt44827_sam.kt"); + } + @Test @TestMetadata("kt4753.kt") public void testKt4753() throws Exception { @@ -37229,6 +37661,12 @@ public class VisualizerBlackBoxTestGenerated extends AbstractVisualizerBlackBoxT runTest("compiler/testData/codegen/box/sam/samConstructorGenericSignature.kt"); } + @Test + @TestMetadata("samConversionToJavaWildcard.kt") + public void testSamConversionToJavaWildcard() throws Exception { + runTest("compiler/testData/codegen/box/sam/samConversionToJavaWildcard.kt"); + } + @Test @TestMetadata("smartCastSamConversion.kt") public void testSmartCastSamConversion() throws Exception { @@ -40047,12 +40485,6 @@ public class VisualizerBlackBoxTestGenerated extends AbstractVisualizerBlackBoxT runTest("compiler/testData/codegen/box/unsignedTypes/kt25784.kt"); } - @Test - @TestMetadata("kt30402.kt") - public void testKt30402() throws Exception { - runTest("compiler/testData/codegen/box/unsignedTypes/kt30402.kt"); - } - @Test @TestMetadata("kt43286.kt") public void testKt43286() throws Exception { diff --git a/idea/idea-gradle/tests/org/jetbrains/kotlin/idea/codeInsight/gradle/GradleFacetImportTest.kt b/idea/idea-gradle/tests/org/jetbrains/kotlin/idea/codeInsight/gradle/GradleFacetImportTest.kt index 7e318a4ba72..66788567837 100644 --- a/idea/idea-gradle/tests/org/jetbrains/kotlin/idea/codeInsight/gradle/GradleFacetImportTest.kt +++ b/idea/idea-gradle/tests/org/jetbrains/kotlin/idea/codeInsight/gradle/GradleFacetImportTest.kt @@ -4,7 +4,7 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software diff --git a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/es6/semantics/IrJsCodegenBoxES6TestGenerated.java b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/es6/semantics/IrJsCodegenBoxES6TestGenerated.java index f7e29d26e6a..88a8a04213f 100644 --- a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/es6/semantics/IrJsCodegenBoxES6TestGenerated.java +++ b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/es6/semantics/IrJsCodegenBoxES6TestGenerated.java @@ -4819,6 +4819,11 @@ public class IrJsCodegenBoxES6TestGenerated extends AbstractIrJsCodegenBoxES6Tes runTest("compiler/testData/codegen/box/constants/float.kt"); } + @TestMetadata("foldingBinaryOpsUnsigned.kt") + public void testFoldingBinaryOpsUnsigned() throws Exception { + runTest("compiler/testData/codegen/box/constants/foldingBinaryOpsUnsigned.kt"); + } + @TestMetadata("kt9532.kt") public void testKt9532() throws Exception { runTest("compiler/testData/codegen/box/constants/kt9532.kt"); @@ -27316,11 +27321,6 @@ public class IrJsCodegenBoxES6TestGenerated extends AbstractIrJsCodegenBoxES6Tes runTest("compiler/testData/codegen/box/unsignedTypes/kt25784.kt"); } - @TestMetadata("kt30402.kt") - public void testKt30402() throws Exception { - runTest("compiler/testData/codegen/box/unsignedTypes/kt30402.kt"); - } - @TestMetadata("kt43286.kt") public void testKt43286() throws Exception { runTest("compiler/testData/codegen/box/unsignedTypes/kt43286.kt"); diff --git a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/semantics/IrJsCodegenBoxTestGenerated.java b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/semantics/IrJsCodegenBoxTestGenerated.java index c9d17803202..415fd065dc6 100644 --- a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/semantics/IrJsCodegenBoxTestGenerated.java +++ b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/semantics/IrJsCodegenBoxTestGenerated.java @@ -4240,6 +4240,11 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest { runTest("compiler/testData/codegen/box/constants/float.kt"); } + @TestMetadata("foldingBinaryOpsUnsigned.kt") + public void testFoldingBinaryOpsUnsigned() throws Exception { + runTest("compiler/testData/codegen/box/constants/foldingBinaryOpsUnsigned.kt"); + } + @TestMetadata("kt9532.kt") public void testKt9532() throws Exception { runTest("compiler/testData/codegen/box/constants/kt9532.kt"); @@ -26737,11 +26742,6 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest { runTest("compiler/testData/codegen/box/unsignedTypes/kt25784.kt"); } - @TestMetadata("kt30402.kt") - public void testKt30402() throws Exception { - runTest("compiler/testData/codegen/box/unsignedTypes/kt30402.kt"); - } - @TestMetadata("kt43286.kt") public void testKt43286() throws Exception { runTest("compiler/testData/codegen/box/unsignedTypes/kt43286.kt"); diff --git a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/semantics/JsCodegenBoxTestGenerated.java b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/semantics/JsCodegenBoxTestGenerated.java index 8a58cfb71bd..8ff28762f32 100644 --- a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/semantics/JsCodegenBoxTestGenerated.java +++ b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/semantics/JsCodegenBoxTestGenerated.java @@ -4240,6 +4240,11 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest { runTest("compiler/testData/codegen/box/constants/float.kt"); } + @TestMetadata("foldingBinaryOpsUnsigned.kt") + public void testFoldingBinaryOpsUnsigned() throws Exception { + runTest("compiler/testData/codegen/box/constants/foldingBinaryOpsUnsigned.kt"); + } + @TestMetadata("kt9532.kt") public void testKt9532() throws Exception { runTest("compiler/testData/codegen/box/constants/kt9532.kt"); @@ -26697,11 +26702,6 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest { runTest("compiler/testData/codegen/box/unsignedTypes/kt25784.kt"); } - @TestMetadata("kt30402.kt") - public void testKt30402() throws Exception { - runTest("compiler/testData/codegen/box/unsignedTypes/kt30402.kt"); - } - @TestMetadata("kt43286.kt") public void testKt43286() throws Exception { runTest("compiler/testData/codegen/box/unsignedTypes/kt43286.kt"); diff --git a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/wasm/semantics/IrCodegenBoxWasmTestGenerated.java b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/wasm/semantics/IrCodegenBoxWasmTestGenerated.java index 2f7af4703d1..69ac7a39ff2 100644 --- a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/wasm/semantics/IrCodegenBoxWasmTestGenerated.java +++ b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/wasm/semantics/IrCodegenBoxWasmTestGenerated.java @@ -3046,6 +3046,11 @@ public class IrCodegenBoxWasmTestGenerated extends AbstractIrCodegenBoxWasmTest runTest("compiler/testData/codegen/box/constants/constantsInWhen.kt"); } + @TestMetadata("foldingBinaryOpsUnsigned.kt") + public void testFoldingBinaryOpsUnsigned() throws Exception { + runTest("compiler/testData/codegen/box/constants/foldingBinaryOpsUnsigned.kt"); + } + @TestMetadata("long.kt") public void testLong() throws Exception { runTest("compiler/testData/codegen/box/constants/long.kt"); @@ -14996,11 +15001,6 @@ public class IrCodegenBoxWasmTestGenerated extends AbstractIrCodegenBoxWasmTest runTest("compiler/testData/codegen/box/unsignedTypes/iterateOverListOfBoxedUnsignedValues.kt"); } - @TestMetadata("kt30402.kt") - public void testKt30402() throws Exception { - runTest("compiler/testData/codegen/box/unsignedTypes/kt30402.kt"); - } - @TestMetadata("kt43286.kt") public void testKt43286() throws Exception { runTest("compiler/testData/codegen/box/unsignedTypes/kt43286.kt");