소스 검색

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