浏览代码

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

Taddeus Kroes 10 年之前
父节点
当前提交
41cc55146d
共有 2 个文件被更改,包括 7 次插入4 次删除
  1. 5 0
      test/basic/check_error/forward_globaldec.cvc
  2. 2 4
      test/basic/check_success/function_scope.cvc

+ 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() {}