From f6b99955f844d5f5010a597e9be9fdda3a5d2335 Mon Sep 17 00:00:00 2001 From: Dmitry Petrov Date: Wed, 4 Dec 2019 13:40:36 +0300 Subject: [PATCH] Update testData in bytecodeText (argument nullability assertions) --- .../ieee754/explicitCompareCall.kt | 1 - .../notNullAssertions/noCallAssertions.kt | 87 ++++++++++--------- .../notNullAssertions/rightElvisOperand.kt | 1 - .../boxAgainstJava/platformTypes/kt14989.kt | 1 - .../notNullAssertions/arrayListGet.kt | 2 - .../assertionForNotNullCaptured.kt | 3 - .../javaMultipleSubstitutions.kt | 2 - .../deterministicNotNullChecks.kt | 4 + 8 files changed, 48 insertions(+), 53 deletions(-) diff --git a/compiler/testData/codegen/boxAgainstJava/ieee754/explicitCompareCall.kt b/compiler/testData/codegen/boxAgainstJava/ieee754/explicitCompareCall.kt index 9c691af47ce..049ca1717c3 100644 --- a/compiler/testData/codegen/boxAgainstJava/ieee754/explicitCompareCall.kt +++ b/compiler/testData/codegen/boxAgainstJava/ieee754/explicitCompareCall.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND: JVM_IR // FILE: JavaClass.java public class JavaClass { diff --git a/compiler/testData/codegen/boxAgainstJava/notNullAssertions/noCallAssertions.kt b/compiler/testData/codegen/boxAgainstJava/notNullAssertions/noCallAssertions.kt index a6979d5250a..fea5c1b5846 100644 --- a/compiler/testData/codegen/boxAgainstJava/notNullAssertions/noCallAssertions.kt +++ b/compiler/testData/codegen/boxAgainstJava/notNullAssertions/noCallAssertions.kt @@ -1,47 +1,5 @@ // KOTLIN_CONFIGURATION_FLAGS: +JVM.DISABLE_PARAM_ASSERTIONS, +JVM.DISABLE_CALL_ASSERTIONS -// FILE: A.java - -import org.jetbrains.annotations.NotNull; - -public class A { - @NotNull - public final String NULL = null; - - @NotNull - public static final String STATIC_NULL = null; - - public String foo() { - return null; - } - - public static String staticFoo() { - return null; - } - - public A plus(A a) { - return null; - } - - public A inc() { - return null; - } - - public Object get(Object o) { - return null; - } - - public A a() { return this; } - - public static class B { - public static B b() { return null; } - } - - public static class C { - public static C c() { return null; } - } -} - -// FILE: AssertionChecker.kt +// FILE: noCallAssertions.kt class AssertionChecker(val illegalStateExpected: Boolean) { operator fun invoke(name: String, f: () -> Any) { @@ -122,3 +80,46 @@ fun box(): String { checkAssertions(false) return "OK" } + +// FILE: A.java + +import org.jetbrains.annotations.NotNull; + +public class A { + @NotNull + public final String NULL = null; + + @NotNull + public static final String STATIC_NULL = null; + + public String foo() { + return null; + } + + public static String staticFoo() { + return null; + } + + public A plus(A a) { + return null; + } + + public A inc() { + return null; + } + + public Object get(Object o) { + return null; + } + + public A a() { return this; } + + public static class B { + public static B b() { return null; } + } + + public static class C { + public static C c() { return null; } + } +} + diff --git a/compiler/testData/codegen/boxAgainstJava/notNullAssertions/rightElvisOperand.kt b/compiler/testData/codegen/boxAgainstJava/notNullAssertions/rightElvisOperand.kt index 3066e1bb25b..6e49194ed76 100644 --- a/compiler/testData/codegen/boxAgainstJava/notNullAssertions/rightElvisOperand.kt +++ b/compiler/testData/codegen/boxAgainstJava/notNullAssertions/rightElvisOperand.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND: JVM_IR // FILE: RightElvisOperand.java class RightElvisOperand { diff --git a/compiler/testData/codegen/boxAgainstJava/platformTypes/kt14989.kt b/compiler/testData/codegen/boxAgainstJava/platformTypes/kt14989.kt index 043d947171a..1f7ca2e9ac4 100644 --- a/compiler/testData/codegen/boxAgainstJava/platformTypes/kt14989.kt +++ b/compiler/testData/codegen/boxAgainstJava/platformTypes/kt14989.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND: JVM_IR //WITH_RUNTIME // FILE: JavaClass.java diff --git a/compiler/testData/codegen/bytecodeText/notNullAssertions/arrayListGet.kt b/compiler/testData/codegen/bytecodeText/notNullAssertions/arrayListGet.kt index 68bd5cd40da..c9f44cf2a0a 100644 --- a/compiler/testData/codegen/bytecodeText/notNullAssertions/arrayListGet.kt +++ b/compiler/testData/codegen/bytecodeText/notNullAssertions/arrayListGet.kt @@ -1,5 +1,3 @@ -// IGNORE_BACKEND: JVM_IR -// Missing IMPLICIT_NOTNULL casts import java.util.ArrayList fun foo(): Any { diff --git a/compiler/testData/codegen/bytecodeText/notNullAssertions/assertionForNotNullCaptured.kt b/compiler/testData/codegen/bytecodeText/notNullAssertions/assertionForNotNullCaptured.kt index 8de96d2baad..a6071d619ae 100644 --- a/compiler/testData/codegen/bytecodeText/notNullAssertions/assertionForNotNullCaptured.kt +++ b/compiler/testData/codegen/bytecodeText/notNullAssertions/assertionForNotNullCaptured.kt @@ -1,6 +1,3 @@ -// IGNORE_BACKEND: JVM_IR -// Missing IMPLICIT_NOTNULL casts - class A { fun add(element: T) {} } diff --git a/compiler/testData/codegen/bytecodeText/notNullAssertions/javaMultipleSubstitutions.kt b/compiler/testData/codegen/bytecodeText/notNullAssertions/javaMultipleSubstitutions.kt index c552bc2aff6..0bf91dd47e3 100644 --- a/compiler/testData/codegen/bytecodeText/notNullAssertions/javaMultipleSubstitutions.kt +++ b/compiler/testData/codegen/bytecodeText/notNullAssertions/javaMultipleSubstitutions.kt @@ -1,5 +1,3 @@ -// IGNORE_BACKEND: JVM_IR -// Missing IMPLICIT_NOTNULL casts // FILE: A.java import org.jetbrains.annotations.NotNull; diff --git a/compiler/testData/codegen/bytecodeText/nullCheckOptimization/deterministicNotNullChecks.kt b/compiler/testData/codegen/bytecodeText/nullCheckOptimization/deterministicNotNullChecks.kt index 76bfb612852..11ed3de8e05 100644 --- a/compiler/testData/codegen/bytecodeText/nullCheckOptimization/deterministicNotNullChecks.kt +++ b/compiler/testData/codegen/bytecodeText/nullCheckOptimization/deterministicNotNullChecks.kt @@ -1,4 +1,8 @@ // FILE: test/CallableDescriptor.java + +// IGNORE_BACKEND: JVM_IR +// ^ TODO decide if we should generate nullability assertions on arguments of 'contains' and other funs with special bridges + package test; import org.jetbrains.annotations.NotNull;