aboutsummaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
Diffstat (limited to 'src/test')
-rw-r--r--src/test/run-pass/while-and-do-while.rs14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/test/run-pass/while-and-do-while.rs b/src/test/run-pass/while-and-do-while.rs
new file mode 100644
index 00000000..ebf78099
--- /dev/null
+++ b/src/test/run-pass/while-and-do-while.rs
@@ -0,0 +1,14 @@
+fn main() {
+ let int x = 10;
+ let int y = 0;
+ while(y < x) {
+ log y;
+ log "hello";
+ y = y + 1;
+ }
+ do {
+ log "goodbye";
+ x = x - 1;
+ log x;
+ } while (x > 0);
+} \ No newline at end of file