summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
Diffstat (limited to 't')
-rw-r--r--t/trivial.pas33
1 files changed, 33 insertions, 0 deletions
diff --git a/t/trivial.pas b/t/trivial.pas
index e515745..c537cf1 100644
--- a/t/trivial.pas
+++ b/t/trivial.pas
@@ -1,4 +1,12 @@
program a;
+const
+ gb=true;
+ gc='a';
+ gi=5;
+ gr=3.1415;
+ gs='nagi';
+var
+ gv:integer;
function arithmetic_test(a:integer;b:char;c:real):integer;
var
@@ -81,3 +89,28 @@ begin
until b>5;
branch_test:=a;
end;
+
+function name_test_global():integer;
+begin
+ gv:=1;
+ name_test_global:=gv+gb+gc+gi+gr+gs[3];
+end;
+
+function name_test_local():integer;
+const
+ gb=false;
+ gc='A';
+ gi=10;
+ gr=2.71828;
+ gs='Hanjie Wu';
+var
+ gv:integer;
+begin
+ gv:=0;
+ name_test_local:=gv+gb+gc+gi+gr+gs[3];
+end;
+
+function name_test():boolean;
+begin
+ name_test:=name_test_global()<>name_test_local()
+end;