tnostackframe.pp 643 B

12345678910111213141516171819202122232425262728
  1. { %fail }
  2. { %opt=-Sew }
  3. { This is a border case:
  4. the result could be considered to reside only in
  5. the function result register,
  6. in which case no stack space would be required... }
  7. { This is the reason of the -Sew option,
  8. this test must fail because a warning sould be issued
  9. about nostackframe without assembler.
  10. Please do not remove -Sew option. PM 2012-10-17 }
  11. function test : longint; nostackframe;
  12. begin
  13. test:=5;
  14. end;
  15. begin
  16. if test<>5 then
  17. begin
  18. writeln('Wrong result in nostackframe non-assembler function');
  19. halt(1);
  20. end
  21. else
  22. writeln('Pascal function nostackframe works OK');
  23. end.