mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-08 02:07:11 +02:00
* case statement inline
This commit is contained in:
parent
5cc6ec76f4
commit
1fa574257d
41
tests/test/tinline3.pp
Normal file
41
tests/test/tinline3.pp
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
{$inline on}
|
||||||
|
|
||||||
|
var
|
||||||
|
err : boolean;
|
||||||
|
i : longint;
|
||||||
|
|
||||||
|
procedure p1(b:byte);inline;
|
||||||
|
begin
|
||||||
|
case b of
|
||||||
|
1 :
|
||||||
|
begin
|
||||||
|
writeln('1');
|
||||||
|
i:=1;
|
||||||
|
end;
|
||||||
|
2 :
|
||||||
|
begin
|
||||||
|
if i<>1 then
|
||||||
|
err:=true
|
||||||
|
else
|
||||||
|
writeln('2');
|
||||||
|
i:=2;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure p2(b:byte);inline;
|
||||||
|
begin
|
||||||
|
case b of
|
||||||
|
1 :
|
||||||
|
p1(b);
|
||||||
|
2 :
|
||||||
|
p1(b);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
begin
|
||||||
|
p2(1);
|
||||||
|
p2(2);
|
||||||
|
if err then
|
||||||
|
halt(1);
|
||||||
|
end.
|
Loading…
Reference in New Issue
Block a user