From 3c96d89a6b97de949f8bfc87596b7d9762fe1ac2 Mon Sep 17 00:00:00 2001 From: pierre Date: Wed, 29 Aug 2012 14:30:14 +0000 Subject: [PATCH] Add test for bug regarding {$pop} next to a statement git-svn-id: trunk@22264 - --- .gitattributes | 1 + tests/webtbs/tw22744.pp | 45 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 46 insertions(+) create mode 100644 tests/webtbs/tw22744.pp diff --git a/.gitattributes b/.gitattributes index a8835104a8..c22112c06b 100644 --- a/.gitattributes +++ b/.gitattributes @@ -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 diff --git a/tests/webtbs/tw22744.pp b/tests/webtbs/tw22744.pp new file mode 100644 index 0000000000..b5b0e43990 --- /dev/null +++ b/tests/webtbs/tw22744.pp @@ -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. + +