Add test for bug regarding {$pop} next to a statement

git-svn-id: trunk@22264 -
This commit is contained in:
pierre 2012-08-29 14:30:14 +00:00
parent f1687fe8a6
commit 3c96d89a6b
2 changed files with 46 additions and 0 deletions

1
.gitattributes vendored
View File

@ -12817,6 +12817,7 @@ tests/webtbs/tw2268.pp svneol=native#text/plain
tests/webtbs/tw2269.pp svneol=native#text/plain
tests/webtbs/tw22705.pp svneol=native#text/plain
tests/webtbs/tw2274.pp svneol=native#text/plain
tests/webtbs/tw22744.pp svneol=native#text/pascal
tests/webtbs/tw2277.pp svneol=native#text/plain
tests/webtbs/tw2280.pp svneol=native#text/plain
tests/webtbs/tw2289.pp svneol=native#text/plain

45
tests/webtbs/tw22744.pp Normal file
View File

@ -0,0 +1,45 @@
{$mode objfpc}
uses
sysutils;
var
i,j,l : longint;
const
exception_seen : boolean = false;
begin
{$Q+}
i:=$78000000;
j:=$20000000;
l:=i-j;
{$push} {$q-}
l:=i+j; {$pop}
try
{$push} {$q-}
l:=i+j{$pop};
except on E : Exception do
begin
writeln('Simple {$Pop} exception ',E.Message);
exception_seen:=true;
end;
end;
try
{$q-} {$push}
l:=i+j{$q+}{$push};
l:=0;
{$pop}
{$pop}
except on E : Exception do
begin
writeln('Convoluted {$Q+}{$Push} Exception ',E.Message);
exception_seen:=true;
end;
end;
if exception_seen then
begin
writeln('This test failed');
halt(1);
end;
end.