LockPerf benchmark and related fixes (try/break/continue interoperability)

This commit is contained in:
Alex Tkachman
2011-12-08 11:18:27 +02:00
parent 0656f1f0e0
commit b89956f1fd
4 changed files with 228 additions and 37 deletions
@@ -41,12 +41,48 @@ fun test4() : Int {
}
}
fun test5() : Int {
var x = 0
System.out?.println("test 5")
while(true) {
System.out?.println(x)
try {
if(x < 10)
x++
else
break
}
finally {
x++
}
}
return x
}
fun test6() : Int {
var x = 0
System.out?.println("test 6")
while(x < 10) {
System.out?.println(x)
try {
x++
continue
}
finally {
x++
}
}
return x
}
fun box() : String {
if(test1()) return "test1 failed"
if(test2()) return "test2 failed"
if(test3() != 2) return "test3 failed"
System.out?.println(test4())
if(test4() != 3) return "test4 failed"
if(test5() != 11) return "test5 failed"
if(test6() != 10) return "test6 failed"
return "OK"
}