Add more tests for -Xassertions=jvm corner cases

This commit is contained in:
Steven Schäfer
2019-07-05 15:24:54 +02:00
committed by max-kammerer
parent 3e25166832
commit d11344ce2e
15 changed files with 491 additions and 1 deletions
@@ -1,3 +1,4 @@
// IGNORE_BACKEND: JVM
// IGNORE_BACKEND: JVM_IR
// KOTLIN_CONFIGURATION_FLAGS: ASSERTIONS_MODE=jvm
@@ -15,7 +16,7 @@ class A {
// inlineSite:
// 1 GETSTATIC A\$inlineSite\$\$inlined\$inlineMe\$1.\$assertionsDisabled
// A.<clinit>:
// 1 LDC LA\$inlineSite\$\$inlined\$inlineMe\$1;.class\s*INVOKEVIRTUAL java/lang/Class.desiredAssertionStatus \(\)Z
// 1 LDC LA;.class\s*INVOKEVIRTUAL java/lang/Class.desiredAssertionStatus \(\)Z
// 1 PUTSTATIC A\$inlineSite\$\$inlined\$inlineMe\$1.\$assertionsDisabled : Z
// in declaration site and in inline site
// 2 INVOKEVIRTUAL java/lang/Class.desiredAssertionStatus \(\)Z
@@ -0,0 +1,23 @@
// IGNORE_BACKEND: JVM
// IGNORE_BACKEND: JVM_IR
// KOTLIN_CONFIGURATION_FLAGS: ASSERTIONS_MODE=jvm
class Outer {
class Inner {
fun f() { assert(true) }
}
}
// We set the assertion status based on top-level classes.
// 0 LDC LOuter\$Inner;.class
// 1 desiredAssertionStatus
// The assertion disabled field should be package local.
// 1 final static synthetic Z \$assertionsDisabled
// 0 public final static synthetic Z \$assertionsDisabled
// 0 protected final static synthetic Z \$assertionsDisabled
// 0 private final static synthetic Z \$assertionsDisabled
// Outer\$Inner.<clinit>:
// 1 LDC LOuter;.class\s*INVOKEVIRTUAL java/lang/Class.desiredAssertionStatus \(\)Z
// 1 PUTSTATIC Outer\$Inner.\$assertionsDisabled : Z
// Outer\$Inner.f:
// 1 GETSTATIC Outer\$Inner.\$assertionsDisabled