diff test/testc3.py @ 307:e609d5296ee9

Massive rewrite of codegenerator
author Windel Bouwman
date Thu, 12 Dec 2013 20:42:56 +0100
parents b145f8e6050b
children 2e7f55319858
line wrap: on
line diff
--- a/test/testc3.py	Mon Dec 09 19:00:21 2013 +0100
+++ b/test/testc3.py	Thu Dec 12 20:42:56 2013 +0100
@@ -146,10 +146,9 @@
 
             a2 = b * a;
             c = a;
-            c = b > 1;
          }
         """
-        self.expectErrors(snippet, [8, 9, 10])
+        self.expectErrors(snippet, [8, 9])
 
     def testExpression1(self):
         snippet = """
@@ -186,7 +185,6 @@
     def testWhile(self):
         snippet = """
         module tstwhile;
-        var int a;
         function void t()
          {
          var int i;
@@ -194,9 +192,16 @@
          while (i < 1054)
          {
             i = i + 3;
-            a = a + i;
          }
+        }
+        """
+        self.expectOK(snippet)
 
+    def testWhile2(self):
+        snippet = """
+        module tstwhile;
+        function void t()
+         {
          while(true)
          {
          }
@@ -285,7 +290,7 @@
          function void t()
          {
             var struct {int x, y;} a;
-            a.b.c(9);
+            a.x(9);
          }
         """
         self.expectOK(snippet)
@@ -326,12 +331,12 @@
          {
             pa = 2; // type conflict
             pa = &a;
-            pa = &2;
+            pa = &2; // No valid lvalue
             &a = pa; // No valid lvalue
             **pa = 22; // Cannot deref int
          }
         """
-        self.expectErrors(snippet, [6, 9, 10])
+        self.expectErrors(snippet, [6, 8, 9, 10])
 
     def testPointerTypeIr(self):
         snippet = """