From ad6332112e41223eef75b32a5a3a288460493384 Mon Sep 17 00:00:00 2001 From: Ivan Kylchik Date: Mon, 29 May 2023 00:19:47 +0200 Subject: [PATCH] [IR] Support const optimizations for Native backend --- .../involvesIrInterpreter/byteOperations.kt | 2 +- .../involvesIrInterpreter/charOperations.kt | 2 +- .../involvesIrInterpreter/doubleOperations.kt | 2 +- .../involvesIrInterpreter/floatOperations.kt | 2 +- .../involvesIrInterpreter/intOperations.kt | 2 +- .../intrinsicConst/constTrimIndent.kt | 3 +- .../intrinsicConst/constTrimMargin.kt | 3 +- .../intrinsicConst/enumName.kt | 3 +- .../intrinsicConst/enumNameWithInit.kt | 1 + .../intrinsicConst/equals_after.kt | 1 + .../intrinsicConst/ifConstVal.kt | 4 +- .../intrinsicConst/kCallableName.kt | 3 +- .../kCallableNameWithSideEffect.kt | 1 + .../intrinsicConst/kt53272.kt | 3 +- .../intrinsicConst/kt58717.kt | 1 + .../involvesIrInterpreter/longOperations.kt | 2 +- .../objectConstValInAnnotationArgument.kt | 1 + .../involvesIrInterpreter/shortOperations.kt | 2 +- .../box/involvesIrInterpreter/stdlibConst.kt | 2 +- .../stringConcatenation.kt | 2 +- .../stringConcatenationWithObject.kt | 2 +- .../involvesIrInterpreter/stringOperations.kt | 2 +- .../involvesIrInterpreter/thisPlusString.kt | 1 + .../thisPlusStringWithObject.kt | 1 + .../involvesIrInterpreter/unsignedConst.kt | 2 +- .../useCorrectToString.kt | 1 + .../backend/konan/driver/phases/Lowerings.kt | 23 ++---- .../FirNativeCodegenBoxTestGenerated.java | 78 +++++++++++++++++++ .../FirNativeCodegenBoxTestNoPLGenerated.java | 78 +++++++++++++++++++ .../NativeCodegenBoxTestGenerated.java | 78 +++++++++++++++++++ .../NativeCodegenBoxTestNoPLGenerated.java | 78 +++++++++++++++++++ 31 files changed, 352 insertions(+), 34 deletions(-) diff --git a/compiler/testData/codegen/box/involvesIrInterpreter/byteOperations.kt b/compiler/testData/codegen/box/involvesIrInterpreter/byteOperations.kt index 681198e6620..7b3b3f4de1a 100644 --- a/compiler/testData/codegen/box/involvesIrInterpreter/byteOperations.kt +++ b/compiler/testData/codegen/box/involvesIrInterpreter/byteOperations.kt @@ -1,6 +1,6 @@ // TARGET_BACKEND: JVM_IR -// TARGET_BACKEND: NATIVE // TARGET_BACKEND: JS_IR +// TARGET_BACKEND: NATIVE fun T.id() = this const val minusOneVal = (-1).toByte() diff --git a/compiler/testData/codegen/box/involvesIrInterpreter/charOperations.kt b/compiler/testData/codegen/box/involvesIrInterpreter/charOperations.kt index d2205aadcf3..9b0af1dd826 100644 --- a/compiler/testData/codegen/box/involvesIrInterpreter/charOperations.kt +++ b/compiler/testData/codegen/box/involvesIrInterpreter/charOperations.kt @@ -1,6 +1,6 @@ // TARGET_BACKEND: JVM_IR -// TARGET_BACKEND: NATIVE // TARGET_BACKEND: JS_IR +// TARGET_BACKEND: NATIVE // WITH_STDLIB fun T.id() = this diff --git a/compiler/testData/codegen/box/involvesIrInterpreter/doubleOperations.kt b/compiler/testData/codegen/box/involvesIrInterpreter/doubleOperations.kt index e6b18475548..f3a490f6239 100644 --- a/compiler/testData/codegen/box/involvesIrInterpreter/doubleOperations.kt +++ b/compiler/testData/codegen/box/involvesIrInterpreter/doubleOperations.kt @@ -1,6 +1,6 @@ // TARGET_BACKEND: JVM_IR -// TARGET_BACKEND: NATIVE // TARGET_BACKEND: JS_IR +// TARGET_BACKEND: NATIVE fun T.id() = this const val minusOneVal = -1.0 diff --git a/compiler/testData/codegen/box/involvesIrInterpreter/floatOperations.kt b/compiler/testData/codegen/box/involvesIrInterpreter/floatOperations.kt index 5cba06ac3f5..96ec81a59fc 100644 --- a/compiler/testData/codegen/box/involvesIrInterpreter/floatOperations.kt +++ b/compiler/testData/codegen/box/involvesIrInterpreter/floatOperations.kt @@ -1,6 +1,6 @@ // TARGET_BACKEND: JVM_IR -// TARGET_BACKEND: NATIVE // TARGET_BACKEND: JS_IR +// TARGET_BACKEND: NATIVE fun T.id() = this const val minusOneVal = -1.0f diff --git a/compiler/testData/codegen/box/involvesIrInterpreter/intOperations.kt b/compiler/testData/codegen/box/involvesIrInterpreter/intOperations.kt index 03d9692c474..a4debf20a6b 100644 --- a/compiler/testData/codegen/box/involvesIrInterpreter/intOperations.kt +++ b/compiler/testData/codegen/box/involvesIrInterpreter/intOperations.kt @@ -1,6 +1,6 @@ // TARGET_BACKEND: JVM_IR -// TARGET_BACKEND: NATIVE // TARGET_BACKEND: JS_IR +// TARGET_BACKEND: NATIVE fun T.id() = this const val minusOneVal = -1 diff --git a/compiler/testData/codegen/box/involvesIrInterpreter/intrinsicConst/constTrimIndent.kt b/compiler/testData/codegen/box/involvesIrInterpreter/intrinsicConst/constTrimIndent.kt index 0dddf861da6..87753c939b1 100644 --- a/compiler/testData/codegen/box/involvesIrInterpreter/intrinsicConst/constTrimIndent.kt +++ b/compiler/testData/codegen/box/involvesIrInterpreter/intrinsicConst/constTrimIndent.kt @@ -1,7 +1,8 @@ // !LANGUAGE: +IntrinsicConstEvaluation // TARGET_BACKEND: JVM_IR // TARGET_BACKEND: JS_IR -// IGNORE_BACKEND_K1: JVM_IR, JS_IR, JS_IR_ES6 +// TARGET_BACKEND: NATIVE +// IGNORE_BACKEND_K1: JVM_IR, JS_IR, JS_IR_ES6, NATIVE // WITH_STDLIB fun T.id() = this diff --git a/compiler/testData/codegen/box/involvesIrInterpreter/intrinsicConst/constTrimMargin.kt b/compiler/testData/codegen/box/involvesIrInterpreter/intrinsicConst/constTrimMargin.kt index c44d7f3423e..5c02ff41997 100644 --- a/compiler/testData/codegen/box/involvesIrInterpreter/intrinsicConst/constTrimMargin.kt +++ b/compiler/testData/codegen/box/involvesIrInterpreter/intrinsicConst/constTrimMargin.kt @@ -1,7 +1,8 @@ // !LANGUAGE: +IntrinsicConstEvaluation // TARGET_BACKEND: JVM_IR // TARGET_BACKEND: JS_IR -// IGNORE_BACKEND_K1: JVM_IR, JS_IR, JS_IR_ES6 +// TARGET_BACKEND: NATIVE +// IGNORE_BACKEND_K1: JVM_IR, JS_IR, JS_IR_ES6, NATIVE // WITH_STDLIB fun T.id() = this diff --git a/compiler/testData/codegen/box/involvesIrInterpreter/intrinsicConst/enumName.kt b/compiler/testData/codegen/box/involvesIrInterpreter/intrinsicConst/enumName.kt index 4ef7f5c2867..aa7e3339ce3 100644 --- a/compiler/testData/codegen/box/involvesIrInterpreter/intrinsicConst/enumName.kt +++ b/compiler/testData/codegen/box/involvesIrInterpreter/intrinsicConst/enumName.kt @@ -1,7 +1,8 @@ // !LANGUAGE: +IntrinsicConstEvaluation // TARGET_BACKEND: JVM_IR // TARGET_BACKEND: JS_IR -// IGNORE_BACKEND_K1: JVM_IR, JS_IR, JS_IR_ES6 +// TARGET_BACKEND: NATIVE +// IGNORE_BACKEND_K1: JVM_IR, JS_IR, JS_IR_ES6, NATIVE fun T.id() = this enum class EnumClass { diff --git a/compiler/testData/codegen/box/involvesIrInterpreter/intrinsicConst/enumNameWithInit.kt b/compiler/testData/codegen/box/involvesIrInterpreter/intrinsicConst/enumNameWithInit.kt index 70efc56fd25..64d58fa0c4a 100644 --- a/compiler/testData/codegen/box/involvesIrInterpreter/intrinsicConst/enumNameWithInit.kt +++ b/compiler/testData/codegen/box/involvesIrInterpreter/intrinsicConst/enumNameWithInit.kt @@ -1,6 +1,7 @@ // !LANGUAGE: +IntrinsicConstEvaluation // TARGET_BACKEND: JVM_IR // TARGET_BACKEND: JS_IR +// TARGET_BACKEND: NATIVE fun T.id() = this diff --git a/compiler/testData/codegen/box/involvesIrInterpreter/intrinsicConst/equals_after.kt b/compiler/testData/codegen/box/involvesIrInterpreter/intrinsicConst/equals_after.kt index 92a9b3b2989..e35a9e1123c 100644 --- a/compiler/testData/codegen/box/involvesIrInterpreter/intrinsicConst/equals_after.kt +++ b/compiler/testData/codegen/box/involvesIrInterpreter/intrinsicConst/equals_after.kt @@ -1,6 +1,7 @@ // !LANGUAGE: +IntrinsicConstEvaluation // TARGET_BACKEND: JVM_IR // TARGET_BACKEND: JS_IR +// TARGET_BACKEND: NATIVE fun T.id() = this diff --git a/compiler/testData/codegen/box/involvesIrInterpreter/intrinsicConst/ifConstVal.kt b/compiler/testData/codegen/box/involvesIrInterpreter/intrinsicConst/ifConstVal.kt index ec990e225dd..0ba3ce769ef 100644 --- a/compiler/testData/codegen/box/involvesIrInterpreter/intrinsicConst/ifConstVal.kt +++ b/compiler/testData/codegen/box/involvesIrInterpreter/intrinsicConst/ifConstVal.kt @@ -1,8 +1,8 @@ // !LANGUAGE: +IntrinsicConstEvaluation // TARGET_BACKEND: JVM_IR -// TARGET_BACKEND: NATIVE // TARGET_BACKEND: JS_IR -// IGNORE_BACKEND_K1: JVM_IR, NATIVE, JS_IR, JS_IR_ES6 +// TARGET_BACKEND: NATIVE +// IGNORE_BACKEND_K1: JVM_IR, JS_IR, JS_IR_ES6, NATIVE fun T.id() = this const val flag = true diff --git a/compiler/testData/codegen/box/involvesIrInterpreter/intrinsicConst/kCallableName.kt b/compiler/testData/codegen/box/involvesIrInterpreter/intrinsicConst/kCallableName.kt index 121381aac00..4c4fda212bf 100644 --- a/compiler/testData/codegen/box/involvesIrInterpreter/intrinsicConst/kCallableName.kt +++ b/compiler/testData/codegen/box/involvesIrInterpreter/intrinsicConst/kCallableName.kt @@ -1,7 +1,8 @@ // !LANGUAGE: +IntrinsicConstEvaluation // TARGET_BACKEND: JVM_IR // TARGET_BACKEND: JS_IR -// IGNORE_BACKEND_K1: JVM_IR, JS_IR, JS_IR_ES6 +// TARGET_BACKEND: NATIVE +// IGNORE_BACKEND_K1: JVM_IR, JS_IR, JS_IR_ES6, NATIVE fun T.id() = this diff --git a/compiler/testData/codegen/box/involvesIrInterpreter/intrinsicConst/kCallableNameWithSideEffect.kt b/compiler/testData/codegen/box/involvesIrInterpreter/intrinsicConst/kCallableNameWithSideEffect.kt index 803a3e0149e..4c8263be3e0 100644 --- a/compiler/testData/codegen/box/involvesIrInterpreter/intrinsicConst/kCallableNameWithSideEffect.kt +++ b/compiler/testData/codegen/box/involvesIrInterpreter/intrinsicConst/kCallableNameWithSideEffect.kt @@ -1,6 +1,7 @@ // !LANGUAGE: +IntrinsicConstEvaluation // TARGET_BACKEND: JVM_IR // TARGET_BACKEND: JS_IR +// TARGET_BACKEND: NATIVE // WITH_STDLIB fun T.id() = this diff --git a/compiler/testData/codegen/box/involvesIrInterpreter/intrinsicConst/kt53272.kt b/compiler/testData/codegen/box/involvesIrInterpreter/intrinsicConst/kt53272.kt index 31f5e490bbb..7324d5b2e42 100644 --- a/compiler/testData/codegen/box/involvesIrInterpreter/intrinsicConst/kt53272.kt +++ b/compiler/testData/codegen/box/involvesIrInterpreter/intrinsicConst/kt53272.kt @@ -1,7 +1,8 @@ // !LANGUAGE: +IntrinsicConstEvaluation // TARGET_BACKEND: JVM_IR // TARGET_BACKEND: JS_IR -// IGNORE_BACKEND_K1: JVM_IR, JS_IR, JS_IR_ES6 +// TARGET_BACKEND: NATIVE +// IGNORE_BACKEND_K1: JVM_IR, JS_IR, JS_IR_ES6, NATIVE // FILE: 1.kt diff --git a/compiler/testData/codegen/box/involvesIrInterpreter/intrinsicConst/kt58717.kt b/compiler/testData/codegen/box/involvesIrInterpreter/intrinsicConst/kt58717.kt index 8e840bed184..3f6ce25dd3a 100644 --- a/compiler/testData/codegen/box/involvesIrInterpreter/intrinsicConst/kt58717.kt +++ b/compiler/testData/codegen/box/involvesIrInterpreter/intrinsicConst/kt58717.kt @@ -1,6 +1,7 @@ // !LANGUAGE: +IntrinsicConstEvaluation // TARGET_BACKEND: JVM_IR // TARGET_BACKEND: JS_IR +// TARGET_BACKEND: NATIVE var result = "Fail" diff --git a/compiler/testData/codegen/box/involvesIrInterpreter/longOperations.kt b/compiler/testData/codegen/box/involvesIrInterpreter/longOperations.kt index 1670216d495..ee6419f6ae3 100644 --- a/compiler/testData/codegen/box/involvesIrInterpreter/longOperations.kt +++ b/compiler/testData/codegen/box/involvesIrInterpreter/longOperations.kt @@ -1,6 +1,6 @@ // TARGET_BACKEND: JVM_IR -// TARGET_BACKEND: NATIVE // TARGET_BACKEND: JS_IR +// TARGET_BACKEND: NATIVE fun T.id() = this const val minusOneVal = -1L diff --git a/compiler/testData/codegen/box/involvesIrInterpreter/objectConstValInAnnotationArgument.kt b/compiler/testData/codegen/box/involvesIrInterpreter/objectConstValInAnnotationArgument.kt index 17bc87e1228..a1e25e66381 100644 --- a/compiler/testData/codegen/box/involvesIrInterpreter/objectConstValInAnnotationArgument.kt +++ b/compiler/testData/codegen/box/involvesIrInterpreter/objectConstValInAnnotationArgument.kt @@ -1,5 +1,6 @@ // TARGET_BACKEND: JVM_IR // TARGET_BACKEND: JS_IR +// TARGET_BACKEND: NATIVE annotation class Key(val value: String) object Messanger { diff --git a/compiler/testData/codegen/box/involvesIrInterpreter/shortOperations.kt b/compiler/testData/codegen/box/involvesIrInterpreter/shortOperations.kt index d820c049694..ba8dc5ac790 100644 --- a/compiler/testData/codegen/box/involvesIrInterpreter/shortOperations.kt +++ b/compiler/testData/codegen/box/involvesIrInterpreter/shortOperations.kt @@ -1,6 +1,6 @@ // TARGET_BACKEND: JVM_IR -// TARGET_BACKEND: NATIVE // TARGET_BACKEND: JS_IR +// TARGET_BACKEND: NATIVE fun T.id() = this const val minusOneVal = (-1).toShort() diff --git a/compiler/testData/codegen/box/involvesIrInterpreter/stdlibConst.kt b/compiler/testData/codegen/box/involvesIrInterpreter/stdlibConst.kt index c6bd18e15d0..671f87b5acd 100644 --- a/compiler/testData/codegen/box/involvesIrInterpreter/stdlibConst.kt +++ b/compiler/testData/codegen/box/involvesIrInterpreter/stdlibConst.kt @@ -1,6 +1,6 @@ // TARGET_BACKEND: JVM_IR -// TARGET_BACKEND: NATIVE // TARGET_BACKEND: JS_IR +// TARGET_BACKEND: NATIVE // WITH_STDLIB fun T.id() = this diff --git a/compiler/testData/codegen/box/involvesIrInterpreter/stringConcatenation.kt b/compiler/testData/codegen/box/involvesIrInterpreter/stringConcatenation.kt index 536712c8e3a..5a3607fbca9 100644 --- a/compiler/testData/codegen/box/involvesIrInterpreter/stringConcatenation.kt +++ b/compiler/testData/codegen/box/involvesIrInterpreter/stringConcatenation.kt @@ -1,6 +1,6 @@ // TARGET_BACKEND: JVM_IR -// TARGET_BACKEND: NATIVE // TARGET_BACKEND: JS_IR +// TARGET_BACKEND: NATIVE // WITH_STDLIB fun T.id() = this diff --git a/compiler/testData/codegen/box/involvesIrInterpreter/stringConcatenationWithObject.kt b/compiler/testData/codegen/box/involvesIrInterpreter/stringConcatenationWithObject.kt index 52a568906c2..1b2b4d7ec3d 100644 --- a/compiler/testData/codegen/box/involvesIrInterpreter/stringConcatenationWithObject.kt +++ b/compiler/testData/codegen/box/involvesIrInterpreter/stringConcatenationWithObject.kt @@ -1,6 +1,6 @@ // TARGET_BACKEND: JVM_IR -// TARGET_BACKEND: NATIVE // TARGET_BACKEND: JS_IR +// TARGET_BACKEND: NATIVE object K : Code("K") diff --git a/compiler/testData/codegen/box/involvesIrInterpreter/stringOperations.kt b/compiler/testData/codegen/box/involvesIrInterpreter/stringOperations.kt index 7693979d459..150225f615a 100644 --- a/compiler/testData/codegen/box/involvesIrInterpreter/stringOperations.kt +++ b/compiler/testData/codegen/box/involvesIrInterpreter/stringOperations.kt @@ -1,6 +1,6 @@ // TARGET_BACKEND: JVM_IR -// TARGET_BACKEND: NATIVE // TARGET_BACKEND: JS_IR +// TARGET_BACKEND: NATIVE // WITH_STDLIB fun T.id() = this diff --git a/compiler/testData/codegen/box/involvesIrInterpreter/thisPlusString.kt b/compiler/testData/codegen/box/involvesIrInterpreter/thisPlusString.kt index 7c52b009a10..8f2c98d85ea 100644 --- a/compiler/testData/codegen/box/involvesIrInterpreter/thisPlusString.kt +++ b/compiler/testData/codegen/box/involvesIrInterpreter/thisPlusString.kt @@ -1,5 +1,6 @@ // TARGET_BACKEND: JVM_IR // TARGET_BACKEND: JS_IR +// TARGET_BACKEND: NATIVE // WITH_STDLIB object Test { diff --git a/compiler/testData/codegen/box/involvesIrInterpreter/thisPlusStringWithObject.kt b/compiler/testData/codegen/box/involvesIrInterpreter/thisPlusStringWithObject.kt index 63533c35d15..7742b0e7fd8 100644 --- a/compiler/testData/codegen/box/involvesIrInterpreter/thisPlusStringWithObject.kt +++ b/compiler/testData/codegen/box/involvesIrInterpreter/thisPlusStringWithObject.kt @@ -1,5 +1,6 @@ // TARGET_BACKEND: JVM_IR // TARGET_BACKEND: JS_IR +// TARGET_BACKEND: NATIVE object Test diff --git a/compiler/testData/codegen/box/involvesIrInterpreter/unsignedConst.kt b/compiler/testData/codegen/box/involvesIrInterpreter/unsignedConst.kt index 1b6035d3359..1099513b786 100644 --- a/compiler/testData/codegen/box/involvesIrInterpreter/unsignedConst.kt +++ b/compiler/testData/codegen/box/involvesIrInterpreter/unsignedConst.kt @@ -1,6 +1,6 @@ // TARGET_BACKEND: JVM_IR -// TARGET_BACKEND: NATIVE // TARGET_BACKEND: JS_IR +// TARGET_BACKEND: NATIVE // WITH_STDLIB fun T.id() = this diff --git a/compiler/testData/codegen/box/involvesIrInterpreter/useCorrectToString.kt b/compiler/testData/codegen/box/involvesIrInterpreter/useCorrectToString.kt index bf7b372275d..a7b6ca14e1a 100644 --- a/compiler/testData/codegen/box/involvesIrInterpreter/useCorrectToString.kt +++ b/compiler/testData/codegen/box/involvesIrInterpreter/useCorrectToString.kt @@ -1,5 +1,6 @@ // TARGET_BACKEND: JVM_IR // TARGET_BACKEND: JS_IR +// TARGET_BACKEND: NATIVE // This test is needed to check that IrCompileTimeChecker will not fail trying to find and analyze correct toString method object Obj { diff --git a/kotlin-native/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/driver/phases/Lowerings.kt b/kotlin-native/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/driver/phases/Lowerings.kt index c5be1ace832..2fdb820025c 100644 --- a/kotlin-native/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/driver/phases/Lowerings.kt +++ b/kotlin-native/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/driver/phases/Lowerings.kt @@ -434,19 +434,6 @@ private val ifNullExpressionsFusionPhase = createFileLoweringPhase( description = "Simplify '?.' and '?:' operator chains" ) -private val foldConstantLoweringPhase = createFileLoweringPhase( - { context, irFile -> FoldConstantLowering(context).lower(irFile) }, - name = "FoldConstantLowering", - description = "Constant Folding", - prerequisite = setOf(flattenStringConcatenationPhase) -) - -private val computeStringTrimPhase = createFileLoweringPhase( - ::StringTrimLowering, - name = "StringTrimLowering", - description = "Compute trimIndent and trimMargin operations on constant strings" -) - private val exportInternalAbiPhase = createFileLoweringPhase( ::ExportCachesAbiVisitor, name = "ExportInternalAbi", @@ -506,6 +493,13 @@ private val objectClassesPhase = createFileLoweringPhase( description = "Object classes lowering" ) +private val constEvaluationPhase = createFileLoweringPhase( + lowering = ::ConstEvaluationLowering, + name = "ConstEvaluationLowering", + description = "Evaluate functions that are marked as `IntrinsicConstEvaluation`", + prerequisite = setOf(inlinePhase) +) + private fun PhaseEngine.getAllLowerings() = listOfNotNull>( removeExpectDeclarationsPhase, stripTypeAliasDeclarationsPhase, @@ -518,6 +512,7 @@ private fun PhaseEngine.getAllLowerings() = listOfNotNull extractLocalClassesFromInlineBodies, wrapInlineDeclarationsWithReifiedTypeParametersLowering, inlinePhase, + constEvaluationPhase, provisionalFunctionExpressionPhase, postInlinePhase, contractsDslRemovePhase, @@ -525,8 +520,6 @@ private fun PhaseEngine.getAllLowerings() = listOfNotNull rangeContainsLoweringPhase, forLoopsPhase, flattenStringConcatenationPhase, - foldConstantLoweringPhase, - computeStringTrimPhase, stringConcatenationPhase, stringConcatenationTypeNarrowingPhase.takeIf { context.config.optimizationsEnabled }, enumConstructorsPhase, diff --git a/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/blackboxtest/FirNativeCodegenBoxTestGenerated.java b/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/blackboxtest/FirNativeCodegenBoxTestGenerated.java index cbda503b21c..03892ea0bc6 100644 --- a/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/blackboxtest/FirNativeCodegenBoxTestGenerated.java +++ b/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/blackboxtest/FirNativeCodegenBoxTestGenerated.java @@ -23930,6 +23930,12 @@ public class FirNativeCodegenBoxTestGenerated extends AbstractNativeCodegenBoxTe runTest("compiler/testData/codegen/box/involvesIrInterpreter/longOperations.kt"); } + @Test + @TestMetadata("objectConstValInAnnotationArgument.kt") + public void testObjectConstValInAnnotationArgument() throws Exception { + runTest("compiler/testData/codegen/box/involvesIrInterpreter/objectConstValInAnnotationArgument.kt"); + } + @Test @TestMetadata("shortOperations.kt") public void testShortOperations() throws Exception { @@ -23960,12 +23966,30 @@ public class FirNativeCodegenBoxTestGenerated extends AbstractNativeCodegenBoxTe runTest("compiler/testData/codegen/box/involvesIrInterpreter/stringOperations.kt"); } + @Test + @TestMetadata("thisPlusString.kt") + public void testThisPlusString() throws Exception { + runTest("compiler/testData/codegen/box/involvesIrInterpreter/thisPlusString.kt"); + } + + @Test + @TestMetadata("thisPlusStringWithObject.kt") + public void testThisPlusStringWithObject() throws Exception { + runTest("compiler/testData/codegen/box/involvesIrInterpreter/thisPlusStringWithObject.kt"); + } + @Test @TestMetadata("unsignedConst.kt") public void testUnsignedConst() throws Exception { runTest("compiler/testData/codegen/box/involvesIrInterpreter/unsignedConst.kt"); } + @Test + @TestMetadata("useCorrectToString.kt") + public void testUseCorrectToString() throws Exception { + runTest("compiler/testData/codegen/box/involvesIrInterpreter/useCorrectToString.kt"); + } + @Nested @TestMetadata("compiler/testData/codegen/box/involvesIrInterpreter/intrinsicConst") @TestDataPath("$PROJECT_ROOT") @@ -23978,11 +24002,65 @@ public class FirNativeCodegenBoxTestGenerated extends AbstractNativeCodegenBoxTe KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/involvesIrInterpreter/intrinsicConst"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.NATIVE, true); } + @Test + @TestMetadata("constTrimIndent.kt") + public void testConstTrimIndent() throws Exception { + runTest("compiler/testData/codegen/box/involvesIrInterpreter/intrinsicConst/constTrimIndent.kt"); + } + + @Test + @TestMetadata("constTrimMargin.kt") + public void testConstTrimMargin() throws Exception { + runTest("compiler/testData/codegen/box/involvesIrInterpreter/intrinsicConst/constTrimMargin.kt"); + } + + @Test + @TestMetadata("enumName.kt") + public void testEnumName() throws Exception { + runTest("compiler/testData/codegen/box/involvesIrInterpreter/intrinsicConst/enumName.kt"); + } + + @Test + @TestMetadata("enumNameWithInit.kt") + public void testEnumNameWithInit() throws Exception { + runTest("compiler/testData/codegen/box/involvesIrInterpreter/intrinsicConst/enumNameWithInit.kt"); + } + + @Test + @TestMetadata("equals_after.kt") + public void testEquals_after() throws Exception { + runTest("compiler/testData/codegen/box/involvesIrInterpreter/intrinsicConst/equals_after.kt"); + } + @Test @TestMetadata("ifConstVal.kt") public void testIfConstVal() throws Exception { runTest("compiler/testData/codegen/box/involvesIrInterpreter/intrinsicConst/ifConstVal.kt"); } + + @Test + @TestMetadata("kCallableName.kt") + public void testKCallableName() throws Exception { + runTest("compiler/testData/codegen/box/involvesIrInterpreter/intrinsicConst/kCallableName.kt"); + } + + @Test + @TestMetadata("kCallableNameWithSideEffect.kt") + public void testKCallableNameWithSideEffect() throws Exception { + runTest("compiler/testData/codegen/box/involvesIrInterpreter/intrinsicConst/kCallableNameWithSideEffect.kt"); + } + + @Test + @TestMetadata("kt53272.kt") + public void testKt53272() throws Exception { + runTest("compiler/testData/codegen/box/involvesIrInterpreter/intrinsicConst/kt53272.kt"); + } + + @Test + @TestMetadata("kt58717.kt") + public void testKt58717() throws Exception { + runTest("compiler/testData/codegen/box/involvesIrInterpreter/intrinsicConst/kt58717.kt"); + } } @Nested diff --git a/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/blackboxtest/FirNativeCodegenBoxTestNoPLGenerated.java b/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/blackboxtest/FirNativeCodegenBoxTestNoPLGenerated.java index e890db85d11..8a9816743e0 100644 --- a/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/blackboxtest/FirNativeCodegenBoxTestNoPLGenerated.java +++ b/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/blackboxtest/FirNativeCodegenBoxTestNoPLGenerated.java @@ -24394,6 +24394,12 @@ public class FirNativeCodegenBoxTestNoPLGenerated extends AbstractNativeCodegenB runTest("compiler/testData/codegen/box/involvesIrInterpreter/longOperations.kt"); } + @Test + @TestMetadata("objectConstValInAnnotationArgument.kt") + public void testObjectConstValInAnnotationArgument() throws Exception { + runTest("compiler/testData/codegen/box/involvesIrInterpreter/objectConstValInAnnotationArgument.kt"); + } + @Test @TestMetadata("shortOperations.kt") public void testShortOperations() throws Exception { @@ -24424,12 +24430,30 @@ public class FirNativeCodegenBoxTestNoPLGenerated extends AbstractNativeCodegenB runTest("compiler/testData/codegen/box/involvesIrInterpreter/stringOperations.kt"); } + @Test + @TestMetadata("thisPlusString.kt") + public void testThisPlusString() throws Exception { + runTest("compiler/testData/codegen/box/involvesIrInterpreter/thisPlusString.kt"); + } + + @Test + @TestMetadata("thisPlusStringWithObject.kt") + public void testThisPlusStringWithObject() throws Exception { + runTest("compiler/testData/codegen/box/involvesIrInterpreter/thisPlusStringWithObject.kt"); + } + @Test @TestMetadata("unsignedConst.kt") public void testUnsignedConst() throws Exception { runTest("compiler/testData/codegen/box/involvesIrInterpreter/unsignedConst.kt"); } + @Test + @TestMetadata("useCorrectToString.kt") + public void testUseCorrectToString() throws Exception { + runTest("compiler/testData/codegen/box/involvesIrInterpreter/useCorrectToString.kt"); + } + @Nested @TestMetadata("compiler/testData/codegen/box/involvesIrInterpreter/intrinsicConst") @TestDataPath("$PROJECT_ROOT") @@ -24444,11 +24468,65 @@ public class FirNativeCodegenBoxTestNoPLGenerated extends AbstractNativeCodegenB KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/involvesIrInterpreter/intrinsicConst"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.NATIVE, true); } + @Test + @TestMetadata("constTrimIndent.kt") + public void testConstTrimIndent() throws Exception { + runTest("compiler/testData/codegen/box/involvesIrInterpreter/intrinsicConst/constTrimIndent.kt"); + } + + @Test + @TestMetadata("constTrimMargin.kt") + public void testConstTrimMargin() throws Exception { + runTest("compiler/testData/codegen/box/involvesIrInterpreter/intrinsicConst/constTrimMargin.kt"); + } + + @Test + @TestMetadata("enumName.kt") + public void testEnumName() throws Exception { + runTest("compiler/testData/codegen/box/involvesIrInterpreter/intrinsicConst/enumName.kt"); + } + + @Test + @TestMetadata("enumNameWithInit.kt") + public void testEnumNameWithInit() throws Exception { + runTest("compiler/testData/codegen/box/involvesIrInterpreter/intrinsicConst/enumNameWithInit.kt"); + } + + @Test + @TestMetadata("equals_after.kt") + public void testEquals_after() throws Exception { + runTest("compiler/testData/codegen/box/involvesIrInterpreter/intrinsicConst/equals_after.kt"); + } + @Test @TestMetadata("ifConstVal.kt") public void testIfConstVal() throws Exception { runTest("compiler/testData/codegen/box/involvesIrInterpreter/intrinsicConst/ifConstVal.kt"); } + + @Test + @TestMetadata("kCallableName.kt") + public void testKCallableName() throws Exception { + runTest("compiler/testData/codegen/box/involvesIrInterpreter/intrinsicConst/kCallableName.kt"); + } + + @Test + @TestMetadata("kCallableNameWithSideEffect.kt") + public void testKCallableNameWithSideEffect() throws Exception { + runTest("compiler/testData/codegen/box/involvesIrInterpreter/intrinsicConst/kCallableNameWithSideEffect.kt"); + } + + @Test + @TestMetadata("kt53272.kt") + public void testKt53272() throws Exception { + runTest("compiler/testData/codegen/box/involvesIrInterpreter/intrinsicConst/kt53272.kt"); + } + + @Test + @TestMetadata("kt58717.kt") + public void testKt58717() throws Exception { + runTest("compiler/testData/codegen/box/involvesIrInterpreter/intrinsicConst/kt58717.kt"); + } } @Nested diff --git a/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/blackboxtest/NativeCodegenBoxTestGenerated.java b/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/blackboxtest/NativeCodegenBoxTestGenerated.java index ae8edf9633d..4922fd68d5d 100644 --- a/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/blackboxtest/NativeCodegenBoxTestGenerated.java +++ b/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/blackboxtest/NativeCodegenBoxTestGenerated.java @@ -23699,6 +23699,12 @@ public class NativeCodegenBoxTestGenerated extends AbstractNativeCodegenBoxTest runTest("compiler/testData/codegen/box/involvesIrInterpreter/longOperations.kt"); } + @Test + @TestMetadata("objectConstValInAnnotationArgument.kt") + public void testObjectConstValInAnnotationArgument() throws Exception { + runTest("compiler/testData/codegen/box/involvesIrInterpreter/objectConstValInAnnotationArgument.kt"); + } + @Test @TestMetadata("shortOperations.kt") public void testShortOperations() throws Exception { @@ -23729,12 +23735,30 @@ public class NativeCodegenBoxTestGenerated extends AbstractNativeCodegenBoxTest runTest("compiler/testData/codegen/box/involvesIrInterpreter/stringOperations.kt"); } + @Test + @TestMetadata("thisPlusString.kt") + public void testThisPlusString() throws Exception { + runTest("compiler/testData/codegen/box/involvesIrInterpreter/thisPlusString.kt"); + } + + @Test + @TestMetadata("thisPlusStringWithObject.kt") + public void testThisPlusStringWithObject() throws Exception { + runTest("compiler/testData/codegen/box/involvesIrInterpreter/thisPlusStringWithObject.kt"); + } + @Test @TestMetadata("unsignedConst.kt") public void testUnsignedConst() throws Exception { runTest("compiler/testData/codegen/box/involvesIrInterpreter/unsignedConst.kt"); } + @Test + @TestMetadata("useCorrectToString.kt") + public void testUseCorrectToString() throws Exception { + runTest("compiler/testData/codegen/box/involvesIrInterpreter/useCorrectToString.kt"); + } + @Nested @TestMetadata("compiler/testData/codegen/box/involvesIrInterpreter/intrinsicConst") @TestDataPath("$PROJECT_ROOT") @@ -23746,11 +23770,65 @@ public class NativeCodegenBoxTestGenerated extends AbstractNativeCodegenBoxTest KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/involvesIrInterpreter/intrinsicConst"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.NATIVE, true); } + @Test + @TestMetadata("constTrimIndent.kt") + public void testConstTrimIndent() throws Exception { + runTest("compiler/testData/codegen/box/involvesIrInterpreter/intrinsicConst/constTrimIndent.kt"); + } + + @Test + @TestMetadata("constTrimMargin.kt") + public void testConstTrimMargin() throws Exception { + runTest("compiler/testData/codegen/box/involvesIrInterpreter/intrinsicConst/constTrimMargin.kt"); + } + + @Test + @TestMetadata("enumName.kt") + public void testEnumName() throws Exception { + runTest("compiler/testData/codegen/box/involvesIrInterpreter/intrinsicConst/enumName.kt"); + } + + @Test + @TestMetadata("enumNameWithInit.kt") + public void testEnumNameWithInit() throws Exception { + runTest("compiler/testData/codegen/box/involvesIrInterpreter/intrinsicConst/enumNameWithInit.kt"); + } + + @Test + @TestMetadata("equals_after.kt") + public void testEquals_after() throws Exception { + runTest("compiler/testData/codegen/box/involvesIrInterpreter/intrinsicConst/equals_after.kt"); + } + @Test @TestMetadata("ifConstVal.kt") public void testIfConstVal() throws Exception { runTest("compiler/testData/codegen/box/involvesIrInterpreter/intrinsicConst/ifConstVal.kt"); } + + @Test + @TestMetadata("kCallableName.kt") + public void testKCallableName() throws Exception { + runTest("compiler/testData/codegen/box/involvesIrInterpreter/intrinsicConst/kCallableName.kt"); + } + + @Test + @TestMetadata("kCallableNameWithSideEffect.kt") + public void testKCallableNameWithSideEffect() throws Exception { + runTest("compiler/testData/codegen/box/involvesIrInterpreter/intrinsicConst/kCallableNameWithSideEffect.kt"); + } + + @Test + @TestMetadata("kt53272.kt") + public void testKt53272() throws Exception { + runTest("compiler/testData/codegen/box/involvesIrInterpreter/intrinsicConst/kt53272.kt"); + } + + @Test + @TestMetadata("kt58717.kt") + public void testKt58717() throws Exception { + runTest("compiler/testData/codegen/box/involvesIrInterpreter/intrinsicConst/kt58717.kt"); + } } @Nested diff --git a/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/blackboxtest/NativeCodegenBoxTestNoPLGenerated.java b/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/blackboxtest/NativeCodegenBoxTestNoPLGenerated.java index 91fc72ea026..f134b18cdcb 100644 --- a/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/blackboxtest/NativeCodegenBoxTestNoPLGenerated.java +++ b/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/blackboxtest/NativeCodegenBoxTestNoPLGenerated.java @@ -23931,6 +23931,12 @@ public class NativeCodegenBoxTestNoPLGenerated extends AbstractNativeCodegenBoxT runTest("compiler/testData/codegen/box/involvesIrInterpreter/longOperations.kt"); } + @Test + @TestMetadata("objectConstValInAnnotationArgument.kt") + public void testObjectConstValInAnnotationArgument() throws Exception { + runTest("compiler/testData/codegen/box/involvesIrInterpreter/objectConstValInAnnotationArgument.kt"); + } + @Test @TestMetadata("shortOperations.kt") public void testShortOperations() throws Exception { @@ -23961,12 +23967,30 @@ public class NativeCodegenBoxTestNoPLGenerated extends AbstractNativeCodegenBoxT runTest("compiler/testData/codegen/box/involvesIrInterpreter/stringOperations.kt"); } + @Test + @TestMetadata("thisPlusString.kt") + public void testThisPlusString() throws Exception { + runTest("compiler/testData/codegen/box/involvesIrInterpreter/thisPlusString.kt"); + } + + @Test + @TestMetadata("thisPlusStringWithObject.kt") + public void testThisPlusStringWithObject() throws Exception { + runTest("compiler/testData/codegen/box/involvesIrInterpreter/thisPlusStringWithObject.kt"); + } + @Test @TestMetadata("unsignedConst.kt") public void testUnsignedConst() throws Exception { runTest("compiler/testData/codegen/box/involvesIrInterpreter/unsignedConst.kt"); } + @Test + @TestMetadata("useCorrectToString.kt") + public void testUseCorrectToString() throws Exception { + runTest("compiler/testData/codegen/box/involvesIrInterpreter/useCorrectToString.kt"); + } + @Nested @TestMetadata("compiler/testData/codegen/box/involvesIrInterpreter/intrinsicConst") @TestDataPath("$PROJECT_ROOT") @@ -23979,11 +24003,65 @@ public class NativeCodegenBoxTestNoPLGenerated extends AbstractNativeCodegenBoxT KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/involvesIrInterpreter/intrinsicConst"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.NATIVE, true); } + @Test + @TestMetadata("constTrimIndent.kt") + public void testConstTrimIndent() throws Exception { + runTest("compiler/testData/codegen/box/involvesIrInterpreter/intrinsicConst/constTrimIndent.kt"); + } + + @Test + @TestMetadata("constTrimMargin.kt") + public void testConstTrimMargin() throws Exception { + runTest("compiler/testData/codegen/box/involvesIrInterpreter/intrinsicConst/constTrimMargin.kt"); + } + + @Test + @TestMetadata("enumName.kt") + public void testEnumName() throws Exception { + runTest("compiler/testData/codegen/box/involvesIrInterpreter/intrinsicConst/enumName.kt"); + } + + @Test + @TestMetadata("enumNameWithInit.kt") + public void testEnumNameWithInit() throws Exception { + runTest("compiler/testData/codegen/box/involvesIrInterpreter/intrinsicConst/enumNameWithInit.kt"); + } + + @Test + @TestMetadata("equals_after.kt") + public void testEquals_after() throws Exception { + runTest("compiler/testData/codegen/box/involvesIrInterpreter/intrinsicConst/equals_after.kt"); + } + @Test @TestMetadata("ifConstVal.kt") public void testIfConstVal() throws Exception { runTest("compiler/testData/codegen/box/involvesIrInterpreter/intrinsicConst/ifConstVal.kt"); } + + @Test + @TestMetadata("kCallableName.kt") + public void testKCallableName() throws Exception { + runTest("compiler/testData/codegen/box/involvesIrInterpreter/intrinsicConst/kCallableName.kt"); + } + + @Test + @TestMetadata("kCallableNameWithSideEffect.kt") + public void testKCallableNameWithSideEffect() throws Exception { + runTest("compiler/testData/codegen/box/involvesIrInterpreter/intrinsicConst/kCallableNameWithSideEffect.kt"); + } + + @Test + @TestMetadata("kt53272.kt") + public void testKt53272() throws Exception { + runTest("compiler/testData/codegen/box/involvesIrInterpreter/intrinsicConst/kt53272.kt"); + } + + @Test + @TestMetadata("kt58717.kt") + public void testKt58717() throws Exception { + runTest("compiler/testData/codegen/box/involvesIrInterpreter/intrinsicConst/kt58717.kt"); + } } @Nested