From 2fca7f1a5448280c86cb57a313bcfb420f5fbe73 Mon Sep 17 00:00:00 2001 From: Alexander Udalov Date: Wed, 22 Jan 2020 15:58:49 +0100 Subject: [PATCH] Add codegen tests for old behavior of null checks #KT-22275 --- .../exclExclThrowsKnpe_1_3.kt | 15 +++++++++ ...lThrowsNpe_1_4.kt => exclExclThrowsNpe.kt} | 1 - .../javaNullCheckThrowsIse_1_3.kt | 23 +++++++++++++ ...wsNpe_1_4.kt => javaNullCheckThrowsNpe.kt} | 1 - .../parameterNullCheckThrowsIae_1_3.kt | 26 +++++++++++++++ ..._1_4.kt => parameterNullCheckThrowsNpe.kt} | 1 - .../nullChecks/parameterNullCheck_1_4.kt | 16 --------- .../codegen/BlackBoxCodegenTestGenerated.java | 33 ++++++++++++++----- .../BlackBoxInlineCodegenTestGenerated.java | 18 ---------- ...otlinAgainstInlineKotlinTestGenerated.java | 18 ---------- .../LightAnalysisModeTestGenerated.java | 33 ++++++++++++++----- .../ir/FirBlackBoxCodegenTestGenerated.java | 33 ++++++++++++++----- .../ir/IrBlackBoxCodegenTestGenerated.java | 33 ++++++++++++++----- .../IrBlackBoxInlineCodegenTestGenerated.java | 18 ---------- ...otlinAgainstInlineKotlinTestGenerated.java | 18 ---------- 15 files changed, 160 insertions(+), 127 deletions(-) create mode 100644 compiler/testData/codegen/box/nullCheckOptimization/exclExclThrowsKnpe_1_3.kt rename compiler/testData/codegen/box/nullCheckOptimization/{exclExclThrowsNpe_1_4.kt => exclExclThrowsNpe.kt} (93%) create mode 100644 compiler/testData/codegen/box/nullCheckOptimization/javaNullCheckThrowsIse_1_3.kt rename compiler/testData/codegen/box/nullCheckOptimization/{javaNullCheckThrowsNpe_1_4.kt => javaNullCheckThrowsNpe.kt} (95%) create mode 100644 compiler/testData/codegen/box/nullCheckOptimization/parameterNullCheckThrowsIae_1_3.kt rename compiler/testData/codegen/box/nullCheckOptimization/{parameterNullCheckThrowsNpe_1_4.kt => parameterNullCheckThrowsNpe.kt} (95%) delete mode 100644 compiler/testData/codegen/boxInline/nullChecks/parameterNullCheck_1_4.kt diff --git a/compiler/testData/codegen/box/nullCheckOptimization/exclExclThrowsKnpe_1_3.kt b/compiler/testData/codegen/box/nullCheckOptimization/exclExclThrowsKnpe_1_3.kt new file mode 100644 index 00000000000..2f5a0d0bec3 --- /dev/null +++ b/compiler/testData/codegen/box/nullCheckOptimization/exclExclThrowsKnpe_1_3.kt @@ -0,0 +1,15 @@ +// !API_VERSION: 1.3 +// WITH_RUNTIME +// IGNORE_BACKEND_FIR: JVM_IR +// TARGET_BACKEND: JVM + +fun box(): String { + val s: String? = null + try { + s!! + return "Fail: KNPE should have been thrown" + } catch (e: Throwable) { + if (e::class != KotlinNullPointerException::class) return "Fail: exception class should be KNPE: ${e::class}" + return "OK" + } +} diff --git a/compiler/testData/codegen/box/nullCheckOptimization/exclExclThrowsNpe_1_4.kt b/compiler/testData/codegen/box/nullCheckOptimization/exclExclThrowsNpe.kt similarity index 93% rename from compiler/testData/codegen/box/nullCheckOptimization/exclExclThrowsNpe_1_4.kt rename to compiler/testData/codegen/box/nullCheckOptimization/exclExclThrowsNpe.kt index ff0072fe340..73d4e6f3539 100644 --- a/compiler/testData/codegen/box/nullCheckOptimization/exclExclThrowsNpe_1_4.kt +++ b/compiler/testData/codegen/box/nullCheckOptimization/exclExclThrowsNpe.kt @@ -1,4 +1,3 @@ -// !API_VERSION: LATEST // IGNORE_BACKEND_FIR: JVM_IR // TARGET_BACKEND: JVM diff --git a/compiler/testData/codegen/box/nullCheckOptimization/javaNullCheckThrowsIse_1_3.kt b/compiler/testData/codegen/box/nullCheckOptimization/javaNullCheckThrowsIse_1_3.kt new file mode 100644 index 00000000000..48bf292116f --- /dev/null +++ b/compiler/testData/codegen/box/nullCheckOptimization/javaNullCheckThrowsIse_1_3.kt @@ -0,0 +1,23 @@ +// !API_VERSION: 1.3 +// IGNORE_BACKEND_FIR: JVM_IR +// TARGET_BACKEND: JVM +// FILE: A.java + +import org.jetbrains.annotations.NotNull; + +public class A { + @NotNull + public static String foo() { return null; } +} + +// FILE: test.kt + +fun box(): String { + try { + val s: String = A.foo() + return "Fail: ISE should have been thrown" + } catch (e: Throwable) { + if (e::class != IllegalStateException::class) return "Fail: exception class should be ISE: ${e::class}" + return "OK" + } +} diff --git a/compiler/testData/codegen/box/nullCheckOptimization/javaNullCheckThrowsNpe_1_4.kt b/compiler/testData/codegen/box/nullCheckOptimization/javaNullCheckThrowsNpe.kt similarity index 95% rename from compiler/testData/codegen/box/nullCheckOptimization/javaNullCheckThrowsNpe_1_4.kt rename to compiler/testData/codegen/box/nullCheckOptimization/javaNullCheckThrowsNpe.kt index afc82eb35da..5617fcf88c9 100644 --- a/compiler/testData/codegen/box/nullCheckOptimization/javaNullCheckThrowsNpe_1_4.kt +++ b/compiler/testData/codegen/box/nullCheckOptimization/javaNullCheckThrowsNpe.kt @@ -1,4 +1,3 @@ -// !API_VERSION: LATEST // IGNORE_BACKEND_FIR: JVM_IR // TARGET_BACKEND: JVM // FILE: A.java diff --git a/compiler/testData/codegen/box/nullCheckOptimization/parameterNullCheckThrowsIae_1_3.kt b/compiler/testData/codegen/box/nullCheckOptimization/parameterNullCheckThrowsIae_1_3.kt new file mode 100644 index 00000000000..8f822d7bc9a --- /dev/null +++ b/compiler/testData/codegen/box/nullCheckOptimization/parameterNullCheckThrowsIae_1_3.kt @@ -0,0 +1,26 @@ +// !API_VERSION: 1.3 +// IGNORE_BACKEND_FIR: JVM_IR +// TARGET_BACKEND: JVM +// FILE: A.java + +public class A { + public static void test() { + new B().foo(null); + } +} + +// FILE: test.kt + +class B { + fun foo(s: String) {} +} + +fun box(): String { + try { + A.test() + return "Fail: IAE should have been thrown" + } catch (e: Throwable) { + if (e::class != IllegalArgumentException::class) return "Fail: exception class should be IAE: ${e::class}" + return "OK" + } +} diff --git a/compiler/testData/codegen/box/nullCheckOptimization/parameterNullCheckThrowsNpe_1_4.kt b/compiler/testData/codegen/box/nullCheckOptimization/parameterNullCheckThrowsNpe.kt similarity index 95% rename from compiler/testData/codegen/box/nullCheckOptimization/parameterNullCheckThrowsNpe_1_4.kt rename to compiler/testData/codegen/box/nullCheckOptimization/parameterNullCheckThrowsNpe.kt index 5204ef9a3f9..300599cf3be 100644 --- a/compiler/testData/codegen/box/nullCheckOptimization/parameterNullCheckThrowsNpe_1_4.kt +++ b/compiler/testData/codegen/box/nullCheckOptimization/parameterNullCheckThrowsNpe.kt @@ -1,4 +1,3 @@ -// !API_VERSION: LATEST // IGNORE_BACKEND_FIR: JVM_IR // TARGET_BACKEND: JVM // FILE: A.java diff --git a/compiler/testData/codegen/boxInline/nullChecks/parameterNullCheck_1_4.kt b/compiler/testData/codegen/boxInline/nullChecks/parameterNullCheck_1_4.kt deleted file mode 100644 index ecb0094af99..00000000000 --- a/compiler/testData/codegen/boxInline/nullChecks/parameterNullCheck_1_4.kt +++ /dev/null @@ -1,16 +0,0 @@ -// !API_VERSION: LATEST -// FILE: 1.kt - -package test - -public inline fun doRun(block: () -> R): R { - return block() -} - -// FILE: 2.kt - -import test.* - -fun box(): String { - return doRun { "OK" } -} diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxCodegenTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxCodegenTestGenerated.java index f0cfbdbad9b..72173f33a57 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxCodegenTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxCodegenTestGenerated.java @@ -17305,9 +17305,14 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest { KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/nullCheckOptimization"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true); } - @TestMetadata("exclExclThrowsNpe_1_4.kt") - public void testExclExclThrowsNpe_1_4() throws Exception { - runTest("compiler/testData/codegen/box/nullCheckOptimization/exclExclThrowsNpe_1_4.kt"); + @TestMetadata("exclExclThrowsKnpe_1_3.kt") + public void testExclExclThrowsKnpe_1_3() throws Exception { + runTest("compiler/testData/codegen/box/nullCheckOptimization/exclExclThrowsKnpe_1_3.kt"); + } + + @TestMetadata("exclExclThrowsNpe.kt") + public void testExclExclThrowsNpe() throws Exception { + runTest("compiler/testData/codegen/box/nullCheckOptimization/exclExclThrowsNpe.kt"); } @TestMetadata("isNullable.kt") @@ -17315,9 +17320,14 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest { runTest("compiler/testData/codegen/box/nullCheckOptimization/isNullable.kt"); } - @TestMetadata("javaNullCheckThrowsNpe_1_4.kt") - public void testJavaNullCheckThrowsNpe_1_4() throws Exception { - runTest("compiler/testData/codegen/box/nullCheckOptimization/javaNullCheckThrowsNpe_1_4.kt"); + @TestMetadata("javaNullCheckThrowsIse_1_3.kt") + public void testJavaNullCheckThrowsIse_1_3() throws Exception { + runTest("compiler/testData/codegen/box/nullCheckOptimization/javaNullCheckThrowsIse_1_3.kt"); + } + + @TestMetadata("javaNullCheckThrowsNpe.kt") + public void testJavaNullCheckThrowsNpe() throws Exception { + runTest("compiler/testData/codegen/box/nullCheckOptimization/javaNullCheckThrowsNpe.kt"); } @TestMetadata("kt22410.kt") @@ -17330,9 +17340,14 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest { runTest("compiler/testData/codegen/box/nullCheckOptimization/kt7774.kt"); } - @TestMetadata("parameterNullCheckThrowsNpe_1_4.kt") - public void testParameterNullCheckThrowsNpe_1_4() throws Exception { - runTest("compiler/testData/codegen/box/nullCheckOptimization/parameterNullCheckThrowsNpe_1_4.kt"); + @TestMetadata("parameterNullCheckThrowsIae_1_3.kt") + public void testParameterNullCheckThrowsIae_1_3() throws Exception { + runTest("compiler/testData/codegen/box/nullCheckOptimization/parameterNullCheckThrowsIae_1_3.kt"); + } + + @TestMetadata("parameterNullCheckThrowsNpe.kt") + public void testParameterNullCheckThrowsNpe() throws Exception { + runTest("compiler/testData/codegen/box/nullCheckOptimization/parameterNullCheckThrowsNpe.kt"); } @TestMetadata("primitiveCheckWithSideEffect.kt") diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxInlineCodegenTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxInlineCodegenTestGenerated.java index 48acede9975..7ef1b838f2f 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxInlineCodegenTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxInlineCodegenTestGenerated.java @@ -2591,24 +2591,6 @@ public class BlackBoxInlineCodegenTestGenerated extends AbstractBlackBoxInlineCo } } - @TestMetadata("compiler/testData/codegen/boxInline/nullChecks") - @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class NullChecks extends AbstractBlackBoxInlineCodegenTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); - } - - public void testAllFilesPresentInNullChecks() throws Exception { - KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/boxInline/nullChecks"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true); - } - - @TestMetadata("parameterNullCheck_1_4.kt") - public void testParameterNullCheck_1_4() throws Exception { - runTest("compiler/testData/codegen/boxInline/nullChecks/parameterNullCheck_1_4.kt"); - } - } - @TestMetadata("compiler/testData/codegen/boxInline/optimizations") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/CompileKotlinAgainstInlineKotlinTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/codegen/CompileKotlinAgainstInlineKotlinTestGenerated.java index 3520d9a146a..cc94277b152 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/CompileKotlinAgainstInlineKotlinTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/CompileKotlinAgainstInlineKotlinTestGenerated.java @@ -2591,24 +2591,6 @@ public class CompileKotlinAgainstInlineKotlinTestGenerated extends AbstractCompi } } - @TestMetadata("compiler/testData/codegen/boxInline/nullChecks") - @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class NullChecks extends AbstractCompileKotlinAgainstInlineKotlinTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTestWithCustomIgnoreDirective(this::doTest, TargetBackend.JVM, testDataFilePath, "// IGNORE_BACKEND_MULTI_MODULE: "); - } - - public void testAllFilesPresentInNullChecks() throws Exception { - KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/boxInline/nullChecks"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true); - } - - @TestMetadata("parameterNullCheck_1_4.kt") - public void testParameterNullCheck_1_4() throws Exception { - runTest("compiler/testData/codegen/boxInline/nullChecks/parameterNullCheck_1_4.kt"); - } - } - @TestMetadata("compiler/testData/codegen/boxInline/optimizations") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java index f0e3b645947..0186f9a7873 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java @@ -17305,9 +17305,14 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/nullCheckOptimization"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true); } - @TestMetadata("exclExclThrowsNpe_1_4.kt") - public void testExclExclThrowsNpe_1_4() throws Exception { - runTest("compiler/testData/codegen/box/nullCheckOptimization/exclExclThrowsNpe_1_4.kt"); + @TestMetadata("exclExclThrowsKnpe_1_3.kt") + public void testExclExclThrowsKnpe_1_3() throws Exception { + runTest("compiler/testData/codegen/box/nullCheckOptimization/exclExclThrowsKnpe_1_3.kt"); + } + + @TestMetadata("exclExclThrowsNpe.kt") + public void testExclExclThrowsNpe() throws Exception { + runTest("compiler/testData/codegen/box/nullCheckOptimization/exclExclThrowsNpe.kt"); } @TestMetadata("isNullable.kt") @@ -17315,9 +17320,14 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes runTest("compiler/testData/codegen/box/nullCheckOptimization/isNullable.kt"); } - @TestMetadata("javaNullCheckThrowsNpe_1_4.kt") - public void testJavaNullCheckThrowsNpe_1_4() throws Exception { - runTest("compiler/testData/codegen/box/nullCheckOptimization/javaNullCheckThrowsNpe_1_4.kt"); + @TestMetadata("javaNullCheckThrowsIse_1_3.kt") + public void testJavaNullCheckThrowsIse_1_3() throws Exception { + runTest("compiler/testData/codegen/box/nullCheckOptimization/javaNullCheckThrowsIse_1_3.kt"); + } + + @TestMetadata("javaNullCheckThrowsNpe.kt") + public void testJavaNullCheckThrowsNpe() throws Exception { + runTest("compiler/testData/codegen/box/nullCheckOptimization/javaNullCheckThrowsNpe.kt"); } @TestMetadata("kt22410.kt") @@ -17330,9 +17340,14 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes runTest("compiler/testData/codegen/box/nullCheckOptimization/kt7774.kt"); } - @TestMetadata("parameterNullCheckThrowsNpe_1_4.kt") - public void testParameterNullCheckThrowsNpe_1_4() throws Exception { - runTest("compiler/testData/codegen/box/nullCheckOptimization/parameterNullCheckThrowsNpe_1_4.kt"); + @TestMetadata("parameterNullCheckThrowsIae_1_3.kt") + public void testParameterNullCheckThrowsIae_1_3() throws Exception { + runTest("compiler/testData/codegen/box/nullCheckOptimization/parameterNullCheckThrowsIae_1_3.kt"); + } + + @TestMetadata("parameterNullCheckThrowsNpe.kt") + public void testParameterNullCheckThrowsNpe() throws Exception { + runTest("compiler/testData/codegen/box/nullCheckOptimization/parameterNullCheckThrowsNpe.kt"); } @TestMetadata("primitiveCheckWithSideEffect.kt") diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/ir/FirBlackBoxCodegenTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/codegen/ir/FirBlackBoxCodegenTestGenerated.java index dd44a452ab7..41ad0caec4e 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/ir/FirBlackBoxCodegenTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/ir/FirBlackBoxCodegenTestGenerated.java @@ -16150,9 +16150,14 @@ public class FirBlackBoxCodegenTestGenerated extends AbstractFirBlackBoxCodegenT KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/nullCheckOptimization"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); } - @TestMetadata("exclExclThrowsNpe_1_4.kt") - public void testExclExclThrowsNpe_1_4() throws Exception { - runTest("compiler/testData/codegen/box/nullCheckOptimization/exclExclThrowsNpe_1_4.kt"); + @TestMetadata("exclExclThrowsKnpe_1_3.kt") + public void testExclExclThrowsKnpe_1_3() throws Exception { + runTest("compiler/testData/codegen/box/nullCheckOptimization/exclExclThrowsKnpe_1_3.kt"); + } + + @TestMetadata("exclExclThrowsNpe.kt") + public void testExclExclThrowsNpe() throws Exception { + runTest("compiler/testData/codegen/box/nullCheckOptimization/exclExclThrowsNpe.kt"); } @TestMetadata("isNullable.kt") @@ -16160,9 +16165,14 @@ public class FirBlackBoxCodegenTestGenerated extends AbstractFirBlackBoxCodegenT runTest("compiler/testData/codegen/box/nullCheckOptimization/isNullable.kt"); } - @TestMetadata("javaNullCheckThrowsNpe_1_4.kt") - public void testJavaNullCheckThrowsNpe_1_4() throws Exception { - runTest("compiler/testData/codegen/box/nullCheckOptimization/javaNullCheckThrowsNpe_1_4.kt"); + @TestMetadata("javaNullCheckThrowsIse_1_3.kt") + public void testJavaNullCheckThrowsIse_1_3() throws Exception { + runTest("compiler/testData/codegen/box/nullCheckOptimization/javaNullCheckThrowsIse_1_3.kt"); + } + + @TestMetadata("javaNullCheckThrowsNpe.kt") + public void testJavaNullCheckThrowsNpe() throws Exception { + runTest("compiler/testData/codegen/box/nullCheckOptimization/javaNullCheckThrowsNpe.kt"); } @TestMetadata("kt22410.kt") @@ -16175,9 +16185,14 @@ public class FirBlackBoxCodegenTestGenerated extends AbstractFirBlackBoxCodegenT runTest("compiler/testData/codegen/box/nullCheckOptimization/kt7774.kt"); } - @TestMetadata("parameterNullCheckThrowsNpe_1_4.kt") - public void testParameterNullCheckThrowsNpe_1_4() throws Exception { - runTest("compiler/testData/codegen/box/nullCheckOptimization/parameterNullCheckThrowsNpe_1_4.kt"); + @TestMetadata("parameterNullCheckThrowsIae_1_3.kt") + public void testParameterNullCheckThrowsIae_1_3() throws Exception { + runTest("compiler/testData/codegen/box/nullCheckOptimization/parameterNullCheckThrowsIae_1_3.kt"); + } + + @TestMetadata("parameterNullCheckThrowsNpe.kt") + public void testParameterNullCheckThrowsNpe() throws Exception { + runTest("compiler/testData/codegen/box/nullCheckOptimization/parameterNullCheckThrowsNpe.kt"); } @TestMetadata("primitiveCheckWithSideEffect.kt") diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrBlackBoxCodegenTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrBlackBoxCodegenTestGenerated.java index f30f8a3daad..99d70add9cf 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrBlackBoxCodegenTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrBlackBoxCodegenTestGenerated.java @@ -16150,9 +16150,14 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/nullCheckOptimization"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); } - @TestMetadata("exclExclThrowsNpe_1_4.kt") - public void testExclExclThrowsNpe_1_4() throws Exception { - runTest("compiler/testData/codegen/box/nullCheckOptimization/exclExclThrowsNpe_1_4.kt"); + @TestMetadata("exclExclThrowsKnpe_1_3.kt") + public void testExclExclThrowsKnpe_1_3() throws Exception { + runTest("compiler/testData/codegen/box/nullCheckOptimization/exclExclThrowsKnpe_1_3.kt"); + } + + @TestMetadata("exclExclThrowsNpe.kt") + public void testExclExclThrowsNpe() throws Exception { + runTest("compiler/testData/codegen/box/nullCheckOptimization/exclExclThrowsNpe.kt"); } @TestMetadata("isNullable.kt") @@ -16160,9 +16165,14 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes runTest("compiler/testData/codegen/box/nullCheckOptimization/isNullable.kt"); } - @TestMetadata("javaNullCheckThrowsNpe_1_4.kt") - public void testJavaNullCheckThrowsNpe_1_4() throws Exception { - runTest("compiler/testData/codegen/box/nullCheckOptimization/javaNullCheckThrowsNpe_1_4.kt"); + @TestMetadata("javaNullCheckThrowsIse_1_3.kt") + public void testJavaNullCheckThrowsIse_1_3() throws Exception { + runTest("compiler/testData/codegen/box/nullCheckOptimization/javaNullCheckThrowsIse_1_3.kt"); + } + + @TestMetadata("javaNullCheckThrowsNpe.kt") + public void testJavaNullCheckThrowsNpe() throws Exception { + runTest("compiler/testData/codegen/box/nullCheckOptimization/javaNullCheckThrowsNpe.kt"); } @TestMetadata("kt22410.kt") @@ -16175,9 +16185,14 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes runTest("compiler/testData/codegen/box/nullCheckOptimization/kt7774.kt"); } - @TestMetadata("parameterNullCheckThrowsNpe_1_4.kt") - public void testParameterNullCheckThrowsNpe_1_4() throws Exception { - runTest("compiler/testData/codegen/box/nullCheckOptimization/parameterNullCheckThrowsNpe_1_4.kt"); + @TestMetadata("parameterNullCheckThrowsIae_1_3.kt") + public void testParameterNullCheckThrowsIae_1_3() throws Exception { + runTest("compiler/testData/codegen/box/nullCheckOptimization/parameterNullCheckThrowsIae_1_3.kt"); + } + + @TestMetadata("parameterNullCheckThrowsNpe.kt") + public void testParameterNullCheckThrowsNpe() throws Exception { + runTest("compiler/testData/codegen/box/nullCheckOptimization/parameterNullCheckThrowsNpe.kt"); } @TestMetadata("primitiveCheckWithSideEffect.kt") diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrBlackBoxInlineCodegenTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrBlackBoxInlineCodegenTestGenerated.java index 0ae113306b6..959fa904474 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrBlackBoxInlineCodegenTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrBlackBoxInlineCodegenTestGenerated.java @@ -2591,24 +2591,6 @@ public class IrBlackBoxInlineCodegenTestGenerated extends AbstractIrBlackBoxInli } } - @TestMetadata("compiler/testData/codegen/boxInline/nullChecks") - @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class NullChecks extends AbstractIrBlackBoxInlineCodegenTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); - } - - public void testAllFilesPresentInNullChecks() throws Exception { - KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/boxInline/nullChecks"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); - } - - @TestMetadata("parameterNullCheck_1_4.kt") - public void testParameterNullCheck_1_4() throws Exception { - runTest("compiler/testData/codegen/boxInline/nullChecks/parameterNullCheck_1_4.kt"); - } - } - @TestMetadata("compiler/testData/codegen/boxInline/optimizations") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrCompileKotlinAgainstInlineKotlinTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrCompileKotlinAgainstInlineKotlinTestGenerated.java index 0fe1a12ee31..a52444e35e0 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrCompileKotlinAgainstInlineKotlinTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrCompileKotlinAgainstInlineKotlinTestGenerated.java @@ -2591,24 +2591,6 @@ public class IrCompileKotlinAgainstInlineKotlinTestGenerated extends AbstractIrC } } - @TestMetadata("compiler/testData/codegen/boxInline/nullChecks") - @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class NullChecks extends AbstractIrCompileKotlinAgainstInlineKotlinTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTestWithCustomIgnoreDirective(this::doTest, TargetBackend.JVM_IR, testDataFilePath, "// IGNORE_BACKEND_MULTI_MODULE: "); - } - - public void testAllFilesPresentInNullChecks() throws Exception { - KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/boxInline/nullChecks"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); - } - - @TestMetadata("parameterNullCheck_1_4.kt") - public void testParameterNullCheck_1_4() throws Exception { - runTest("compiler/testData/codegen/boxInline/nullChecks/parameterNullCheck_1_4.kt"); - } - } - @TestMetadata("compiler/testData/codegen/boxInline/optimizations") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class)