Просмотр исходного кода

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

Taddeus Kroes 10 лет назад
Родитель
Сommit
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() {
 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() {}