From b010d9eef8facbbe185c4588fee13f19a7b52aae Mon Sep 17 00:00:00 2001 From: Roman Artemev Date: Thu, 1 Nov 2018 17:43:36 +0300 Subject: [PATCH] Add Contract tests for JS --- .../codegen/box/arrays/inlineInitializer.kt | 16 ++++ .../cfgDependendValInitialization.kt | 40 +++++++++ .../contracts/definiteValInitInInitializer.kt | 38 ++++++++ .../contracts/propertyInitialization.kt | 1 + .../codegen/BlackBoxCodegenTestGenerated.java | 5 ++ .../BlackBoxInlineCodegenTestGenerated.java | 10 +++ ...otlinAgainstInlineKotlinTestGenerated.java | 10 +++ .../LightAnalysisModeTestGenerated.java | 5 ++ .../ir/IrBlackBoxCodegenTestGenerated.java | 5 ++ .../IrBlackBoxInlineCodegenTestGenerated.java | 10 +++ .../generators/tests/GenerateJsTests.kt | 8 ++ .../IrJsCodegenBoxTestGenerated.java | 5 ++ .../IrJsInlineContractsTestsGenerated.java | 86 +++++++++++++++++++ .../semantics/JsCodegenBoxTestGenerated.java | 5 ++ .../JsInlineContractsTestsGenerated.java | 86 +++++++++++++++++++ ...LegacyPrimitiveArraysBoxTestGenerated.java | 5 ++ .../abstractClassesForGeneratedTests.kt | 6 +- 17 files changed, 340 insertions(+), 1 deletion(-) create mode 100644 compiler/testData/codegen/box/arrays/inlineInitializer.kt create mode 100644 compiler/testData/codegen/boxInline/contracts/cfgDependendValInitialization.kt create mode 100644 compiler/testData/codegen/boxInline/contracts/definiteValInitInInitializer.kt create mode 100644 js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/IrJsInlineContractsTestsGenerated.java create mode 100644 js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/JsInlineContractsTestsGenerated.java diff --git a/compiler/testData/codegen/box/arrays/inlineInitializer.kt b/compiler/testData/codegen/box/arrays/inlineInitializer.kt new file mode 100644 index 00000000000..c8050aa20e0 --- /dev/null +++ b/compiler/testData/codegen/box/arrays/inlineInitializer.kt @@ -0,0 +1,16 @@ +class Foo( + val width: Int, + val height: Int, + // This function tells the constructor which cells are alive + // if init(i, j) is true, the cell (i, j) is alive + init: (Int, Int) -> String +) { + val live: Array> = Array(height) { i -> Array(width) { j -> init(i, j) } } +} + +fun box(): String { + + val foo = Foo(2, 2) { i, j -> if (i == j) (if (i == 0) "O" else "K") else "Fail@[$i, $j]" } + + return foo.live[0][0] + foo.live[1][1] +} \ No newline at end of file diff --git a/compiler/testData/codegen/boxInline/contracts/cfgDependendValInitialization.kt b/compiler/testData/codegen/boxInline/contracts/cfgDependendValInitialization.kt new file mode 100644 index 00000000000..2286a1ec75f --- /dev/null +++ b/compiler/testData/codegen/boxInline/contracts/cfgDependendValInitialization.kt @@ -0,0 +1,40 @@ +// !LANGUAGE: +AllowContractsForCustomFunctions +UseCallsInPlaceEffect +ReadDeserializedContracts +// !USE_EXPERIMENTAL: kotlin.contracts.ExperimentalContracts +// IGNORE_BACKEND: JVM_IR +// IGNORE_BACKEND: NATIVE +// FILE: 1.kt +package test + +import kotlin.contracts.* + +@Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE") +public inline fun myrun(block: () -> R): R { + contract { + callsInPlace(block, InvocationKind.EXACTLY_ONCE) + } + return block() +} + + +// FILE: 2.kt +import test.* + +fun test(b: Boolean): Int { + val x: Int + + if (b) { + x = 1 + } else { + myrun { + x = -1 + } + } + return x +} + +fun box(): String { + + if (test(true) != 1) return "Fail 1" + if (test(false) != -1) return "Fail 2" + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/boxInline/contracts/definiteValInitInInitializer.kt b/compiler/testData/codegen/boxInline/contracts/definiteValInitInInitializer.kt new file mode 100644 index 00000000000..88a46adf811 --- /dev/null +++ b/compiler/testData/codegen/boxInline/contracts/definiteValInitInInitializer.kt @@ -0,0 +1,38 @@ +// !LANGUAGE: +AllowContractsForCustomFunctions +UseCallsInPlaceEffect +ReadDeserializedContracts +// !USE_EXPERIMENTAL: kotlin.contracts.ExperimentalContracts +// IGNORE_BACKEND: JVM_IR +// IGNORE_BACKEND: NATIVE +// NO_CHECK_LAMBDA_INLINING +// FILE: 1.kt +package test + +import kotlin.contracts.* + +@Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE") +public inline fun myrun(block: () -> R): R { + contract { + callsInPlace(block, InvocationKind.EXACTLY_ONCE) + } + return block() +} + + +// FILE: 2.kt +import test.* + +class A { + val x: String + + constructor() { + } + + init { + val o: String + val k: String = "K" + myrun { o = "O" } + fun baz() = o + k + x = baz() + } +} + +fun box() = A().x \ No newline at end of file diff --git a/compiler/testData/codegen/boxInline/contracts/propertyInitialization.kt b/compiler/testData/codegen/boxInline/contracts/propertyInitialization.kt index efafcde6406..c007a15db79 100644 --- a/compiler/testData/codegen/boxInline/contracts/propertyInitialization.kt +++ b/compiler/testData/codegen/boxInline/contracts/propertyInitialization.kt @@ -1,6 +1,7 @@ // !LANGUAGE: +AllowContractsForCustomFunctions +UseCallsInPlaceEffect +ReadDeserializedContracts // !USE_EXPERIMENTAL: kotlin.contracts.ExperimentalContracts // IGNORE_BACKEND: JVM_IR +// IGNORE_BACKEND: JS_IR // IGNORE_BACKEND: NATIVE // FILE: 1.kt package test diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxCodegenTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxCodegenTestGenerated.java index 8ac45d6036f..5f015374db6 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxCodegenTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxCodegenTestGenerated.java @@ -430,6 +430,11 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest { runTest("compiler/testData/codegen/box/arrays/indicesChar.kt"); } + @TestMetadata("inlineInitializer.kt") + public void testInlineInitializer() throws Exception { + runTest("compiler/testData/codegen/box/arrays/inlineInitializer.kt"); + } + @TestMetadata("iterator.kt") public void testIterator() throws Exception { runTest("compiler/testData/codegen/box/arrays/iterator.kt"); diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxInlineCodegenTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxInlineCodegenTestGenerated.java index 8802c09e0a3..e1ef5379ff8 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxInlineCodegenTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxInlineCodegenTestGenerated.java @@ -989,6 +989,11 @@ public class BlackBoxInlineCodegenTestGenerated extends AbstractBlackBoxInlineCo KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/boxInline/contracts"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.ANY, true); } + @TestMetadata("cfgDependendValInitialization.kt") + public void testCfgDependendValInitialization() throws Exception { + runTest("compiler/testData/codegen/boxInline/contracts/cfgDependendValInitialization.kt"); + } + @TestMetadata("complexInitializer.kt") public void testComplexInitializer() throws Exception { runTest("compiler/testData/codegen/boxInline/contracts/complexInitializer.kt"); @@ -1009,6 +1014,11 @@ public class BlackBoxInlineCodegenTestGenerated extends AbstractBlackBoxInlineCo runTest("compiler/testData/codegen/boxInline/contracts/definiteNestedValInitialization.kt"); } + @TestMetadata("definiteValInitInInitializer.kt") + public void testDefiniteValInitInInitializer() throws Exception { + runTest("compiler/testData/codegen/boxInline/contracts/definiteValInitInInitializer.kt"); + } + @TestMetadata("definiteValInitialization.kt") public void testDefiniteValInitialization() throws Exception { runTest("compiler/testData/codegen/boxInline/contracts/definiteValInitialization.kt"); diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/CompileKotlinAgainstInlineKotlinTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/codegen/CompileKotlinAgainstInlineKotlinTestGenerated.java index 317bd2ad8a4..2fbe4fbf16b 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/CompileKotlinAgainstInlineKotlinTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/CompileKotlinAgainstInlineKotlinTestGenerated.java @@ -989,6 +989,11 @@ public class CompileKotlinAgainstInlineKotlinTestGenerated extends AbstractCompi KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/boxInline/contracts"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.ANY, true); } + @TestMetadata("cfgDependendValInitialization.kt") + public void testCfgDependendValInitialization() throws Exception { + runTest("compiler/testData/codegen/boxInline/contracts/cfgDependendValInitialization.kt"); + } + @TestMetadata("complexInitializer.kt") public void testComplexInitializer() throws Exception { runTest("compiler/testData/codegen/boxInline/contracts/complexInitializer.kt"); @@ -1009,6 +1014,11 @@ public class CompileKotlinAgainstInlineKotlinTestGenerated extends AbstractCompi runTest("compiler/testData/codegen/boxInline/contracts/definiteNestedValInitialization.kt"); } + @TestMetadata("definiteValInitInInitializer.kt") + public void testDefiniteValInitInInitializer() throws Exception { + runTest("compiler/testData/codegen/boxInline/contracts/definiteValInitInInitializer.kt"); + } + @TestMetadata("definiteValInitialization.kt") public void testDefiniteValInitialization() throws Exception { runTest("compiler/testData/codegen/boxInline/contracts/definiteValInitialization.kt"); diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java index 3e7b4e26124..8e686dd9ac2 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java @@ -430,6 +430,11 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes runTest("compiler/testData/codegen/box/arrays/indicesChar.kt"); } + @TestMetadata("inlineInitializer.kt") + public void testInlineInitializer() throws Exception { + runTest("compiler/testData/codegen/box/arrays/inlineInitializer.kt"); + } + @TestMetadata("iterator.kt") public void testIterator() throws Exception { runTest("compiler/testData/codegen/box/arrays/iterator.kt"); diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrBlackBoxCodegenTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrBlackBoxCodegenTestGenerated.java index 8a2993db288..7692210ddcb 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrBlackBoxCodegenTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrBlackBoxCodegenTestGenerated.java @@ -430,6 +430,11 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes runTest("compiler/testData/codegen/box/arrays/indicesChar.kt"); } + @TestMetadata("inlineInitializer.kt") + public void testInlineInitializer() throws Exception { + runTest("compiler/testData/codegen/box/arrays/inlineInitializer.kt"); + } + @TestMetadata("iterator.kt") public void testIterator() throws Exception { runTest("compiler/testData/codegen/box/arrays/iterator.kt"); diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrBlackBoxInlineCodegenTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrBlackBoxInlineCodegenTestGenerated.java index e8e3edcd076..8aace116560 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrBlackBoxInlineCodegenTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrBlackBoxInlineCodegenTestGenerated.java @@ -989,6 +989,11 @@ public class IrBlackBoxInlineCodegenTestGenerated extends AbstractIrBlackBoxInli KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/boxInline/contracts"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM_IR, true); } + @TestMetadata("cfgDependendValInitialization.kt") + public void testCfgDependendValInitialization() throws Exception { + runTest("compiler/testData/codegen/boxInline/contracts/cfgDependendValInitialization.kt"); + } + @TestMetadata("complexInitializer.kt") public void testComplexInitializer() throws Exception { runTest("compiler/testData/codegen/boxInline/contracts/complexInitializer.kt"); @@ -1009,6 +1014,11 @@ public class IrBlackBoxInlineCodegenTestGenerated extends AbstractIrBlackBoxInli runTest("compiler/testData/codegen/boxInline/contracts/definiteNestedValInitialization.kt"); } + @TestMetadata("definiteValInitInInitializer.kt") + public void testDefiniteValInitInInitializer() throws Exception { + runTest("compiler/testData/codegen/boxInline/contracts/definiteValInitInInitializer.kt"); + } + @TestMetadata("definiteValInitialization.kt") public void testDefiniteValInitialization() throws Exception { runTest("compiler/testData/codegen/boxInline/contracts/definiteValInitialization.kt"); diff --git a/js/js.tests/test/org/jetbrains/kotlin/generators/tests/GenerateJsTests.kt b/js/js.tests/test/org/jetbrains/kotlin/generators/tests/GenerateJsTests.kt index a44dbc6edf3..a5c19429d58 100644 --- a/js/js.tests/test/org/jetbrains/kotlin/generators/tests/GenerateJsTests.kt +++ b/js/js.tests/test/org/jetbrains/kotlin/generators/tests/GenerateJsTests.kt @@ -108,6 +108,14 @@ fun main(args: Array) { model("codegen/boxInline/suspend/", targetBackend = TargetBackend.JS_IR) } + testClass { + model("codegen/boxInline/contracts/", targetBackend = TargetBackend.JS) + } + + testClass { + model("codegen/boxInline/contracts/", targetBackend = TargetBackend.JS_IR) + } + testClass { model("codegen/box/arrays", targetBackend = TargetBackend.JS) } diff --git a/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/IrJsCodegenBoxTestGenerated.java b/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/IrJsCodegenBoxTestGenerated.java index 0f4430db5fe..9b840255409 100644 --- a/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/IrJsCodegenBoxTestGenerated.java +++ b/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/IrJsCodegenBoxTestGenerated.java @@ -400,6 +400,11 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest { runTest("compiler/testData/codegen/box/arrays/indicesChar.kt"); } + @TestMetadata("inlineInitializer.kt") + public void testInlineInitializer() throws Exception { + runTest("compiler/testData/codegen/box/arrays/inlineInitializer.kt"); + } + @TestMetadata("iterator.kt") public void testIterator() throws Exception { runTest("compiler/testData/codegen/box/arrays/iterator.kt"); diff --git a/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/IrJsInlineContractsTestsGenerated.java b/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/IrJsInlineContractsTestsGenerated.java new file mode 100644 index 00000000000..fe6f93a99f4 --- /dev/null +++ b/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/IrJsInlineContractsTestsGenerated.java @@ -0,0 +1,86 @@ +/* + * Copyright 2010-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license + * that can be found in the license/LICENSE.txt file. + */ + +package org.jetbrains.kotlin.js.test.semantics; + +import com.intellij.testFramework.TestDataPath; +import org.jetbrains.kotlin.test.JUnit3RunnerWithInners; +import org.jetbrains.kotlin.test.KotlinTestUtils; +import org.jetbrains.kotlin.test.TargetBackend; +import org.jetbrains.kotlin.test.TestMetadata; +import org.junit.runner.RunWith; + +import java.io.File; +import java.util.regex.Pattern; + +/** This class is generated by {@link org.jetbrains.kotlin.generators.tests.TestsPackage}. DO NOT MODIFY MANUALLY */ +@SuppressWarnings("all") +@TestMetadata("compiler/testData/codegen/boxInline/contracts") +@TestDataPath("$PROJECT_ROOT") +@RunWith(JUnit3RunnerWithInners.class) +public class IrJsInlineContractsTestsGenerated extends AbstractIrJsInlineContractsTests { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS_IR, testDataFilePath); + } + + public void testAllFilesPresentInContracts() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/boxInline/contracts"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JS_IR, true); + } + + @TestMetadata("cfgDependendValInitialization.kt") + public void testCfgDependendValInitialization() throws Exception { + runTest("compiler/testData/codegen/boxInline/contracts/cfgDependendValInitialization.kt"); + } + + @TestMetadata("complexInitializer.kt") + public void testComplexInitializer() throws Exception { + runTest("compiler/testData/codegen/boxInline/contracts/complexInitializer.kt"); + } + + @TestMetadata("complexInitializerWithStackTransformation.kt") + public void testComplexInitializerWithStackTransformation() throws Exception { + runTest("compiler/testData/codegen/boxInline/contracts/complexInitializerWithStackTransformation.kt"); + } + + @TestMetadata("definiteLongValInitialization.kt") + public void testDefiniteLongValInitialization() throws Exception { + runTest("compiler/testData/codegen/boxInline/contracts/definiteLongValInitialization.kt"); + } + + @TestMetadata("definiteNestedValInitialization.kt") + public void testDefiniteNestedValInitialization() throws Exception { + runTest("compiler/testData/codegen/boxInline/contracts/definiteNestedValInitialization.kt"); + } + + @TestMetadata("definiteValInitInInitializer.kt") + public void testDefiniteValInitInInitializer() throws Exception { + runTest("compiler/testData/codegen/boxInline/contracts/definiteValInitInInitializer.kt"); + } + + @TestMetadata("definiteValInitialization.kt") + public void testDefiniteValInitialization() throws Exception { + runTest("compiler/testData/codegen/boxInline/contracts/definiteValInitialization.kt"); + } + + @TestMetadata("nonLocalReturn.kt") + public void testNonLocalReturn() throws Exception { + runTest("compiler/testData/codegen/boxInline/contracts/nonLocalReturn.kt"); + } + + @TestMetadata("nonLocalReturnWithCycle.kt") + public void testNonLocalReturnWithCycle() throws Exception { + runTest("compiler/testData/codegen/boxInline/contracts/nonLocalReturnWithCycle.kt"); + } + + @TestMetadata("propertyInitialization.kt") + public void testPropertyInitialization() throws Exception { + runTest("compiler/testData/codegen/boxInline/contracts/propertyInitialization.kt"); + } + + @TestMetadata("valInitializationAndUsageInNestedLambda.kt") + public void testValInitializationAndUsageInNestedLambda() throws Exception { + runTest("compiler/testData/codegen/boxInline/contracts/valInitializationAndUsageInNestedLambda.kt"); + } +} diff --git a/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/JsCodegenBoxTestGenerated.java b/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/JsCodegenBoxTestGenerated.java index a097aab4ada..13eb7345913 100644 --- a/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/JsCodegenBoxTestGenerated.java +++ b/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/JsCodegenBoxTestGenerated.java @@ -400,6 +400,11 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest { runTest("compiler/testData/codegen/box/arrays/indicesChar.kt"); } + @TestMetadata("inlineInitializer.kt") + public void testInlineInitializer() throws Exception { + runTest("compiler/testData/codegen/box/arrays/inlineInitializer.kt"); + } + @TestMetadata("iterator.kt") public void testIterator() throws Exception { runTest("compiler/testData/codegen/box/arrays/iterator.kt"); diff --git a/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/JsInlineContractsTestsGenerated.java b/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/JsInlineContractsTestsGenerated.java new file mode 100644 index 00000000000..3a16587e562 --- /dev/null +++ b/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/JsInlineContractsTestsGenerated.java @@ -0,0 +1,86 @@ +/* + * Copyright 2010-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license + * that can be found in the license/LICENSE.txt file. + */ + +package org.jetbrains.kotlin.js.test.semantics; + +import com.intellij.testFramework.TestDataPath; +import org.jetbrains.kotlin.test.JUnit3RunnerWithInners; +import org.jetbrains.kotlin.test.KotlinTestUtils; +import org.jetbrains.kotlin.test.TargetBackend; +import org.jetbrains.kotlin.test.TestMetadata; +import org.junit.runner.RunWith; + +import java.io.File; +import java.util.regex.Pattern; + +/** This class is generated by {@link org.jetbrains.kotlin.generators.tests.TestsPackage}. DO NOT MODIFY MANUALLY */ +@SuppressWarnings("all") +@TestMetadata("compiler/testData/codegen/boxInline/contracts") +@TestDataPath("$PROJECT_ROOT") +@RunWith(JUnit3RunnerWithInners.class) +public class JsInlineContractsTestsGenerated extends AbstractJsInlineContractsTests { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS, testDataFilePath); + } + + public void testAllFilesPresentInContracts() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/boxInline/contracts"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JS, true); + } + + @TestMetadata("cfgDependendValInitialization.kt") + public void testCfgDependendValInitialization() throws Exception { + runTest("compiler/testData/codegen/boxInline/contracts/cfgDependendValInitialization.kt"); + } + + @TestMetadata("complexInitializer.kt") + public void testComplexInitializer() throws Exception { + runTest("compiler/testData/codegen/boxInline/contracts/complexInitializer.kt"); + } + + @TestMetadata("complexInitializerWithStackTransformation.kt") + public void testComplexInitializerWithStackTransformation() throws Exception { + runTest("compiler/testData/codegen/boxInline/contracts/complexInitializerWithStackTransformation.kt"); + } + + @TestMetadata("definiteLongValInitialization.kt") + public void testDefiniteLongValInitialization() throws Exception { + runTest("compiler/testData/codegen/boxInline/contracts/definiteLongValInitialization.kt"); + } + + @TestMetadata("definiteNestedValInitialization.kt") + public void testDefiniteNestedValInitialization() throws Exception { + runTest("compiler/testData/codegen/boxInline/contracts/definiteNestedValInitialization.kt"); + } + + @TestMetadata("definiteValInitInInitializer.kt") + public void testDefiniteValInitInInitializer() throws Exception { + runTest("compiler/testData/codegen/boxInline/contracts/definiteValInitInInitializer.kt"); + } + + @TestMetadata("definiteValInitialization.kt") + public void testDefiniteValInitialization() throws Exception { + runTest("compiler/testData/codegen/boxInline/contracts/definiteValInitialization.kt"); + } + + @TestMetadata("nonLocalReturn.kt") + public void testNonLocalReturn() throws Exception { + runTest("compiler/testData/codegen/boxInline/contracts/nonLocalReturn.kt"); + } + + @TestMetadata("nonLocalReturnWithCycle.kt") + public void testNonLocalReturnWithCycle() throws Exception { + runTest("compiler/testData/codegen/boxInline/contracts/nonLocalReturnWithCycle.kt"); + } + + @TestMetadata("propertyInitialization.kt") + public void testPropertyInitialization() throws Exception { + runTest("compiler/testData/codegen/boxInline/contracts/propertyInitialization.kt"); + } + + @TestMetadata("valInitializationAndUsageInNestedLambda.kt") + public void testValInitializationAndUsageInNestedLambda() throws Exception { + runTest("compiler/testData/codegen/boxInline/contracts/valInitializationAndUsageInNestedLambda.kt"); + } +} diff --git a/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/JsLegacyPrimitiveArraysBoxTestGenerated.java b/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/JsLegacyPrimitiveArraysBoxTestGenerated.java index 4857ce80ff3..f774ed1f3f6 100644 --- a/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/JsLegacyPrimitiveArraysBoxTestGenerated.java +++ b/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/JsLegacyPrimitiveArraysBoxTestGenerated.java @@ -154,6 +154,11 @@ public class JsLegacyPrimitiveArraysBoxTestGenerated extends AbstractJsLegacyPri runTest("compiler/testData/codegen/box/arrays/indicesChar.kt"); } + @TestMetadata("inlineInitializer.kt") + public void testInlineInitializer() throws Exception { + runTest("compiler/testData/codegen/box/arrays/inlineInitializer.kt"); + } + @TestMetadata("iterator.kt") public void testIterator() throws Exception { runTest("compiler/testData/codegen/box/arrays/iterator.kt"); diff --git a/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/abstractClassesForGeneratedTests.kt b/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/abstractClassesForGeneratedTests.kt index 5d345c12b55..fe6f9128881 100644 --- a/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/abstractClassesForGeneratedTests.kt +++ b/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/abstractClassesForGeneratedTests.kt @@ -31,6 +31,8 @@ abstract class AbstractInlineDefaultValuesTests : BorrowedInlineTest("defaultVal abstract class AbstractInlineSuspendTests : BorrowedInlineTest("suspend/") +abstract class AbstractJsInlineContractsTests : BorrowedInlineTest("contracts/") + abstract class AbstractBoxJsTest : BasicBoxTest( BasicBoxTest.TEST_DATA_DIR_PATH + "box/", "box/" @@ -84,4 +86,6 @@ abstract class AbstractIrEnumValuesInlineTests : BorrowedIrInlineTest("enum/") abstract class AbstractIrInlineDefaultValuesTests : BorrowedIrInlineTest("defaultValues/") -abstract class AbstractIrInlineSuspendTests : BorrowedIrInlineTest("suspend/") \ No newline at end of file +abstract class AbstractIrInlineSuspendTests : BorrowedIrInlineTest("suspend/") + +abstract class AbstractIrJsInlineContractsTests : BorrowedIrInlineTest("contracts/") \ No newline at end of file