fpc/tests/webtbs/tw8151a.pp
Jonas Maebe e5920bc2b8 * delay verbosity changes just like localswitches changes
* store a node's verbosity in the node so that e.g. disabling warnings
    also disables warnings for this node in pass_1
   (the above together fix mantis #12076)
  * save/restore verbosity with {$push}/{$pop} (mantis #12075)
  * if warnings/notes/hints are turned off, also do not count encountered
    ones for the totals (otherwise -Sew cannot be used properly in
    combination with {$warnings off}, because disabled warnings will still
    trigger a compiler error) -- this required adding -vw/-vn/-vh to all
    tests using -Sew/-Sen/-Seh
  - removed some superfluous state saving/restoring from firstpass()

git-svn-id: trunk@12025 -
2008-11-03 21:18:27 +00:00

38 lines
784 B
ObjectPascal

{ %opt=-Oodfa -Sew -vw }
{ %norun }
{$IFDEF FPC}
{$mode delphi}
{$ENDIF}
program FunctionResultAnalysisWrong;
uses
SysUtils;
var
I : longint;
function Test1: Integer;
begin
raise Exception.Create('');
end; {should NOT generate "Warning: Function result does not seem to be set" (doesn't in delphi, does in FPC) }
function Test2: Integer;
begin
if i > 0 then
raise Exception.Create('')
else
raise Exception.Create('');
end; {should NOT generate "Warning: Function result does not seem to be set" (doesn't in delphi, does in FPC) }
function Test4: Integer;
begin
if i > 0 then
raise Exception.Create('')
else
Result := 0;
end; {should NOT generate "Warning: Function result does not seem to be set" (doesn't in delphi and FPC) }
begin
i:=1;
end.