Forráskód Böngészése

Added test file for for-loops

Taddeus Kroes 12 éve
szülő
commit
c8e344835d
1 módosított fájl, 20 hozzáadás és 0 törlés
  1. 20 0
      test/for_to_while.cvc

+ 20 - 0
test/for_to_while.cvc

@@ -0,0 +1,20 @@
+extern int printInt(int n);
+
+void foo() {
+    void bar() {
+        for (int i = 0, 10)
+            printInt(i);
+    }
+}
+
+export void main() {
+    for (int i = 0, 10)
+        printInt(i);
+
+    for (int i = 0, 10, -1)
+        printInt(i);
+
+    for (int i = 0, 10)
+        for (int j = 10, 20)
+            printInt(i + j);
+}