added test cases for comming macpas features

git-svn-id: trunk@2302 -
This commit is contained in:
olle 2006-01-15 21:55:07 +00:00
parent dadbbb32ce
commit 58f59b9134
4 changed files with 119 additions and 0 deletions

3
.gitattributes vendored
View File

@ -5622,6 +5622,9 @@ tests/test/tintuint.pp svneol=native#text/plain
tests/test/tlibrary1.pp svneol=native#text/plain
tests/test/tlibrary2.pp svneol=native#text/plain
tests/test/tmacfunret.pp svneol=native#text/plain
tests/test/tmaclocalprocparam.pp svneol=native#text/plain
tests/test/tmacnonlocalexit.pp svneol=native#text/plain
tests/test/tmacnonlocalgoto.pp svneol=native#text/plain
tests/test/tmacpas1.pp svneol=native#text/plain
tests/test/tmacpas2.pp svneol=native#text/plain
tests/test/tmacpas3.pp svneol=native#text/plain

View File

@ -0,0 +1,43 @@
program tmaclocalprocparam;
{$MODE MACPAS}
var
failed: Boolean;
procedure Outside (procedure P);
begin
P;
end;
procedure Global;
var
nonlocalvar: integer;
procedure Local;
begin
nonlocalvar := 42;
end;
begin
nonlocalvar := 24;
Outside(Local);
failed := (nonlocalvar <> 42);
end;
begin
Global;
if failed then
writeln('Failed')
else
writeln('Succeded');
{$IFC UNDEFINED THINK_Pascal}
if failed then
Halt(1);
{$ENDC}
end.

View File

@ -0,0 +1,35 @@
program tmacnonlocalexit;
{$MODE MACPAS}
var
failed: Boolean;
procedure Global;
procedure Local;
begin
Exit(Global);
failed := true;
end;
begin
Local;
failed := true;
end;
begin
failed := false;
Global;
if failed then
writeln('Failed')
else
writeln('Succeded');
{$IFC NOT UNDEFINED FPC}
if failed then
Halt(1);
{$ENDC}
end.

View File

@ -0,0 +1,38 @@
program tmacnonlocalgoto;
{$MODE MACPAS}
label
1;
var
failed: Boolean;
procedure Global;
procedure Local;
begin
goto 1;
failed := true;
end;
begin
Local;
failed := true;
end;
begin
failed := false;
Global;
1:
if failed then
writeln('Failed')
else
writeln('Succeded');
{$IFC NOT UNDEFINED FPC}
if failed then
Halt(1);
{$ENDC}
end.