From cc14442be139d83e7f17ba74bdb7fc4c1b4eccfe Mon Sep 17 00:00:00 2001 From: Roman Artemev Date: Thu, 23 Aug 2018 16:41:25 +0300 Subject: [PATCH] Add tests for primitive companion object Update test data --- .../localFunctions/named/stateMachine.kt | 1 - .../functionExpressionWithThisReference.kt | 1 - .../primitiveCompanion/byteCompanionObject.kt | 21 ++++++++ .../primitiveCompanion/charCompanionObject.kt | 21 ++++++++ .../doubleCompanionObject.kt | 20 ++++++++ .../floatCompanionObject.kt | 20 ++++++++ .../primitiveCompanion/intCompanionObject.kt | 20 ++++++++ .../primitiveCompanion/longCompanionObject.kt | 21 ++++++++ .../shortCompanionObject.kt | 21 ++++++++ .../box/ranges/forInUntil/forInUntilInt.kt | 1 - .../ranges/forInUntil/forInUntilLesserInt.kt | 1 - .../box/ranges/forInUntil/forInUntilMaxint.kt | 1 - .../box/ranges/forInUntil/forInUntilMinint.kt | 1 - .../forIntInIntUntilSmartcastInt.kt | 1 - .../forInDownToIntMinValue.kt | 1 - .../forInRangeToIntMaxValue.kt | 1 - .../codegen/BlackBoxCodegenTestGenerated.java | 48 +++++++++++++++++++ .../LightAnalysisModeTestGenerated.java | 48 +++++++++++++++++++ .../ir/IrBlackBoxCodegenTestGenerated.java | 48 +++++++++++++++++++ .../IrJsCodegenBoxTestGenerated.java | 48 +++++++++++++++++++ .../semantics/JsCodegenBoxTestGenerated.java | 48 +++++++++++++++++++ .../testData/box/inlineStdlib/closure.kt | 1 - .../box/inlineStdlib/closureNested.kt | 1 - .../testData/box/inlineStdlib/simple.kt | 1 - .../box/range/numberRangesOptimized.kt | 1 - 25 files changed, 384 insertions(+), 13 deletions(-) create mode 100644 compiler/testData/codegen/box/objects/companionObjectAccess/primitiveCompanion/byteCompanionObject.kt create mode 100644 compiler/testData/codegen/box/objects/companionObjectAccess/primitiveCompanion/charCompanionObject.kt create mode 100644 compiler/testData/codegen/box/objects/companionObjectAccess/primitiveCompanion/doubleCompanionObject.kt create mode 100644 compiler/testData/codegen/box/objects/companionObjectAccess/primitiveCompanion/floatCompanionObject.kt create mode 100644 compiler/testData/codegen/box/objects/companionObjectAccess/primitiveCompanion/intCompanionObject.kt create mode 100644 compiler/testData/codegen/box/objects/companionObjectAccess/primitiveCompanion/longCompanionObject.kt create mode 100644 compiler/testData/codegen/box/objects/companionObjectAccess/primitiveCompanion/shortCompanionObject.kt diff --git a/compiler/testData/codegen/box/coroutines/localFunctions/named/stateMachine.kt b/compiler/testData/codegen/box/coroutines/localFunctions/named/stateMachine.kt index 971a8740b1e..8ab99d236a4 100644 --- a/compiler/testData/codegen/box/coroutines/localFunctions/named/stateMachine.kt +++ b/compiler/testData/codegen/box/coroutines/localFunctions/named/stateMachine.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND: JS_IR // IGNORE_BACKEND: JVM_IR // WITH_RUNTIME // WITH_COROUTINES diff --git a/compiler/testData/codegen/box/functions/functionExpression/functionExpressionWithThisReference.kt b/compiler/testData/codegen/box/functions/functionExpression/functionExpressionWithThisReference.kt index ed91f58d312..7e1dafc32a0 100644 --- a/compiler/testData/codegen/box/functions/functionExpression/functionExpressionWithThisReference.kt +++ b/compiler/testData/codegen/box/functions/functionExpression/functionExpressionWithThisReference.kt @@ -1,5 +1,4 @@ // IGNORE_BACKEND: JVM_IR -// IGNORE_BACKEND: JS_IR fun Int.thisRef1() = fun () = this fun Int.thisRef2() = fun (): Int {return this} diff --git a/compiler/testData/codegen/box/objects/companionObjectAccess/primitiveCompanion/byteCompanionObject.kt b/compiler/testData/codegen/box/objects/companionObjectAccess/primitiveCompanion/byteCompanionObject.kt new file mode 100644 index 00000000000..4beacd00275 --- /dev/null +++ b/compiler/testData/codegen/box/objects/companionObjectAccess/primitiveCompanion/byteCompanionObject.kt @@ -0,0 +1,21 @@ +// IGNORE_BACKEND: JVM_IR + +fun assertEquals(a: T, b: T) { if (a != b) throw AssertionError("$a != $b") } + +fun Byte.Companion.MAX() = MAX_VALUE +fun Byte.Companion.MIN() = MIN_VALUE + +fun test(o: T) { assertEquals(o === Byte.Companion, true) } + +fun box(): String { + + assertEquals(127, Byte.MAX_VALUE) + + assertEquals(Byte.MIN_VALUE, Byte.MIN()) + assertEquals(Byte.MAX_VALUE, Byte.Companion.MAX()) + + test(Byte) + test(Byte.Companion) + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/objects/companionObjectAccess/primitiveCompanion/charCompanionObject.kt b/compiler/testData/codegen/box/objects/companionObjectAccess/primitiveCompanion/charCompanionObject.kt new file mode 100644 index 00000000000..f9c605aacf3 --- /dev/null +++ b/compiler/testData/codegen/box/objects/companionObjectAccess/primitiveCompanion/charCompanionObject.kt @@ -0,0 +1,21 @@ +// IGNORE_BACKEND: JVM_IR + +fun assertEquals(a: T, b: T) { if (a != b) throw AssertionError("$a != $b") } + +fun Char.Companion.MAX() = MAX_SURROGATE +fun Char.Companion.MIN() = MIN_SURROGATE + +fun test(o: T) { assertEquals(o === Char.Companion, true) } + +fun box(): String { + + assertEquals('\uDFFF', Char.MAX_SURROGATE) + + assertEquals(Char.MIN_SURROGATE, Char.MIN()) + assertEquals(Char.MAX_SURROGATE, Char.Companion.MAX()) + + test(Char) + test(Char.Companion) + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/objects/companionObjectAccess/primitiveCompanion/doubleCompanionObject.kt b/compiler/testData/codegen/box/objects/companionObjectAccess/primitiveCompanion/doubleCompanionObject.kt new file mode 100644 index 00000000000..d6493b95bcb --- /dev/null +++ b/compiler/testData/codegen/box/objects/companionObjectAccess/primitiveCompanion/doubleCompanionObject.kt @@ -0,0 +1,20 @@ + +fun assertEquals(a: T, b: T) { if (a != b) throw AssertionError("$a != $b") } + +fun Double.Companion.MAX() = MAX_VALUE +fun Double.Companion.MIN() = MIN_VALUE + +fun test(o: T) { assertEquals(o === Double.Companion, true) } + +fun box(): String { + + assertEquals(1.7976931348623157E308, Double.MAX_VALUE) + + assertEquals(Double.MIN_VALUE, Double.MIN()) + assertEquals(Double.MAX_VALUE, Double.Companion.MAX()) + + test(Double) + test(Double.Companion) + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/objects/companionObjectAccess/primitiveCompanion/floatCompanionObject.kt b/compiler/testData/codegen/box/objects/companionObjectAccess/primitiveCompanion/floatCompanionObject.kt new file mode 100644 index 00000000000..bb2f5c2d3c3 --- /dev/null +++ b/compiler/testData/codegen/box/objects/companionObjectAccess/primitiveCompanion/floatCompanionObject.kt @@ -0,0 +1,20 @@ + +fun assertEquals(a: T, b: T) { if (a != b) throw AssertionError("$a != $b") } + +fun Float.Companion.MAX() = POSITIVE_INFINITY +fun Float.Companion.MIN() = NEGATIVE_INFINITY + +fun test(o: T) { assertEquals(o === Float.Companion, true) } + +fun box(): String { + + assertEquals(1.0f / 0.0f, Float.POSITIVE_INFINITY) + + assertEquals(Float.NEGATIVE_INFINITY, Float.MIN()) + assertEquals(Float.POSITIVE_INFINITY, Float.Companion.MAX()) + + test(Float) + test(Float.Companion) + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/objects/companionObjectAccess/primitiveCompanion/intCompanionObject.kt b/compiler/testData/codegen/box/objects/companionObjectAccess/primitiveCompanion/intCompanionObject.kt new file mode 100644 index 00000000000..df7698f37cb --- /dev/null +++ b/compiler/testData/codegen/box/objects/companionObjectAccess/primitiveCompanion/intCompanionObject.kt @@ -0,0 +1,20 @@ +// IGNORE_BACKEND: JVM_IR + +fun assertEquals(a: T, b: T) { if (a != b) throw AssertionError("$a != $b") } + +fun Int.Companion.MAX() = MAX_VALUE +fun Int.Companion.MIN() = MIN_VALUE + +fun test(o: T) { assertEquals(o === Int.Companion, true) } + +fun box(): String { + assertEquals(2147483647, Int.MAX_VALUE) + + assertEquals(Int.MIN_VALUE, Int.MIN()) + assertEquals(Int.MAX_VALUE, Int.Companion.MAX()) + + test(Int) + test(Int.Companion) + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/objects/companionObjectAccess/primitiveCompanion/longCompanionObject.kt b/compiler/testData/codegen/box/objects/companionObjectAccess/primitiveCompanion/longCompanionObject.kt new file mode 100644 index 00000000000..c1f7089eef2 --- /dev/null +++ b/compiler/testData/codegen/box/objects/companionObjectAccess/primitiveCompanion/longCompanionObject.kt @@ -0,0 +1,21 @@ +// IGNORE_BACKEND: JVM_IR + +fun assertEquals(a: T, b: T) { if (a != b) throw AssertionError("$a != $b") } + +fun Long.Companion.MAX() = MAX_VALUE +fun Long.Companion.MIN() = MIN_VALUE + +fun test(o: T) { assertEquals(o === Long.Companion, true) } + +fun box(): String { + + assertEquals(9223372036854775807L, Long.MAX_VALUE) + + assertEquals(Long.MIN_VALUE, Long.MIN()) + assertEquals(Long.MAX_VALUE, Long.Companion.MAX()) + + test(Long) + test(Long.Companion) + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/objects/companionObjectAccess/primitiveCompanion/shortCompanionObject.kt b/compiler/testData/codegen/box/objects/companionObjectAccess/primitiveCompanion/shortCompanionObject.kt new file mode 100644 index 00000000000..eeb98a04bca --- /dev/null +++ b/compiler/testData/codegen/box/objects/companionObjectAccess/primitiveCompanion/shortCompanionObject.kt @@ -0,0 +1,21 @@ +// IGNORE_BACKEND: JVM_IR + +fun assertEquals(a: T, b: T) { if (a != b) throw AssertionError("$a != $b") } + +fun Short.Companion.MAX() = MAX_VALUE +fun Short.Companion.MIN() = MIN_VALUE + +fun test(o: T) { assertEquals(o === Short.Companion, true) } + +fun box(): String { + + assertEquals(32767, Short.MAX_VALUE) + + assertEquals(Short.MIN_VALUE, Short.MIN()) + assertEquals(Short.MAX_VALUE, Short.Companion.MAX()) + + test(Short) + test(Short.Companion) + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/ranges/forInUntil/forInUntilInt.kt b/compiler/testData/codegen/box/ranges/forInUntil/forInUntilInt.kt index 95a2c541e3b..45e865c4d72 100644 --- a/compiler/testData/codegen/box/ranges/forInUntil/forInUntilInt.kt +++ b/compiler/testData/codegen/box/ranges/forInUntil/forInUntilInt.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND: JS_IR // WITH_RUNTIME import kotlin.test.assertEquals diff --git a/compiler/testData/codegen/box/ranges/forInUntil/forInUntilLesserInt.kt b/compiler/testData/codegen/box/ranges/forInUntil/forInUntilLesserInt.kt index 99144ca4f19..549b8d6fa9a 100644 --- a/compiler/testData/codegen/box/ranges/forInUntil/forInUntilLesserInt.kt +++ b/compiler/testData/codegen/box/ranges/forInUntil/forInUntilLesserInt.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND: JS_IR // WITH_RUNTIME import kotlin.test.assertEquals diff --git a/compiler/testData/codegen/box/ranges/forInUntil/forInUntilMaxint.kt b/compiler/testData/codegen/box/ranges/forInUntil/forInUntilMaxint.kt index 74891de109d..00929a522d5 100644 --- a/compiler/testData/codegen/box/ranges/forInUntil/forInUntilMaxint.kt +++ b/compiler/testData/codegen/box/ranges/forInUntil/forInUntilMaxint.kt @@ -1,5 +1,4 @@ // IGNORE_BACKEND: JVM_IR -// IGNORE_BACKEND: JS_IR // WITH_RUNTIME import kotlin.test.assertEquals diff --git a/compiler/testData/codegen/box/ranges/forInUntil/forInUntilMinint.kt b/compiler/testData/codegen/box/ranges/forInUntil/forInUntilMinint.kt index e4dfafb0cc3..d3a78ce3566 100644 --- a/compiler/testData/codegen/box/ranges/forInUntil/forInUntilMinint.kt +++ b/compiler/testData/codegen/box/ranges/forInUntil/forInUntilMinint.kt @@ -1,5 +1,4 @@ // IGNORE_BACKEND: JVM_IR -// IGNORE_BACKEND: JS_IR // WITH_RUNTIME import kotlin.test.assertEquals diff --git a/compiler/testData/codegen/box/ranges/forInUntil/forIntInIntUntilSmartcastInt.kt b/compiler/testData/codegen/box/ranges/forInUntil/forIntInIntUntilSmartcastInt.kt index 2a75f26b863..0cbaf4531ad 100644 --- a/compiler/testData/codegen/box/ranges/forInUntil/forIntInIntUntilSmartcastInt.kt +++ b/compiler/testData/codegen/box/ranges/forInUntil/forIntInIntUntilSmartcastInt.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND: JS_IR // WITH_RUNTIME import kotlin.test.assertEquals diff --git a/compiler/testData/codegen/box/ranges/forWithPossibleOverflow/forInDownToIntMinValue.kt b/compiler/testData/codegen/box/ranges/forWithPossibleOverflow/forInDownToIntMinValue.kt index cf846ba1ad9..4cb8afaf68a 100644 --- a/compiler/testData/codegen/box/ranges/forWithPossibleOverflow/forInDownToIntMinValue.kt +++ b/compiler/testData/codegen/box/ranges/forWithPossibleOverflow/forInDownToIntMinValue.kt @@ -1,5 +1,4 @@ // IGNORE_BACKEND: JVM_IR -// IGNORE_BACKEND: JS_IR // WITH_RUNTIME const val M = Int.MIN_VALUE diff --git a/compiler/testData/codegen/box/ranges/forWithPossibleOverflow/forInRangeToIntMaxValue.kt b/compiler/testData/codegen/box/ranges/forWithPossibleOverflow/forInRangeToIntMaxValue.kt index 0fc6a12ee7b..27709c25dbd 100644 --- a/compiler/testData/codegen/box/ranges/forWithPossibleOverflow/forInRangeToIntMaxValue.kt +++ b/compiler/testData/codegen/box/ranges/forWithPossibleOverflow/forInRangeToIntMaxValue.kt @@ -1,5 +1,4 @@ // IGNORE_BACKEND: JVM_IR -// IGNORE_BACKEND: JS_IR const val M = Int.MAX_VALUE fun box(): String { diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxCodegenTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxCodegenTestGenerated.java index e7048075903..b750e0ff2a0 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxCodegenTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxCodegenTestGenerated.java @@ -14631,6 +14631,54 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest { public void testProtectedCompanionObjectAccessedFromNestedClass() throws Exception { runTest("compiler/testData/codegen/box/objects/companionObjectAccess/protectedCompanionObjectAccessedFromNestedClass.kt"); } + + @TestMetadata("compiler/testData/codegen/box/objects/companionObjectAccess/primitiveCompanion") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class PrimitiveCompanion extends AbstractBlackBoxCodegenTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); + } + + public void testAllFilesPresentInPrimitiveCompanion() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/objects/companionObjectAccess/primitiveCompanion"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM, true); + } + + @TestMetadata("byteCompanionObject.kt") + public void testByteCompanionObject() throws Exception { + runTest("compiler/testData/codegen/box/objects/companionObjectAccess/primitiveCompanion/byteCompanionObject.kt"); + } + + @TestMetadata("charCompanionObject.kt") + public void testCharCompanionObject() throws Exception { + runTest("compiler/testData/codegen/box/objects/companionObjectAccess/primitiveCompanion/charCompanionObject.kt"); + } + + @TestMetadata("doubleCompanionObject.kt") + public void testDoubleCompanionObject() throws Exception { + runTest("compiler/testData/codegen/box/objects/companionObjectAccess/primitiveCompanion/doubleCompanionObject.kt"); + } + + @TestMetadata("floatCompanionObject.kt") + public void testFloatCompanionObject() throws Exception { + runTest("compiler/testData/codegen/box/objects/companionObjectAccess/primitiveCompanion/floatCompanionObject.kt"); + } + + @TestMetadata("intCompanionObject.kt") + public void testIntCompanionObject() throws Exception { + runTest("compiler/testData/codegen/box/objects/companionObjectAccess/primitiveCompanion/intCompanionObject.kt"); + } + + @TestMetadata("longCompanionObject.kt") + public void testLongCompanionObject() throws Exception { + runTest("compiler/testData/codegen/box/objects/companionObjectAccess/primitiveCompanion/longCompanionObject.kt"); + } + + @TestMetadata("shortCompanionObject.kt") + public void testShortCompanionObject() throws Exception { + runTest("compiler/testData/codegen/box/objects/companionObjectAccess/primitiveCompanion/shortCompanionObject.kt"); + } + } } } diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java index d71930cb909..70ff26a0ea8 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java @@ -14631,6 +14631,54 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes public void testProtectedCompanionObjectAccessedFromNestedClass() throws Exception { runTest("compiler/testData/codegen/box/objects/companionObjectAccess/protectedCompanionObjectAccessedFromNestedClass.kt"); } + + @TestMetadata("compiler/testData/codegen/box/objects/companionObjectAccess/primitiveCompanion") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class PrimitiveCompanion extends AbstractLightAnalysisModeTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); + } + + public void testAllFilesPresentInPrimitiveCompanion() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/objects/companionObjectAccess/primitiveCompanion"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM, true); + } + + @TestMetadata("byteCompanionObject.kt") + public void testByteCompanionObject() throws Exception { + runTest("compiler/testData/codegen/box/objects/companionObjectAccess/primitiveCompanion/byteCompanionObject.kt"); + } + + @TestMetadata("charCompanionObject.kt") + public void testCharCompanionObject() throws Exception { + runTest("compiler/testData/codegen/box/objects/companionObjectAccess/primitiveCompanion/charCompanionObject.kt"); + } + + @TestMetadata("doubleCompanionObject.kt") + public void testDoubleCompanionObject() throws Exception { + runTest("compiler/testData/codegen/box/objects/companionObjectAccess/primitiveCompanion/doubleCompanionObject.kt"); + } + + @TestMetadata("floatCompanionObject.kt") + public void testFloatCompanionObject() throws Exception { + runTest("compiler/testData/codegen/box/objects/companionObjectAccess/primitiveCompanion/floatCompanionObject.kt"); + } + + @TestMetadata("intCompanionObject.kt") + public void testIntCompanionObject() throws Exception { + runTest("compiler/testData/codegen/box/objects/companionObjectAccess/primitiveCompanion/intCompanionObject.kt"); + } + + @TestMetadata("longCompanionObject.kt") + public void testLongCompanionObject() throws Exception { + runTest("compiler/testData/codegen/box/objects/companionObjectAccess/primitiveCompanion/longCompanionObject.kt"); + } + + @TestMetadata("shortCompanionObject.kt") + public void testShortCompanionObject() throws Exception { + runTest("compiler/testData/codegen/box/objects/companionObjectAccess/primitiveCompanion/shortCompanionObject.kt"); + } + } } } diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrBlackBoxCodegenTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrBlackBoxCodegenTestGenerated.java index 4eaa9439136..df969802f87 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrBlackBoxCodegenTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrBlackBoxCodegenTestGenerated.java @@ -14631,6 +14631,54 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes public void testProtectedCompanionObjectAccessedFromNestedClass() throws Exception { runTest("compiler/testData/codegen/box/objects/companionObjectAccess/protectedCompanionObjectAccessedFromNestedClass.kt"); } + + @TestMetadata("compiler/testData/codegen/box/objects/companionObjectAccess/primitiveCompanion") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class PrimitiveCompanion extends AbstractIrBlackBoxCodegenTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + } + + public void testAllFilesPresentInPrimitiveCompanion() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/objects/companionObjectAccess/primitiveCompanion"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM_IR, true); + } + + @TestMetadata("byteCompanionObject.kt") + public void testByteCompanionObject() throws Exception { + runTest("compiler/testData/codegen/box/objects/companionObjectAccess/primitiveCompanion/byteCompanionObject.kt"); + } + + @TestMetadata("charCompanionObject.kt") + public void testCharCompanionObject() throws Exception { + runTest("compiler/testData/codegen/box/objects/companionObjectAccess/primitiveCompanion/charCompanionObject.kt"); + } + + @TestMetadata("doubleCompanionObject.kt") + public void testDoubleCompanionObject() throws Exception { + runTest("compiler/testData/codegen/box/objects/companionObjectAccess/primitiveCompanion/doubleCompanionObject.kt"); + } + + @TestMetadata("floatCompanionObject.kt") + public void testFloatCompanionObject() throws Exception { + runTest("compiler/testData/codegen/box/objects/companionObjectAccess/primitiveCompanion/floatCompanionObject.kt"); + } + + @TestMetadata("intCompanionObject.kt") + public void testIntCompanionObject() throws Exception { + runTest("compiler/testData/codegen/box/objects/companionObjectAccess/primitiveCompanion/intCompanionObject.kt"); + } + + @TestMetadata("longCompanionObject.kt") + public void testLongCompanionObject() throws Exception { + runTest("compiler/testData/codegen/box/objects/companionObjectAccess/primitiveCompanion/longCompanionObject.kt"); + } + + @TestMetadata("shortCompanionObject.kt") + public void testShortCompanionObject() throws Exception { + runTest("compiler/testData/codegen/box/objects/companionObjectAccess/primitiveCompanion/shortCompanionObject.kt"); + } + } } } 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 fd875bf6cdc..c0fd18f91ac 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 @@ -12841,6 +12841,54 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest { public void testProtectedCompanionObjectAccessedFromNestedClass() throws Exception { runTest("compiler/testData/codegen/box/objects/companionObjectAccess/protectedCompanionObjectAccessedFromNestedClass.kt"); } + + @TestMetadata("compiler/testData/codegen/box/objects/companionObjectAccess/primitiveCompanion") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class PrimitiveCompanion extends AbstractIrJsCodegenBoxTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS_IR, testDataFilePath); + } + + public void testAllFilesPresentInPrimitiveCompanion() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/objects/companionObjectAccess/primitiveCompanion"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JS_IR, true); + } + + @TestMetadata("byteCompanionObject.kt") + public void testByteCompanionObject() throws Exception { + runTest("compiler/testData/codegen/box/objects/companionObjectAccess/primitiveCompanion/byteCompanionObject.kt"); + } + + @TestMetadata("charCompanionObject.kt") + public void testCharCompanionObject() throws Exception { + runTest("compiler/testData/codegen/box/objects/companionObjectAccess/primitiveCompanion/charCompanionObject.kt"); + } + + @TestMetadata("doubleCompanionObject.kt") + public void testDoubleCompanionObject() throws Exception { + runTest("compiler/testData/codegen/box/objects/companionObjectAccess/primitiveCompanion/doubleCompanionObject.kt"); + } + + @TestMetadata("floatCompanionObject.kt") + public void testFloatCompanionObject() throws Exception { + runTest("compiler/testData/codegen/box/objects/companionObjectAccess/primitiveCompanion/floatCompanionObject.kt"); + } + + @TestMetadata("intCompanionObject.kt") + public void testIntCompanionObject() throws Exception { + runTest("compiler/testData/codegen/box/objects/companionObjectAccess/primitiveCompanion/intCompanionObject.kt"); + } + + @TestMetadata("longCompanionObject.kt") + public void testLongCompanionObject() throws Exception { + runTest("compiler/testData/codegen/box/objects/companionObjectAccess/primitiveCompanion/longCompanionObject.kt"); + } + + @TestMetadata("shortCompanionObject.kt") + public void testShortCompanionObject() throws Exception { + runTest("compiler/testData/codegen/box/objects/companionObjectAccess/primitiveCompanion/shortCompanionObject.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 c2d94186a3c..4889ae0cc59 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 @@ -13901,6 +13901,54 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest { public void testProtectedCompanionObjectAccessedFromNestedClass() throws Exception { runTest("compiler/testData/codegen/box/objects/companionObjectAccess/protectedCompanionObjectAccessedFromNestedClass.kt"); } + + @TestMetadata("compiler/testData/codegen/box/objects/companionObjectAccess/primitiveCompanion") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class PrimitiveCompanion extends AbstractJsCodegenBoxTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS, testDataFilePath); + } + + public void testAllFilesPresentInPrimitiveCompanion() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/objects/companionObjectAccess/primitiveCompanion"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JS, true); + } + + @TestMetadata("byteCompanionObject.kt") + public void testByteCompanionObject() throws Exception { + runTest("compiler/testData/codegen/box/objects/companionObjectAccess/primitiveCompanion/byteCompanionObject.kt"); + } + + @TestMetadata("charCompanionObject.kt") + public void testCharCompanionObject() throws Exception { + runTest("compiler/testData/codegen/box/objects/companionObjectAccess/primitiveCompanion/charCompanionObject.kt"); + } + + @TestMetadata("doubleCompanionObject.kt") + public void testDoubleCompanionObject() throws Exception { + runTest("compiler/testData/codegen/box/objects/companionObjectAccess/primitiveCompanion/doubleCompanionObject.kt"); + } + + @TestMetadata("floatCompanionObject.kt") + public void testFloatCompanionObject() throws Exception { + runTest("compiler/testData/codegen/box/objects/companionObjectAccess/primitiveCompanion/floatCompanionObject.kt"); + } + + @TestMetadata("intCompanionObject.kt") + public void testIntCompanionObject() throws Exception { + runTest("compiler/testData/codegen/box/objects/companionObjectAccess/primitiveCompanion/intCompanionObject.kt"); + } + + @TestMetadata("longCompanionObject.kt") + public void testLongCompanionObject() throws Exception { + runTest("compiler/testData/codegen/box/objects/companionObjectAccess/primitiveCompanion/longCompanionObject.kt"); + } + + @TestMetadata("shortCompanionObject.kt") + public void testShortCompanionObject() throws Exception { + runTest("compiler/testData/codegen/box/objects/companionObjectAccess/primitiveCompanion/shortCompanionObject.kt"); + } + } } } diff --git a/js/js.translator/testData/box/inlineStdlib/closure.kt b/js/js.translator/testData/box/inlineStdlib/closure.kt index b54c0de393a..a67171090ac 100644 --- a/js/js.translator/testData/box/inlineStdlib/closure.kt +++ b/js/js.translator/testData/box/inlineStdlib/closure.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND: JS_IR // EXPECTED_REACHABLE_NODES: 1115 package foo diff --git a/js/js.translator/testData/box/inlineStdlib/closureNested.kt b/js/js.translator/testData/box/inlineStdlib/closureNested.kt index aa4079a6684..2fe7b5addee 100644 --- a/js/js.translator/testData/box/inlineStdlib/closureNested.kt +++ b/js/js.translator/testData/box/inlineStdlib/closureNested.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND: JS_IR // EXPECTED_REACHABLE_NODES: 1115 package foo diff --git a/js/js.translator/testData/box/inlineStdlib/simple.kt b/js/js.translator/testData/box/inlineStdlib/simple.kt index dd2368162eb..dd391e3c3b2 100644 --- a/js/js.translator/testData/box/inlineStdlib/simple.kt +++ b/js/js.translator/testData/box/inlineStdlib/simple.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND: JS_IR // EXPECTED_REACHABLE_NODES: 1116 package foo diff --git a/js/js.translator/testData/box/range/numberRangesOptimized.kt b/js/js.translator/testData/box/range/numberRangesOptimized.kt index 35976b437d1..340f4c61dc5 100644 --- a/js/js.translator/testData/box/range/numberRangesOptimized.kt +++ b/js/js.translator/testData/box/range/numberRangesOptimized.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND: JS_IR // EXPECTED_REACHABLE_NODES: 1135 // CHECK_CONTAINS_NO_CALLS: inRange // CHECK_CONTAINS_NO_CALLS: inRange2