TEST: throw keyword support.

This commit is contained in:
Nikolay Igotti
2016-11-21 17:36:36 +03:00
committed by KonstantinAnisimov
parent 0cd4512dd5
commit 81811e8c3a
6 changed files with 26 additions and 2 deletions
+7 -2
View File
@@ -380,9 +380,14 @@ task intrinsic(type: UnitKonanTest) {
task link(type: LinkKonanTest) {
source = "link/src/bar.kt"
lib = "link/lib"
}
}
task for0(type: RunKonanTest) {
goldValue = "2\n3\n4\n"
source = "runtime/basic/for0.kt"
}
}
task throw0(type: RunKonanTest) {
goldValue = "Done\n"
source = "runtime/basic/throw0.kt"
}
@@ -0,0 +1,8 @@
fun main(args : Array<String>) {
val cond = 1
if (cond == 2) throw RuntimeException()
if (cond == 3) throw NoSuchElementException("no such element")
if (cond == 4) throw Error("error happens")
println("Done")
}