Tests: move diagnostic test to testsWithJvmBackend

There's a difference in behavior of K1 and K2 here, see KT-66528.

 #KT-66528
This commit is contained in:
Alexander Udalov
2024-03-12 15:09:34 +01:00
committed by Space Team
parent 81a9f5654e
commit c997e9f142
22 changed files with 166 additions and 34 deletions
@@ -21960,12 +21960,6 @@ public class DiagnosticCompilerTestFE10TestdataTestGenerated extends AbstractDia
runTest("compiler/testData/diagnostics/tests/j+k/kjkImplicitReturnType.kt");
}
@Test
@TestMetadata("kjkPropertyAndExtensionProperty.kt")
public void testKjkPropertyAndExtensionProperty() {
runTest("compiler/testData/diagnostics/tests/j+k/kjkPropertyAndExtensionProperty.kt");
}
@Test
@TestMetadata("kjkRawTypeWithKotlinUpperBound.kt")
public void testKjkRawTypeWithKotlinUpperBound() {
@@ -33552,6 +33552,12 @@ public class LLFirBlackBoxCodegenBasedTestGenerated extends AbstractLLFirBlackBo
runTest("compiler/testData/codegen/box/javaInterop/javaTypeFromSameModuleWithRawTypedWildcardBound.kt");
}
@Test
@TestMetadata("kjkPropertyAndExtensionProperty.kt")
public void testKjkPropertyAndExtensionProperty() {
runTest("compiler/testData/codegen/box/javaInterop/kjkPropertyAndExtensionProperty.kt");
}
@Test
@TestMetadata("kjkWithRawTypes.kt")
public void testKjkWithRawTypes() {
@@ -21960,12 +21960,6 @@ public class LLFirPreresolvedReversedDiagnosticCompilerFE10TestDataTestGenerated
runTest("compiler/testData/diagnostics/tests/j+k/kjkImplicitReturnType.kt");
}
@Test
@TestMetadata("kjkPropertyAndExtensionProperty.kt")
public void testKjkPropertyAndExtensionProperty() {
runTest("compiler/testData/diagnostics/tests/j+k/kjkPropertyAndExtensionProperty.kt");
}
@Test
@TestMetadata("kjkRawTypeWithKotlinUpperBound.kt")
public void testKjkRawTypeWithKotlinUpperBound() {
@@ -33552,6 +33552,12 @@ public class LLFirReversedBlackBoxCodegenBasedTestGenerated extends AbstractLLFi
runTest("compiler/testData/codegen/box/javaInterop/javaTypeFromSameModuleWithRawTypedWildcardBound.kt");
}
@Test
@TestMetadata("kjkPropertyAndExtensionProperty.kt")
public void testKjkPropertyAndExtensionProperty() {
runTest("compiler/testData/codegen/box/javaInterop/kjkPropertyAndExtensionProperty.kt");
}
@Test
@TestMetadata("kjkWithRawTypes.kt")
public void testKjkWithRawTypes() {
@@ -21954,12 +21954,6 @@ public class FirLightTreeOldFrontendDiagnosticsTestGenerated extends AbstractFir
runTest("compiler/testData/diagnostics/tests/j+k/kjkImplicitReturnType.kt");
}
@Test
@TestMetadata("kjkPropertyAndExtensionProperty.kt")
public void testKjkPropertyAndExtensionProperty() {
runTest("compiler/testData/diagnostics/tests/j+k/kjkPropertyAndExtensionProperty.kt");
}
@Test
@TestMetadata("kjkRawTypeWithKotlinUpperBound.kt")
public void testKjkRawTypeWithKotlinUpperBound() {
@@ -21960,12 +21960,6 @@ public class FirPsiOldFrontendDiagnosticsTestGenerated extends AbstractFirPsiDia
runTest("compiler/testData/diagnostics/tests/j+k/kjkImplicitReturnType.kt");
}
@Test
@TestMetadata("kjkPropertyAndExtensionProperty.kt")
public void testKjkPropertyAndExtensionProperty() {
runTest("compiler/testData/diagnostics/tests/j+k/kjkPropertyAndExtensionProperty.kt");
}
@Test
@TestMetadata("kjkRawTypeWithKotlinUpperBound.kt")
public void testKjkRawTypeWithKotlinUpperBound() {
@@ -544,6 +544,12 @@ public class FirLightTreeDiagnosticsTestWithJvmIrBackendGenerated extends Abstra
runTest("compiler/testData/diagnostics/testsWithJvmBackend/duplicateJvmSignature/javaInterop/inheritFromJavaCollectionSubclassWithContainsOverload.kt");
}
@Test
@TestMetadata("kjkPropertyAndExtensionProperty.kt")
public void testKjkPropertyAndExtensionProperty() {
runTest("compiler/testData/diagnostics/testsWithJvmBackend/duplicateJvmSignature/javaInterop/kjkPropertyAndExtensionProperty.kt");
}
@Test
@TestMetadata("supertypeDifferentParameterNullability.kt")
public void testSupertypeDifferentParameterNullability() {
@@ -544,6 +544,12 @@ public class FirPsiDiagnosticsTestWithJvmIrBackendGenerated extends AbstractFirP
runTest("compiler/testData/diagnostics/testsWithJvmBackend/duplicateJvmSignature/javaInterop/inheritFromJavaCollectionSubclassWithContainsOverload.kt");
}
@Test
@TestMetadata("kjkPropertyAndExtensionProperty.kt")
public void testKjkPropertyAndExtensionProperty() {
runTest("compiler/testData/diagnostics/testsWithJvmBackend/duplicateJvmSignature/javaInterop/kjkPropertyAndExtensionProperty.kt");
}
@Test
@TestMetadata("supertypeDifferentParameterNullability.kt")
public void testSupertypeDifferentParameterNullability() {
@@ -33421,6 +33421,12 @@ public class FirLightTreeBlackBoxCodegenTestGenerated extends AbstractFirLightTr
runTest("compiler/testData/codegen/box/javaInterop/javaTypeFromSameModuleWithRawTypedWildcardBound.kt");
}
@Test
@TestMetadata("kjkPropertyAndExtensionProperty.kt")
public void testKjkPropertyAndExtensionProperty() {
runTest("compiler/testData/codegen/box/javaInterop/kjkPropertyAndExtensionProperty.kt");
}
@Test
@TestMetadata("kjkWithRawTypes.kt")
public void testKjkWithRawTypes() {
@@ -33421,6 +33421,12 @@ public class FirLightTreeBlackBoxCodegenWithFir2IrFakeOverrideGeneratorTestGener
runTest("compiler/testData/codegen/box/javaInterop/javaTypeFromSameModuleWithRawTypedWildcardBound.kt");
}
@Test
@TestMetadata("kjkPropertyAndExtensionProperty.kt")
public void testKjkPropertyAndExtensionProperty() {
runTest("compiler/testData/codegen/box/javaInterop/kjkPropertyAndExtensionProperty.kt");
}
@Test
@TestMetadata("kjkWithRawTypes.kt")
public void testKjkWithRawTypes() {
@@ -33421,6 +33421,12 @@ public class FirPsiBlackBoxCodegenTestGenerated extends AbstractFirPsiBlackBoxCo
runTest("compiler/testData/codegen/box/javaInterop/javaTypeFromSameModuleWithRawTypedWildcardBound.kt");
}
@Test
@TestMetadata("kjkPropertyAndExtensionProperty.kt")
public void testKjkPropertyAndExtensionProperty() {
runTest("compiler/testData/codegen/box/javaInterop/kjkPropertyAndExtensionProperty.kt");
}
@Test
@TestMetadata("kjkWithRawTypes.kt")
public void testKjkWithRawTypes() {
@@ -0,0 +1,79 @@
// TARGET_BACKEND: JVM
// IGNORE_BACKEND_K1: JVM, JVM_IR
// FILE: J.java
public class J extends D {}
// FILE: JOverridesRegular.java
public class JOverridesRegular extends D {
@Override
public int getA() {
return 1;
}
}
// FILE: JOverridesExtension.java
public class JOverridesExtension extends D {
@Override
public int getA(String $this) {
return 1;
}
}
// FILE: JOVerridesBoth.java
public class JOVerridesBoth extends D {
@Override
public int getA() {
return 1;
}
@Override
public int getA(String $this) {
return 1;
}
}
// FILE: 1.kt
open class D {
open val a: Int
get() = 2
open val String.a: Int
get() = 1
}
class F : J() {
fun test() {
a
"".a
}
}
class F2 : JOverridesRegular() {
fun test() {
a
"".a
}
}
class F3 : JOverridesExtension() {
fun test() {
a
"".a
}
}
class F4 : JOVerridesBoth() {
fun test() {
a
"".a
}
}
fun box(): String {
F().test()
F2().test()
F3().test()
F4().test()
return "OK"
}
@@ -55,16 +55,16 @@ class F2 : JOverridesRegular() {
}
}
class <!CONFLICTING_INHERITED_JVM_DECLARATIONS!>F3<!> : JOverridesExtension() {
<!CONFLICTING_INHERITED_JVM_DECLARATIONS!>class F3 : JOverridesExtension() {
fun test() {
a
"".a
}
}
}<!>
class <!CONFLICTING_INHERITED_JVM_DECLARATIONS!>F4<!> : JOVerridesBoth() {
<!CONFLICTING_INHERITED_JVM_DECLARATIONS!>class F4 : JOVerridesBoth() {
fun test() {
a
"".a
}
}
}<!>
@@ -21960,12 +21960,6 @@ public class DiagnosticTestGenerated extends AbstractDiagnosticTest {
runTest("compiler/testData/diagnostics/tests/j+k/kjkImplicitReturnType.kt");
}
@Test
@TestMetadata("kjkPropertyAndExtensionProperty.kt")
public void testKjkPropertyAndExtensionProperty() {
runTest("compiler/testData/diagnostics/tests/j+k/kjkPropertyAndExtensionProperty.kt");
}
@Test
@TestMetadata("kjkRawTypeWithKotlinUpperBound.kt")
public void testKjkRawTypeWithKotlinUpperBound() {
@@ -545,6 +545,12 @@ public class DiagnosticsTestWithJvmIrBackendGenerated extends AbstractDiagnostic
runTest("compiler/testData/diagnostics/testsWithJvmBackend/duplicateJvmSignature/javaInterop/inheritFromJavaCollectionSubclassWithContainsOverload.kt");
}
@Test
@TestMetadata("kjkPropertyAndExtensionProperty.kt")
public void testKjkPropertyAndExtensionProperty() {
runTest("compiler/testData/diagnostics/testsWithJvmBackend/duplicateJvmSignature/javaInterop/kjkPropertyAndExtensionProperty.kt");
}
@Test
@TestMetadata("supertypeDifferentParameterNullability.kt")
public void testSupertypeDifferentParameterNullability() {
@@ -33421,6 +33421,12 @@ public class JvmAbiConsistencyTestBoxGenerated extends AbstractJvmAbiConsistency
runTest("compiler/testData/codegen/box/javaInterop/javaTypeFromSameModuleWithRawTypedWildcardBound.kt");
}
@Test
@TestMetadata("kjkPropertyAndExtensionProperty.kt")
public void testKjkPropertyAndExtensionProperty() {
runTest("compiler/testData/codegen/box/javaInterop/kjkPropertyAndExtensionProperty.kt");
}
@Test
@TestMetadata("kjkWithRawTypes.kt")
public void testKjkWithRawTypes() {
@@ -31543,6 +31543,12 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
runTest("compiler/testData/codegen/box/javaInterop/javaOuterClassDependsOnInner.kt");
}
@Test
@TestMetadata("kjkPropertyAndExtensionProperty.kt")
public void testKjkPropertyAndExtensionProperty() {
runTest("compiler/testData/codegen/box/javaInterop/kjkPropertyAndExtensionProperty.kt");
}
@Test
@TestMetadata("kt43217.kt")
public void testKt43217() {
@@ -33421,6 +33421,12 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes
runTest("compiler/testData/codegen/box/javaInterop/javaTypeFromSameModuleWithRawTypedWildcardBound.kt");
}
@Test
@TestMetadata("kjkPropertyAndExtensionProperty.kt")
public void testKjkPropertyAndExtensionProperty() {
runTest("compiler/testData/codegen/box/javaInterop/kjkPropertyAndExtensionProperty.kt");
}
@Test
@TestMetadata("kjkWithRawTypes.kt")
public void testKjkWithRawTypes() {
@@ -33421,6 +33421,12 @@ public class IrBlackBoxCodegenWithIrInlinerTestGenerated extends AbstractIrBlack
runTest("compiler/testData/codegen/box/javaInterop/javaTypeFromSameModuleWithRawTypedWildcardBound.kt");
}
@Test
@TestMetadata("kjkPropertyAndExtensionProperty.kt")
public void testKjkPropertyAndExtensionProperty() {
runTest("compiler/testData/codegen/box/javaInterop/kjkPropertyAndExtensionProperty.kt");
}
@Test
@TestMetadata("kjkWithRawTypes.kt")
public void testKjkWithRawTypes() {
@@ -33421,6 +33421,12 @@ public class FirBlackBoxCodegenTestWithInlineScopesGenerated extends AbstractFir
runTest("compiler/testData/codegen/box/javaInterop/javaTypeFromSameModuleWithRawTypedWildcardBound.kt");
}
@Test
@TestMetadata("kjkPropertyAndExtensionProperty.kt")
public void testKjkPropertyAndExtensionProperty() {
runTest("compiler/testData/codegen/box/javaInterop/kjkPropertyAndExtensionProperty.kt");
}
@Test
@TestMetadata("kjkWithRawTypes.kt")
public void testKjkWithRawTypes() {
@@ -28241,6 +28241,11 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes
runTest("compiler/testData/codegen/box/javaInterop/invisibleFake2.kt");
}
@TestMetadata("kjkPropertyAndExtensionProperty.kt")
public void ignoreKjkPropertyAndExtensionProperty() {
runTest("compiler/testData/codegen/box/javaInterop/kjkPropertyAndExtensionProperty.kt");
}
private void runTest(String testDataFilePath) {
KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath);
}