diff --git a/translator/src/test/kotlin/tests/input/while_argument_side_effects_1.txt b/translator/src/test/kotlin/tests/input/while_argument_side_effects_1.txt new file mode 100644 index 00000000000..aab348e4066 --- /dev/null +++ b/translator/src/test/kotlin/tests/input/while_argument_side_effects_1.txt @@ -0,0 +1 @@ +while_argument_side_effects_1() == 10099 diff --git a/translator/src/test/kotlin/tests/kotlin/while_argument_side_effects_1.kt b/translator/src/test/kotlin/tests/kotlin/while_argument_side_effects_1.kt new file mode 100644 index 00000000000..85599858a3c --- /dev/null +++ b/translator/src/test/kotlin/tests/kotlin/while_argument_side_effects_1.kt @@ -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 +} \ No newline at end of file