Add tests for obsolete codegen issues

#KT-16790 Obsolete
 #KT-16858 Obsolete
 #KT-17441 Obsolete
This commit is contained in:
Alexander Udalov
2019-01-09 18:50:37 +01:00
parent 0bb97cf590
commit cca6ba38be
8 changed files with 100 additions and 0 deletions
@@ -0,0 +1,6 @@
open class A(val a: String, val b: Int)
fun box(): String {
val o = object : A(b = 2, a = "OK") {}
return o.a
}
@@ -0,0 +1,14 @@
// IGNORE_BACKEND: JVM_IR, JS_IR
fun WithCompanion.test(): String {
object : WithCompanion(this) {}
return "OK"
}
open class WithCompanion(a: WithCompanion.Companion) {
companion object
}
fun box(): String {
return WithCompanion(WithCompanion.Companion).test()
}
@@ -0,0 +1,15 @@
// TARGET_BACKEND: JVM
// IGNORE_BACKEND: JVM_IR
// SKIP_JDK6
// FULL_JDK
import java.util.function.Supplier
open class Base(val supplier: Supplier<Number>)
object Extended : Base(Supplier { 32 })
fun box(): String {
val blam = Extended
return if (blam.supplier.get() == 32) "OK" else "Fail"
}
@@ -13149,6 +13149,11 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
runTest("compiler/testData/codegen/box/innerNested/superConstructorCall/objectExtendsLocalWithClosure.kt");
}
@TestMetadata("objectExtendsLocal_kt16858.kt")
public void testObjectExtendsLocal_kt16858() throws Exception {
runTest("compiler/testData/codegen/box/innerNested/superConstructorCall/objectExtendsLocal_kt16858.kt");
}
@TestMetadata("objectOuterDiffersFromInnerOuter.kt")
public void testObjectOuterDiffersFromInnerOuter() throws Exception {
runTest("compiler/testData/codegen/box/innerNested/superConstructorCall/objectOuterDiffersFromInnerOuter.kt");
@@ -14880,6 +14885,11 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/localClasses"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM, true);
}
@TestMetadata("anonymousObjectInExtension.kt")
public void testAnonymousObjectInExtension() throws Exception {
runTest("compiler/testData/codegen/box/localClasses/anonymousObjectInExtension.kt");
}
@TestMetadata("anonymousObjectInInitializer.kt")
public void testAnonymousObjectInInitializer() throws Exception {
runTest("compiler/testData/codegen/box/localClasses/anonymousObjectInInitializer.kt");
@@ -22351,6 +22361,11 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
runTest("compiler/testData/codegen/box/sam/constructors/filenameFilter.kt");
}
@TestMetadata("kt16790.kt")
public void testKt16790() throws Exception {
runTest("compiler/testData/codegen/box/sam/constructors/kt16790.kt");
}
@TestMetadata("kt19251.kt")
public void testKt19251() throws Exception {
runTest("compiler/testData/codegen/box/sam/constructors/kt19251.kt");
@@ -13149,6 +13149,11 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes
runTest("compiler/testData/codegen/box/innerNested/superConstructorCall/objectExtendsLocalWithClosure.kt");
}
@TestMetadata("objectExtendsLocal_kt16858.kt")
public void testObjectExtendsLocal_kt16858() throws Exception {
runTest("compiler/testData/codegen/box/innerNested/superConstructorCall/objectExtendsLocal_kt16858.kt");
}
@TestMetadata("objectOuterDiffersFromInnerOuter.kt")
public void testObjectOuterDiffersFromInnerOuter() throws Exception {
runTest("compiler/testData/codegen/box/innerNested/superConstructorCall/objectOuterDiffersFromInnerOuter.kt");
@@ -14895,6 +14900,11 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/localClasses"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM, true);
}
@TestMetadata("anonymousObjectInExtension.kt")
public void testAnonymousObjectInExtension() throws Exception {
runTest("compiler/testData/codegen/box/localClasses/anonymousObjectInExtension.kt");
}
@TestMetadata("anonymousObjectInInitializer.kt")
public void testAnonymousObjectInInitializer() throws Exception {
runTest("compiler/testData/codegen/box/localClasses/anonymousObjectInInitializer.kt");
@@ -22351,6 +22361,11 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes
runTest("compiler/testData/codegen/box/sam/constructors/filenameFilter.kt");
}
@TestMetadata("kt16790.kt")
public void testKt16790() throws Exception {
runTest("compiler/testData/codegen/box/sam/constructors/kt16790.kt");
}
@TestMetadata("kt19251.kt")
public void testKt19251() throws Exception {
runTest("compiler/testData/codegen/box/sam/constructors/kt19251.kt");
@@ -13154,6 +13154,11 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes
runTest("compiler/testData/codegen/box/innerNested/superConstructorCall/objectExtendsLocalWithClosure.kt");
}
@TestMetadata("objectExtendsLocal_kt16858.kt")
public void testObjectExtendsLocal_kt16858() throws Exception {
runTest("compiler/testData/codegen/box/innerNested/superConstructorCall/objectExtendsLocal_kt16858.kt");
}
@TestMetadata("objectOuterDiffersFromInnerOuter.kt")
public void testObjectOuterDiffersFromInnerOuter() throws Exception {
runTest("compiler/testData/codegen/box/innerNested/superConstructorCall/objectOuterDiffersFromInnerOuter.kt");
@@ -14885,6 +14890,11 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/localClasses"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM_IR, true);
}
@TestMetadata("anonymousObjectInExtension.kt")
public void testAnonymousObjectInExtension() throws Exception {
runTest("compiler/testData/codegen/box/localClasses/anonymousObjectInExtension.kt");
}
@TestMetadata("anonymousObjectInInitializer.kt")
public void testAnonymousObjectInInitializer() throws Exception {
runTest("compiler/testData/codegen/box/localClasses/anonymousObjectInInitializer.kt");
@@ -22356,6 +22366,11 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes
runTest("compiler/testData/codegen/box/sam/constructors/filenameFilter.kt");
}
@TestMetadata("kt16790.kt")
public void testKt16790() throws Exception {
runTest("compiler/testData/codegen/box/sam/constructors/kt16790.kt");
}
@TestMetadata("kt19251.kt")
public void testKt19251() throws Exception {
runTest("compiler/testData/codegen/box/sam/constructors/kt19251.kt");
@@ -10694,6 +10694,11 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest {
runTest("compiler/testData/codegen/box/innerNested/superConstructorCall/objectExtendsLocalWithClosure.kt");
}
@TestMetadata("objectExtendsLocal_kt16858.kt")
public void testObjectExtendsLocal_kt16858() throws Exception {
runTest("compiler/testData/codegen/box/innerNested/superConstructorCall/objectExtendsLocal_kt16858.kt");
}
@TestMetadata("objectOuterDiffersFromInnerOuter.kt")
public void testObjectOuterDiffersFromInnerOuter() throws Exception {
runTest("compiler/testData/codegen/box/innerNested/superConstructorCall/objectOuterDiffersFromInnerOuter.kt");
@@ -11465,6 +11470,11 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest {
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/localClasses"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JS_IR, true);
}
@TestMetadata("anonymousObjectInExtension.kt")
public void testAnonymousObjectInExtension() throws Exception {
runTest("compiler/testData/codegen/box/localClasses/anonymousObjectInExtension.kt");
}
@TestMetadata("anonymousObjectInInitializer.kt")
public void testAnonymousObjectInInitializer() throws Exception {
runTest("compiler/testData/codegen/box/localClasses/anonymousObjectInInitializer.kt");
@@ -11739,6 +11739,11 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest {
runTest("compiler/testData/codegen/box/innerNested/superConstructorCall/objectExtendsLocalWithClosure.kt");
}
@TestMetadata("objectExtendsLocal_kt16858.kt")
public void testObjectExtendsLocal_kt16858() throws Exception {
runTest("compiler/testData/codegen/box/innerNested/superConstructorCall/objectExtendsLocal_kt16858.kt");
}
@TestMetadata("objectOuterDiffersFromInnerOuter.kt")
public void testObjectOuterDiffersFromInnerOuter() throws Exception {
runTest("compiler/testData/codegen/box/innerNested/superConstructorCall/objectOuterDiffersFromInnerOuter.kt");
@@ -12510,6 +12515,11 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest {
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/localClasses"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JS, true);
}
@TestMetadata("anonymousObjectInExtension.kt")
public void testAnonymousObjectInExtension() throws Exception {
runTest("compiler/testData/codegen/box/localClasses/anonymousObjectInExtension.kt");
}
@TestMetadata("anonymousObjectInInitializer.kt")
public void testAnonymousObjectInInitializer() throws Exception {
runTest("compiler/testData/codegen/box/localClasses/anonymousObjectInInitializer.kt");