mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-28 11:59:12 +02:00
Add test for bug regarding {$pop} next to a statement
git-svn-id: trunk@22264 -
This commit is contained in:
parent
f1687fe8a6
commit
3c96d89a6b
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -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
45
tests/webtbs/tw22744.pp
Normal 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.
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user