summaryrefslogtreecommitdiff
path: root/tests/webtbs/tw6687.pp
blob: e7f4480be0934438d8063ea6c4a1b20884213277 (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
38
39
40
{ %cpu=i386 }
{ %target=win32,linux,freebsd }

{$ifdef fpc}
{$mode delphi}
{$endif}

{$w+}

{ should not generate a stack frame in spite of w+ above }
function testje(l1,l2,l3: longint): longint;
asm
  mov eax, 30000
  ret
end;

function test: longint;
var
  l1,l2,l3,l4,l5: cardinal;
begin
  test := 12345;
  l1 := $f00beef;
  l2 := $cafebabe;
  l3 := $c001d00d;
  l4 := $12345678;
  l5 := $90abcdef;
  if testje(1,2,3) <> 30000 then
    halt(1);
  if (l1 <> $f00beef) or
     (l2 <> $cafebabe) or
     (l3 <> $c001d00d) or
     (l4 <> $12345678) or
     (l5 <> $90abcdef) then
    halt(2);
end;

begin
  if test <> 12345 then
    halt(3);
end.