瀏覽代碼

+ New test for compile time things
+ Moved part from tmacpas4.pp

olle 20 年之前
父節點
當前提交
91c8da4e1a
共有 1 個文件被更改,包括 49 次插入0 次删除
  1. 49 0
      tests/test/tmacpas4.pp

+ 49 - 0
tests/test/tmacpas4.pp

@@ -0,0 +1,49 @@
+{%NORUN}
+{$MODE MACPAS}
+
+{Tests of mac pascal constructs, concerning compile time constructs}
+
+{** Test Compiler variables **}
+
+{$SETC ADAM := TRUE}
+{$IFC ADAM <> TRUE}
+{$ERRORC Test failed}
+{$ENDC}
+
+{$SETC BERTIL := FALSE}
+{$IFC BERTIL = FALSE}
+{  OK  }
+{$ELSEC}
+{$ERRORC Test failed}
+{$ENDC}
+
+{** Test Defined/Undefined **}
+
+{$IFC UNDEFINED FPC_MACPAS}
+{$ERRORC Test failed}
+{$ENDC}
+
+{$IFC NOT DEFINED FPC_MACPAS}
+{$ERRORC Test failed}
+{$ENDC}
+
+{** Test Push/Pop **}
+
+{$J-}
+
+{$PUSH}
+{$PUSH}
+
+{$J+}
+
+{$POP}
+{$POP}
+
+{$IFC OPTION(J)}
+{$ERRORC $PUSH/$POP doesnt work properly}
+{$ENDC}
+
+program tmacpas4;
+
+begin
+end.