IR to CFG test generator, sequential function tests

This commit is contained in:
Mikhail Glukhikh
2016-09-20 16:01:43 +03:00
committed by Dmitry Petrov
parent 65db7aa1ba
commit eaf10a4675
17 changed files with 241 additions and 6 deletions
+1
View File
@@ -0,0 +1 @@
fun foo(arg: Int) = arg
+14
View File
@@ -0,0 +1,14 @@
// FILE: /expressionFun.kt
// FUN: foo
BB 0
CONTENT
1 FUN public fun foo(arg: kotlin.Int): kotlin.Int
2 GET_VAR 'value-parameter arg: Int' type=kotlin.Int origin=null
3 RETURN type=kotlin.Nothing from='foo(Int): Int'
OUTGOING -> NONE
Function exit: FUN public fun foo(arg: kotlin.Int): kotlin.Int
// END FUN: foo
// END FILE: /expressionFun.kt
+1
View File
@@ -0,0 +1 @@
fun foo() = Unit
+14
View File
@@ -0,0 +1,14 @@
// FILE: /expressionUnit.kt
// FUN: foo
BB 0
CONTENT
1 FUN public fun foo(): kotlin.Unit
2 GET_OBJECT 'Unit' type=kotlin.Unit
3 RETURN type=kotlin.Nothing from='foo(): Unit'
OUTGOING -> NONE
Function exit: FUN public fun foo(): kotlin.Unit
// END FUN: foo
// END FILE: /expressionUnit.kt
+3
View File
@@ -0,0 +1,3 @@
fun foo() {
return Unit
}
+14
View File
@@ -0,0 +1,14 @@
// FILE: /returnUnit.kt
// FUN: foo
BB 0
CONTENT
1 FUN public fun foo(): kotlin.Unit
2 GET_OBJECT 'Unit' type=kotlin.Unit
3 RETURN type=kotlin.Nothing from='foo(): Unit'
OUTGOING -> NONE
Function exit: FUN public fun foo(): kotlin.Unit
// END FUN: foo
// END FILE: /returnUnit.kt
+4
View File
@@ -0,0 +1,4 @@
fun foo(arg: Int): Int {
val dbl = arg * 2
return dbl
}
+16
View File
@@ -0,0 +1,16 @@
// FILE: /sequentialFun.kt
// FUN: foo
BB 0
CONTENT
1 FUN public fun foo(arg: kotlin.Int): kotlin.Int
2 CALL 'times(Int): Int' type=kotlin.Int origin=MUL
3 VAR val dbl: kotlin.Int
4 GET_VAR 'dbl: Int' type=kotlin.Int origin=null
5 RETURN type=kotlin.Nothing from='foo(Int): Int'
OUTGOING -> NONE
Function exit: FUN public fun foo(arg: kotlin.Int): kotlin.Int
// END FUN: foo
// END FILE: /sequentialFun.kt
+1
View File
@@ -0,0 +1 @@
fun foo() {}
+12
View File
@@ -0,0 +1,12 @@
// FILE: /simpleFun.kt
// FUN: foo
BB 0
CONTENT
1 FUN public fun foo(): kotlin.Unit
OUTGOING -> NONE
Function exit: FUN public fun foo(): kotlin.Unit
// END FUN: foo
// END FILE: /simpleFun.kt
+3
View File
@@ -0,0 +1,3 @@
fun foo() {
return
}
+14
View File
@@ -0,0 +1,14 @@
// FILE: /simpleReturn.kt
// FUN: foo
BB 0
CONTENT
1 FUN public fun foo(): kotlin.Unit
2 GET_OBJECT 'Unit' type=kotlin.Unit
3 RETURN type=kotlin.Nothing from='foo(): Unit'
OUTGOING -> NONE
Function exit: FUN public fun foo(): kotlin.Unit
// END FUN: foo
// END FILE: /simpleReturn.kt