JVM IR: Support -Xno-call-assertions

This commit is contained in:
Steven Schäfer
2020-01-22 12:01:08 +01:00
committed by Dmitry Petrov
parent 61e6d346aa
commit cf3e4608f3
9 changed files with 83 additions and 241 deletions

View File

@@ -0,0 +1,25 @@
// IGNORE_BACKEND_FIR: JVM_IR
// TARGET_BACKEND: JVM
// WITH_RUNTIME
// FILE: test.kt
import kotlin.test.*
fun box(): String {
assertFailsWith<NullPointerException> { J.j().method() }
assertFailsWith<NullPointerException> { J.j().field }
assertFailsWith<NullPointerException> { J.j().field = 42 }
return "OK"
}
// FILE: J.java
public class J {
public Object field;
public void method() {}
public static J j() { return null; }
}
// @TestKt.class:
// 0 checkNotNullExpressionValue
// 0 checkExpressionValueIsNotNull