blob: 02e53f09435a9b0358d302464235acdcad473e3c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
{ %opt=-Oodfa -Sew }
{ %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.
|