LockPerf benchmark and related fixes (try/break/continue interoperability)
This commit is contained in:
@@ -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"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user