summaryrefslogtreecommitdiff
path: root/fpcsrc/tests/webtbs/tw8935.pp
blob: a4397d391afe77a4ba976346b2d0b3e4f3207634 (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
{%target=win32,win64,wince}
{%cpu=x86_64,i386,arm}
{%result=229}

{$mode objfpc}

procedure DoTest1; safecall;
var
  i: integer;
begin
  i:=-1;
  i:=i - 1;
end;

function DoTest2: longint; safecall;
begin
  DoTest2:=$12345678;
end;

procedure DoTest3; safecall;
begin
  PChar(nil)^:='A';
end;

begin
  try
    DoTest1;
  except
    ErrorAddr:=nil;
    Halt(1);
  end;
  if DoTest2 <> $12345678 then
    Halt(2);
  DoTest3;
end.