Do not compare boxed values with 0 via IFEQ/IFNE

This commit is contained in:
Alexander Udalov
2012-10-30 22:54:20 +04:00
parent cb99f26807
commit 4c5fe70804
3 changed files with 15 additions and 2 deletions
@@ -250,6 +250,11 @@ public class ControlStructuresTest extends CodegenTestCase {
assertEquals(false, main.invoke(null, 1, 0));
}
public void testCompareBoxedIntegerToZero() {
createEnvironmentWithMockJdkAndIdeaAnnotations(ConfigurationKind.JDK_ONLY);
blackBoxFile("controlStructures/compareBoxedIntegerToZero.kt");
}
public void testCompareToNull() throws Exception {
createEnvironmentWithMockJdkAndIdeaAnnotations(ConfigurationKind.JDK_ONLY);
loadText("fun foo(a: String?, b: String?): Boolean = a == null && b !== null && null == a && null !== b");