Explorar el Código

Moved forward globaldec test to error checks since this is not allowed

Taddeus Kroes hace 10 años
padre
commit
41cc55146d

+ 5 - 0
test/basic/check_error/forward_globaldec.cvc

@@ -0,0 +1,5 @@
+int foo() {
+    return glob;  // glob is not yet defined here
+}
+
+int glob;

+ 2 - 4
test/basic/check_success/function_scope.cvc

@@ -1,7 +1,5 @@
 void foo() {
-    bar(glob);  // Uses function and variable that are defined later than foo()
+    bar();  // Uses function that is defined later than foo()
 }
 
-void bar(int a) {}
-
-int glob;
+void bar() {}