translator: add test on side effects in while argument

This commit is contained in:
Alexey Stepanov
2016-08-23 18:10:09 +03:00
parent 8c0d575a6f
commit 9af356503d
2 changed files with 16 additions and 0 deletions
@@ -0,0 +1 @@
while_argument_side_effects_1() == 10099
@@ -0,0 +1,15 @@
object while_argument_side_effects_1_Counter{
var cnt = 0
fun isEnd():Boolean{
cnt += 1
return cnt < 10
}
}
fun while_argument_side_effects_1():Int{
var iter = 0
while(while_argument_side_effects_1_Counter.isEnd()){
iter += 1
}
return iter+ 1009*while_argument_side_effects_1_Counter.cnt
}