[TD] Update diagnostics test data due to new test runners
Update includes:
- Changing syntax of `OI/`NI` tags from `<!NI;TAG!>` to `<!TAG{NI}!>`
- Fix some incorrect directives
- Change order of diagnostics in some places
- Remove ignored diagnostics from FIR test data (previously `DIAGNOSTICS` didn't work)
- Update FIR dumps in some places and add `FIR_IDENTICAL` if needed
- Replace all JAVAC_SKIP with SKIP_JAVAC directive
This commit is contained in:
+110
@@ -0,0 +1,110 @@
|
||||
FILE: when.kt
|
||||
public abstract interface A : R|kotlin/Any| {
|
||||
public abstract fun foo(): R|kotlin/Unit|
|
||||
|
||||
}
|
||||
public abstract interface B : R|kotlin/Any| {
|
||||
public abstract fun bar(): R|kotlin/Unit|
|
||||
|
||||
}
|
||||
public final fun test_1(x: R|kotlin/Any?|): R|kotlin/Unit| {
|
||||
when () {
|
||||
(R|<local>/x| is R|A|) -> {
|
||||
R|<local>/x|.R|/A.foo|()
|
||||
}
|
||||
(R|<local>/x| is R|B|) -> {
|
||||
R|<local>/x|.R|/B.bar|()
|
||||
}
|
||||
}
|
||||
|
||||
when () {
|
||||
(R|<local>/x| !is R|A|) -> {
|
||||
}
|
||||
(R|<local>/x| !is R|B|) -> {
|
||||
R|<local>/x|.R|/A.foo|()
|
||||
}
|
||||
(R|<local>/x| is R|kotlin/Int|) -> {
|
||||
R|<local>/x|.R|/A.foo|()
|
||||
R|<local>/x|.R|/B.bar|()
|
||||
R|<local>/x|.R|kotlin/Int.inc|()
|
||||
}
|
||||
else -> {
|
||||
R|<local>/x|.R|/A.foo|()
|
||||
R|<local>/x|.R|/B.bar|()
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
public final fun test_2(x: R|kotlin/Any?|): R|kotlin/Unit| {
|
||||
when (R|<local>/x|) {
|
||||
($subj$ is R|A|) -> {
|
||||
R|<local>/x|.R|/A.foo|()
|
||||
}
|
||||
($subj$ is R|B|) -> {
|
||||
R|<local>/x|.R|/B.bar|()
|
||||
}
|
||||
}
|
||||
|
||||
when (R|<local>/x|) {
|
||||
($subj$ !is R|A|) -> {
|
||||
}
|
||||
($subj$ !is R|B|) -> {
|
||||
R|<local>/x|.R|/A.foo|()
|
||||
}
|
||||
($subj$ is R|kotlin/Int|) -> {
|
||||
R|<local>/x|.R|/A.foo|()
|
||||
R|<local>/x|.R|/B.bar|()
|
||||
R|<local>/x|.R|kotlin/Int.inc|()
|
||||
}
|
||||
else -> {
|
||||
R|<local>/x|.R|/A.foo|()
|
||||
R|<local>/x|.R|/B.bar|()
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
public final fun test_3(x: R|kotlin/Any?|): R|kotlin/Unit| {
|
||||
when (lval y: R|kotlin/Any?| = R|<local>/x|) {
|
||||
($subj$ is R|A|) -> {
|
||||
R|<local>/x|.R|/A.foo|()
|
||||
R|<local>/y|.R|/A.foo|()
|
||||
}
|
||||
($subj$ is R|B|) -> {
|
||||
R|<local>/x|.R|/B.bar|()
|
||||
R|<local>/y|.R|/B.bar|()
|
||||
}
|
||||
}
|
||||
|
||||
when (lval y: R|kotlin/Any?| = R|<local>/x|) {
|
||||
($subj$ !is R|A|) -> {
|
||||
}
|
||||
($subj$ !is R|B|) -> {
|
||||
R|<local>/x|.R|/A.foo|()
|
||||
R|<local>/y|.R|/A.foo|()
|
||||
}
|
||||
($subj$ is R|kotlin/Int|) -> {
|
||||
R|<local>/x|.R|/A.foo|()
|
||||
R|<local>/x|.R|/B.bar|()
|
||||
R|<local>/x|.R|kotlin/Int.inc|()
|
||||
R|<local>/y|.R|/A.foo|()
|
||||
R|<local>/y|.R|/B.bar|()
|
||||
R|<local>/y|.R|kotlin/Int.inc|()
|
||||
}
|
||||
else -> {
|
||||
R|<local>/x|.R|/A.foo|()
|
||||
R|<local>/x|.R|/B.bar|()
|
||||
R|<local>/y|.R|/A.foo|()
|
||||
R|<local>/y|.R|/B.bar|()
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
public final fun test_4(x: R|kotlin/Any|): R|kotlin/Unit| {
|
||||
when ((R|<local>/x| as R|kotlin/Int|)) {
|
||||
==($subj$, Int(1)) -> {
|
||||
R|<local>/x|.R|kotlin/Int.inc|()
|
||||
}
|
||||
}
|
||||
|
||||
R|<local>/x|.R|kotlin/Int.inc|()
|
||||
}
|
||||
Reference in New Issue
Block a user