FIR: Adjust testData for spec tests: dfa

This commit is contained in:
Denis Zharkov
2020-04-15 13:06:26 +03:00
parent 86e1aadd31
commit 0d34299b7a
118 changed files with 31269 additions and 0 deletions
@@ -0,0 +1,61 @@
// !LANGUAGE: +NewInference
// !DIAGNOSTICS: -UNUSED_EXPRESSION
// SKIP_TXT
/*
* KOTLIN DIAGNOSTICS NOT LINKED SPEC TEST (POSITIVE)
*
* SECTIONS: dfa
* NUMBER: 14
* DESCRIPTION: Raw data flow analysis test
*/
// TESTCASE NUMBER: 1
fun case_1(vararg x: Int?) {
if (x != null) {
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.IntArray & kotlin.IntArray")!>x<!>
x[0]
}
}
// TESTCASE NUMBER: 2
fun case_2(vararg x: Int?) {
x[0].apply {
if (this != null) {
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int & kotlin.Int")!>this<!>
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int & kotlin.Int")!>this<!>.inv()
}
}
x[0].also {
if (it != null) {
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int & kotlin.Int")!>it<!>
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int & kotlin.Int")!>it<!>.inv()
}
}
}
// TESTCASE NUMBER: 3
fun <T> case_3(vararg x: T?) {
if (x != null) {
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Array<out T?> & kotlin.Array<out T?>")!>x<!>
x[0]
}
}
// TESTCASE NUMBER: 4
fun <T : Number?> case_4(vararg x: T?) {
x[0].apply {
if (this != null) {
<!DEBUG_INFO_EXPRESSION_TYPE("T?!! & T?!!")!>this<!>
<!DEBUG_INFO_EXPRESSION_TYPE("T?!! & T?!!")!>this<!>.toByte()
}
}
x[0].also {
if (it != null) {
<!DEBUG_INFO_EXPRESSION_TYPE("T?!! & T?")!>it<!>
<!DEBUG_INFO_EXPRESSION_TYPE("T?!! & T?")!>it<!>.toByte()
}
}
}