mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-14 02:19:30 +02:00
25 lines
523 B
ObjectPascal
25 lines
523 B
ObjectPascal
{ %fail }
|
|
{%opt=-O- }
|
|
{ This function defines a local var which needs stack space,
|
|
so nostackframe should always be invalid.
|
|
-O- option used because with -O3 both result
|
|
and x variable can be regvars, so that there is no error! }
|
|
|
|
function test : longint; nostackframe;
|
|
var
|
|
x : longint;
|
|
begin
|
|
x:=4;
|
|
test:=5*x;
|
|
end;
|
|
|
|
begin
|
|
if test<>20 then
|
|
begin
|
|
writeln('Wrong result in nostackframe non-assembler function');
|
|
halt(1);
|
|
end
|
|
else
|
|
writeln('Pascal function nostackframe works OK');
|
|
end.
|