Do not cast arguments of binary operation to expected type for byte and short

This commit is contained in:
Natalia Ukhorskaya
2013-12-09 16:50:12 +04:00
parent 8b9fbdf911
commit 69ed9bc47a
24 changed files with 351 additions and 52 deletions
@@ -31,7 +31,7 @@ import org.jetbrains.jet.codegen.AbstractBytecodeTextTest;
/** This class is generated by {@link org.jetbrains.jet.generators.tests.GenerateTests}. DO NOT MODIFY MANUALLY */
@SuppressWarnings("all")
@TestMetadata("compiler/testData/codegen/bytecodeText")
@InnerTestClasses({BytecodeTextTestGenerated.DirectInvoke.class, BytecodeTextTestGenerated.Statements.class})
@InnerTestClasses({BytecodeTextTestGenerated.Constants.class, BytecodeTextTestGenerated.DirectInvoke.class, BytecodeTextTestGenerated.Statements.class})
public class BytecodeTextTestGenerated extends AbstractBytecodeTextTest {
public void testAllFilesPresentInBytecodeText() throws Exception {
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.GenerateTests", new File("compiler/testData/codegen/bytecodeText"), Pattern.compile("^(.+)\\.kt$"), true);
@@ -102,6 +102,24 @@ public class BytecodeTextTestGenerated extends AbstractBytecodeTextTest {
doTest("compiler/testData/codegen/bytecodeText/topLevelFunWithDefaultArgs.kt");
}
@TestMetadata("compiler/testData/codegen/bytecodeText/constants")
public static class Constants extends AbstractBytecodeTextTest {
public void testAllFilesPresentInConstants() throws Exception {
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.GenerateTests", new File("compiler/testData/codegen/bytecodeText/constants"), Pattern.compile("^(.+)\\.kt$"), true);
}
@TestMetadata("byte.kt")
public void testByte() throws Exception {
doTest("compiler/testData/codegen/bytecodeText/constants/byte.kt");
}
@TestMetadata("short.kt")
public void testShort() throws Exception {
doTest("compiler/testData/codegen/bytecodeText/constants/short.kt");
}
}
@TestMetadata("compiler/testData/codegen/bytecodeText/directInvoke")
public static class DirectInvoke extends AbstractBytecodeTextTest {
public void testAllFilesPresentInDirectInvoke() throws Exception {
@@ -166,6 +184,7 @@ public class BytecodeTextTestGenerated extends AbstractBytecodeTextTest {
public static Test suite() {
TestSuite suite = new TestSuite("BytecodeTextTestGenerated");
suite.addTestSuite(BytecodeTextTestGenerated.class);
suite.addTestSuite(Constants.class);
suite.addTestSuite(DirectInvoke.class);
suite.addTestSuite(Statements.class);
return suite;
@@ -31,7 +31,7 @@ import org.jetbrains.jet.codegen.generated.AbstractBlackBoxCodegenTest;
/** This class is generated by {@link org.jetbrains.jet.generators.tests.GenerateTests}. DO NOT MODIFY MANUALLY */
@SuppressWarnings("all")
@TestMetadata("compiler/testData/codegen/box")
@InnerTestClasses({BlackBoxCodegenTestGenerated.Arrays.class, BlackBoxCodegenTestGenerated.Bridges.class, BlackBoxCodegenTestGenerated.BuiltinStubMethods.class, BlackBoxCodegenTestGenerated.CallableReference.class, BlackBoxCodegenTestGenerated.Casts.class, BlackBoxCodegenTestGenerated.Classes.class, BlackBoxCodegenTestGenerated.Closures.class, BlackBoxCodegenTestGenerated.Constants.class, BlackBoxCodegenTestGenerated.ControlStructures.class, BlackBoxCodegenTestGenerated.DefaultArguments.class, BlackBoxCodegenTestGenerated.DelegatedProperty.class, BlackBoxCodegenTestGenerated.Elvis.class, BlackBoxCodegenTestGenerated.Enum.class, BlackBoxCodegenTestGenerated.ExclExcl.class, BlackBoxCodegenTestGenerated.ExtensionFunctions.class, BlackBoxCodegenTestGenerated.ExtensionProperties.class, BlackBoxCodegenTestGenerated.FakeOverride.class, BlackBoxCodegenTestGenerated.FieldRename.class, BlackBoxCodegenTestGenerated.Finally.class, BlackBoxCodegenTestGenerated.Functions.class, BlackBoxCodegenTestGenerated.InnerNested.class, BlackBoxCodegenTestGenerated.Instructions.class, BlackBoxCodegenTestGenerated.Intrinsics.class, BlackBoxCodegenTestGenerated.Labels.class, BlackBoxCodegenTestGenerated.LocalClasses.class, BlackBoxCodegenTestGenerated.MultiDecl.class, BlackBoxCodegenTestGenerated.Namespace.class, BlackBoxCodegenTestGenerated.Objects.class, BlackBoxCodegenTestGenerated.OperatorConventions.class, BlackBoxCodegenTestGenerated.PrimitiveTypes.class, BlackBoxCodegenTestGenerated.Properties.class, BlackBoxCodegenTestGenerated.Reflection.class, BlackBoxCodegenTestGenerated.SafeCall.class, BlackBoxCodegenTestGenerated.SamConstructors.class, BlackBoxCodegenTestGenerated.Strings.class, BlackBoxCodegenTestGenerated.Super.class, BlackBoxCodegenTestGenerated.ToArray.class, BlackBoxCodegenTestGenerated.Traits.class, BlackBoxCodegenTestGenerated.TypeInfo.class, BlackBoxCodegenTestGenerated.TypeMapping.class, BlackBoxCodegenTestGenerated.Unit.class, BlackBoxCodegenTestGenerated.Vararg.class, BlackBoxCodegenTestGenerated.When.class})
@InnerTestClasses({BlackBoxCodegenTestGenerated.Arrays.class, BlackBoxCodegenTestGenerated.BinaryOp.class, BlackBoxCodegenTestGenerated.Bridges.class, BlackBoxCodegenTestGenerated.BuiltinStubMethods.class, BlackBoxCodegenTestGenerated.CallableReference.class, BlackBoxCodegenTestGenerated.Casts.class, BlackBoxCodegenTestGenerated.Classes.class, BlackBoxCodegenTestGenerated.Closures.class, BlackBoxCodegenTestGenerated.Constants.class, BlackBoxCodegenTestGenerated.ControlStructures.class, BlackBoxCodegenTestGenerated.DefaultArguments.class, BlackBoxCodegenTestGenerated.DelegatedProperty.class, BlackBoxCodegenTestGenerated.Elvis.class, BlackBoxCodegenTestGenerated.Enum.class, BlackBoxCodegenTestGenerated.ExclExcl.class, BlackBoxCodegenTestGenerated.ExtensionFunctions.class, BlackBoxCodegenTestGenerated.ExtensionProperties.class, BlackBoxCodegenTestGenerated.FakeOverride.class, BlackBoxCodegenTestGenerated.FieldRename.class, BlackBoxCodegenTestGenerated.Finally.class, BlackBoxCodegenTestGenerated.Functions.class, BlackBoxCodegenTestGenerated.InnerNested.class, BlackBoxCodegenTestGenerated.Instructions.class, BlackBoxCodegenTestGenerated.Intrinsics.class, BlackBoxCodegenTestGenerated.Labels.class, BlackBoxCodegenTestGenerated.LocalClasses.class, BlackBoxCodegenTestGenerated.MultiDecl.class, BlackBoxCodegenTestGenerated.Namespace.class, BlackBoxCodegenTestGenerated.Objects.class, BlackBoxCodegenTestGenerated.OperatorConventions.class, BlackBoxCodegenTestGenerated.PrimitiveTypes.class, BlackBoxCodegenTestGenerated.Properties.class, BlackBoxCodegenTestGenerated.Reflection.class, BlackBoxCodegenTestGenerated.SafeCall.class, BlackBoxCodegenTestGenerated.SamConstructors.class, BlackBoxCodegenTestGenerated.Strings.class, BlackBoxCodegenTestGenerated.Super.class, BlackBoxCodegenTestGenerated.ToArray.class, BlackBoxCodegenTestGenerated.Traits.class, BlackBoxCodegenTestGenerated.TypeInfo.class, BlackBoxCodegenTestGenerated.TypeMapping.class, BlackBoxCodegenTestGenerated.UnaryOp.class, BlackBoxCodegenTestGenerated.Unit.class, BlackBoxCodegenTestGenerated.Vararg.class, BlackBoxCodegenTestGenerated.When.class})
public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
public void testAllFilesPresentInBox() throws Exception {
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.GenerateTests", new File("compiler/testData/codegen/box"), Pattern.compile("^(.+)\\.kt$"), true);
@@ -230,6 +230,49 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
}
@TestMetadata("compiler/testData/codegen/box/binaryOp")
public static class BinaryOp extends AbstractBlackBoxCodegenTest {
public void testAllFilesPresentInBinaryOp() throws Exception {
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.GenerateTests", new File("compiler/testData/codegen/box/binaryOp"), Pattern.compile("^(.+)\\.kt$"), true);
}
@TestMetadata("call.kt")
public void testCall() throws Exception {
doTest("compiler/testData/codegen/box/binaryOp/call.kt");
}
@TestMetadata("callNullable.kt")
public void testCallNullable() throws Exception {
doTest("compiler/testData/codegen/box/binaryOp/callNullable.kt");
}
@TestMetadata("infixCall.kt")
public void testInfixCall() throws Exception {
doTest("compiler/testData/codegen/box/binaryOp/infixCall.kt");
}
@TestMetadata("infixCallNullable.kt")
public void testInfixCallNullable() throws Exception {
doTest("compiler/testData/codegen/box/binaryOp/infixCallNullable.kt");
}
@TestMetadata("intrinsic.kt")
public void testIntrinsic() throws Exception {
doTest("compiler/testData/codegen/box/binaryOp/intrinsic.kt");
}
@TestMetadata("intrinsicNullable.kt")
public void testIntrinsicNullable() throws Exception {
doTest("compiler/testData/codegen/box/binaryOp/intrinsicNullable.kt");
}
@TestMetadata("longOverflow.kt")
public void testLongOverflow() throws Exception {
doTest("compiler/testData/codegen/box/binaryOp/longOverflow.kt");
}
}
@TestMetadata("compiler/testData/codegen/box/bridges")
public static class Bridges extends AbstractBlackBoxCodegenTest {
public void testAllFilesPresentInBridges() throws Exception {
@@ -4786,6 +4829,39 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
}
@TestMetadata("compiler/testData/codegen/box/unaryOp")
public static class UnaryOp extends AbstractBlackBoxCodegenTest {
public void testAllFilesPresentInUnaryOp() throws Exception {
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.GenerateTests", new File("compiler/testData/codegen/box/unaryOp"), Pattern.compile("^(.+)\\.kt$"), true);
}
@TestMetadata("call.kt")
public void testCall() throws Exception {
doTest("compiler/testData/codegen/box/unaryOp/call.kt");
}
@TestMetadata("callNullable.kt")
public void testCallNullable() throws Exception {
doTest("compiler/testData/codegen/box/unaryOp/callNullable.kt");
}
@TestMetadata("intrinsic.kt")
public void testIntrinsic() throws Exception {
doTest("compiler/testData/codegen/box/unaryOp/intrinsic.kt");
}
@TestMetadata("intrinsicNullable.kt")
public void testIntrinsicNullable() throws Exception {
doTest("compiler/testData/codegen/box/unaryOp/intrinsicNullable.kt");
}
@TestMetadata("longOverflow.kt")
public void testLongOverflow() throws Exception {
doTest("compiler/testData/codegen/box/unaryOp/longOverflow.kt");
}
}
@TestMetadata("compiler/testData/codegen/box/unit")
public static class Unit extends AbstractBlackBoxCodegenTest {
public void testAllFilesPresentInUnit() throws Exception {
@@ -4964,6 +5040,7 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
TestSuite suite = new TestSuite("BlackBoxCodegenTestGenerated");
suite.addTestSuite(BlackBoxCodegenTestGenerated.class);
suite.addTestSuite(Arrays.class);
suite.addTestSuite(BinaryOp.class);
suite.addTestSuite(Bridges.class);
suite.addTestSuite(BuiltinStubMethods.class);
suite.addTestSuite(CallableReference.class);
@@ -5003,6 +5080,7 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
suite.addTestSuite(Traits.class);
suite.addTestSuite(TypeInfo.class);
suite.addTestSuite(TypeMapping.class);
suite.addTestSuite(UnaryOp.class);
suite.addTestSuite(Unit.class);
suite.addTestSuite(Vararg.class);
suite.addTestSuite(When.class);