Add ABI tests for classes extending Number and CharSequence
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
inline class InlineCharSequence(private val cs: CharSequence) : CharSequence {
|
||||
override val length: Int get() = cs.length
|
||||
override fun get(index: Int): Char = cs[index]
|
||||
override fun subSequence(startIndex: Int, endIndex: Int): CharSequence = cs.subSequence(startIndex, endIndex)
|
||||
}
|
||||
+24
@@ -0,0 +1,24 @@
|
||||
@kotlin.Metadata
|
||||
public final class InlineCharSequence {
|
||||
// source: 'inlineCharSequence.kt'
|
||||
private final field cs: java.lang.CharSequence
|
||||
private synthetic method <init>(p0: java.lang.CharSequence): void
|
||||
public synthetic final static method box-impl(p0: java.lang.CharSequence): InlineCharSequence
|
||||
public bridge final method charAt(p0: int): char
|
||||
public static @org.jetbrains.annotations.NotNull method constructor-impl(@org.jetbrains.annotations.NotNull p0: java.lang.CharSequence): java.lang.CharSequence
|
||||
public method equals(p0: java.lang.Object): boolean
|
||||
public static method equals-impl(p0: java.lang.CharSequence, p1: java.lang.Object): boolean
|
||||
public final static method equals-impl0(p0: java.lang.CharSequence, p1: java.lang.CharSequence): boolean
|
||||
public method get(p0: int): char
|
||||
public static method get-impl(p0: java.lang.CharSequence, p1: int): char
|
||||
public method getLength(): int
|
||||
public static method getLength-impl(p0: java.lang.CharSequence): int
|
||||
public method hashCode(): int
|
||||
public static method hashCode-impl(p0: java.lang.CharSequence): int
|
||||
public bridge final method length(): int
|
||||
public @org.jetbrains.annotations.NotNull method subSequence(p0: int, p1: int): java.lang.CharSequence
|
||||
public static @org.jetbrains.annotations.NotNull method subSequence-impl(p0: java.lang.CharSequence, p1: int, p2: int): java.lang.CharSequence
|
||||
public method toString(): java.lang.String
|
||||
public static method toString-impl(p0: java.lang.CharSequence): java.lang.String
|
||||
public synthetic final method unbox-impl(): java.lang.CharSequence
|
||||
}
|
||||
+24
@@ -0,0 +1,24 @@
|
||||
@kotlin.Metadata
|
||||
public final class InlineCharSequence {
|
||||
// source: 'inlineCharSequence.kt'
|
||||
private final @org.jetbrains.annotations.NotNull field cs: java.lang.CharSequence
|
||||
private synthetic method <init>(p0: java.lang.CharSequence): void
|
||||
public synthetic final static method box-impl(p0: java.lang.CharSequence): InlineCharSequence
|
||||
public bridge final method charAt(p0: int): char
|
||||
public static @org.jetbrains.annotations.NotNull method constructor-impl(@org.jetbrains.annotations.NotNull p0: java.lang.CharSequence): java.lang.CharSequence
|
||||
public method equals(p0: java.lang.Object): boolean
|
||||
public static method equals-impl(p0: java.lang.CharSequence, p1: java.lang.Object): boolean
|
||||
public final static method equals-impl0(p0: java.lang.CharSequence, p1: java.lang.CharSequence): boolean
|
||||
public method get(p0: int): char
|
||||
public static method get-impl(@org.jetbrains.annotations.NotNull p0: java.lang.CharSequence, p1: int): char
|
||||
public method getLength(): int
|
||||
public static method getLength-impl(@org.jetbrains.annotations.NotNull p0: java.lang.CharSequence): int
|
||||
public method hashCode(): int
|
||||
public static method hashCode-impl(p0: java.lang.CharSequence): int
|
||||
public synthetic bridge method length(): int
|
||||
public @org.jetbrains.annotations.NotNull method subSequence(p0: int, p1: int): java.lang.CharSequence
|
||||
public static @org.jetbrains.annotations.NotNull method subSequence-impl(@org.jetbrains.annotations.NotNull p0: java.lang.CharSequence, p1: int, p2: int): java.lang.CharSequence
|
||||
public method toString(): java.lang.String
|
||||
public static method toString-impl(p0: java.lang.CharSequence): java.lang.String
|
||||
public synthetic final method unbox-impl(): java.lang.CharSequence
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
abstract class AbstractCharSequence : CharSequence
|
||||
|
||||
class MyCharSequence : CharSequence {
|
||||
override val length: Int get() = 0
|
||||
|
||||
override fun get(index: Int): Char = throw Exception()
|
||||
|
||||
override fun subSequence(startIndex: Int, endIndex: Int): CharSequence = this
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
@kotlin.Metadata
|
||||
public abstract class AbstractCharSequence {
|
||||
// source: 'charSequence.kt'
|
||||
public method <init>(): void
|
||||
public bridge final method charAt(p0: int): char
|
||||
public abstract method get(p0: int): char
|
||||
public abstract method getLength(): int
|
||||
public bridge final method length(): int
|
||||
}
|
||||
|
||||
@kotlin.Metadata
|
||||
public final class MyCharSequence {
|
||||
// source: 'charSequence.kt'
|
||||
public method <init>(): void
|
||||
public bridge final method charAt(p0: int): char
|
||||
public method get(p0: int): char
|
||||
public method getLength(): int
|
||||
public bridge final method length(): int
|
||||
public @org.jetbrains.annotations.NotNull method subSequence(p0: int, p1: int): java.lang.CharSequence
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
// IGNORE_BACKEND: JVM_IR
|
||||
// ^ see KT-42578
|
||||
|
||||
abstract class AbstractNumber : Number()
|
||||
|
||||
class MyNumber : Number() {
|
||||
override fun toByte(): Byte = 0
|
||||
override fun toChar(): Char = 0.toChar()
|
||||
override fun toDouble(): Double = 0.0
|
||||
override fun toFloat(): Float = 0.0f
|
||||
override fun toInt(): Int = 0
|
||||
override fun toLong(): Long = 0
|
||||
override fun toShort(): Short = 0
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
@kotlin.Metadata
|
||||
public abstract class AbstractNumber {
|
||||
// source: 'number.kt'
|
||||
public method <init>(): void
|
||||
public bridge final method byteValue(): byte
|
||||
public bridge final method doubleValue(): double
|
||||
public bridge final method floatValue(): float
|
||||
public bridge final method intValue(): int
|
||||
public bridge final method longValue(): long
|
||||
public bridge final method shortValue(): short
|
||||
}
|
||||
|
||||
@kotlin.Metadata
|
||||
public final class MyNumber {
|
||||
// source: 'number.kt'
|
||||
public method <init>(): void
|
||||
public bridge final method byteValue(): byte
|
||||
public bridge final method doubleValue(): double
|
||||
public bridge final method floatValue(): float
|
||||
public bridge final method intValue(): int
|
||||
public bridge final method longValue(): long
|
||||
public bridge final method shortValue(): short
|
||||
public method toByte(): byte
|
||||
public method toChar(): char
|
||||
public method toDouble(): double
|
||||
public method toFloat(): float
|
||||
public method toInt(): int
|
||||
public method toLong(): long
|
||||
public method toShort(): short
|
||||
}
|
||||
Generated
-13
@@ -105,19 +105,6 @@ public class ForeignJava8AnnotationsTestGenerated extends AbstractForeignJava8An
|
||||
runTest("compiler/testData/foreignAnnotationsJava8/tests/jspecify/wildcardsWithDefault.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("compiler/testData/foreignAnnotationsJava8/tests/jspecify/kotlin")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@RunWith(JUnit3RunnerWithInners.class)
|
||||
public static class Kotlin extends AbstractForeignJava8AnnotationsTest {
|
||||
private void runTest(String testDataFilePath) throws Exception {
|
||||
KotlinTestUtils.runTest(this::doTest, this, testDataFilePath);
|
||||
}
|
||||
|
||||
public void testAllFilesPresentInKotlin() throws Exception {
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/foreignAnnotationsJava8/tests/jspecify/kotlin"), Pattern.compile("^(.+)\\.kt$"), null, true);
|
||||
}
|
||||
}
|
||||
|
||||
@TestMetadata("compiler/testData/foreignAnnotationsJava8/tests/jspecify/warnings")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@RunWith(JUnit3RunnerWithInners.class)
|
||||
|
||||
-13
@@ -105,19 +105,6 @@ public class JavacForeignJava8AnnotationsTestGenerated extends AbstractJavacFore
|
||||
runTest("compiler/testData/foreignAnnotationsJava8/tests/jspecify/wildcardsWithDefault.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("compiler/testData/foreignAnnotationsJava8/tests/jspecify/kotlin")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@RunWith(JUnit3RunnerWithInners.class)
|
||||
public static class Kotlin extends AbstractJavacForeignJava8AnnotationsTest {
|
||||
private void runTest(String testDataFilePath) throws Exception {
|
||||
KotlinTestUtils.runTest(this::doTest, this, testDataFilePath);
|
||||
}
|
||||
|
||||
public void testAllFilesPresentInKotlin() throws Exception {
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/foreignAnnotationsJava8/tests/jspecify/kotlin"), Pattern.compile("^(.+)\\.kt$"), null, true);
|
||||
}
|
||||
}
|
||||
|
||||
@TestMetadata("compiler/testData/foreignAnnotationsJava8/tests/jspecify/warnings")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@RunWith(JUnit3RunnerWithInners.class)
|
||||
|
||||
+15
@@ -679,6 +679,11 @@ public class BytecodeListingTestGenerated extends AbstractBytecodeListingTest {
|
||||
runTest("compiler/testData/codegen/bytecodeListing/inlineClasses/constructorsWithDefaultParameterValues.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("inlineCharSequence.kt")
|
||||
public void testInlineCharSequence() throws Exception {
|
||||
runTest("compiler/testData/codegen/bytecodeListing/inlineClasses/inlineCharSequence.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("inlineClassMembersVisibility.kt")
|
||||
public void testInlineClassMembersVisibility() throws Exception {
|
||||
runTest("compiler/testData/codegen/bytecodeListing/inlineClasses/inlineClassMembersVisibility.kt");
|
||||
@@ -1129,6 +1134,11 @@ public class BytecodeListingTestGenerated extends AbstractBytecodeListingTest {
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeListing/specialBridges"), Pattern.compile("^(.+)\\.kt$"), null, true);
|
||||
}
|
||||
|
||||
@TestMetadata("charSequence.kt")
|
||||
public void testCharSequence() throws Exception {
|
||||
runTest("compiler/testData/codegen/bytecodeListing/specialBridges/charSequence.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("contains.kt")
|
||||
public void testContains() throws Exception {
|
||||
runTest("compiler/testData/codegen/bytecodeListing/specialBridges/contains.kt");
|
||||
@@ -1154,6 +1164,11 @@ public class BytecodeListingTestGenerated extends AbstractBytecodeListingTest {
|
||||
runTest("compiler/testData/codegen/bytecodeListing/specialBridges/noSpecialBridgeIfPresentInSuperClass.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("number.kt")
|
||||
public void testNumber() throws Exception {
|
||||
runTest("compiler/testData/codegen/bytecodeListing/specialBridges/number.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("redundantStubForSize.kt")
|
||||
public void testRedundantStubForSize() throws Exception {
|
||||
runTest("compiler/testData/codegen/bytecodeListing/specialBridges/redundantStubForSize.kt");
|
||||
|
||||
+15
@@ -649,6 +649,11 @@ public class IrBytecodeListingTestGenerated extends AbstractIrBytecodeListingTes
|
||||
runTest("compiler/testData/codegen/bytecodeListing/inlineClasses/constructorsWithDefaultParameterValues.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("inlineCharSequence.kt")
|
||||
public void testInlineCharSequence() throws Exception {
|
||||
runTest("compiler/testData/codegen/bytecodeListing/inlineClasses/inlineCharSequence.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("inlineClassMembersVisibility.kt")
|
||||
public void testInlineClassMembersVisibility() throws Exception {
|
||||
runTest("compiler/testData/codegen/bytecodeListing/inlineClasses/inlineClassMembersVisibility.kt");
|
||||
@@ -1099,6 +1104,11 @@ public class IrBytecodeListingTestGenerated extends AbstractIrBytecodeListingTes
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeListing/specialBridges"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true);
|
||||
}
|
||||
|
||||
@TestMetadata("charSequence.kt")
|
||||
public void testCharSequence() throws Exception {
|
||||
runTest("compiler/testData/codegen/bytecodeListing/specialBridges/charSequence.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("contains.kt")
|
||||
public void testContains() throws Exception {
|
||||
runTest("compiler/testData/codegen/bytecodeListing/specialBridges/contains.kt");
|
||||
@@ -1124,6 +1134,11 @@ public class IrBytecodeListingTestGenerated extends AbstractIrBytecodeListingTes
|
||||
runTest("compiler/testData/codegen/bytecodeListing/specialBridges/noSpecialBridgeIfPresentInSuperClass.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("number.kt")
|
||||
public void testNumber() throws Exception {
|
||||
runTest("compiler/testData/codegen/bytecodeListing/specialBridges/number.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("redundantStubForSize.kt")
|
||||
public void testRedundantStubForSize() throws Exception {
|
||||
runTest("compiler/testData/codegen/bytecodeListing/specialBridges/redundantStubForSize.kt");
|
||||
|
||||
Reference in New Issue
Block a user