taoc1.pp 426 B

12345678910111213141516171819202122232425262728293031
  1. { first simple array of const test }
  2. {$mode objfpc}
  3. program test_cdecl_array_of_const;
  4. var
  5. l : longint;
  6. const
  7. has_errors : boolean = false;
  8. procedure test(var ll : longint;format : pchar; const args : array of const);cdecl;
  9. begin
  10. ll:=5;
  11. end;
  12. begin
  13. l:=4;
  14. test(l,'dummy',[]);
  15. if l<>5 then
  16. has_errors:=true;
  17. l:=4;
  18. test(l,'dummy',[345]);
  19. if l<>5 then
  20. has_errors:=true;
  21. if has_errors then
  22. halt(1);
  23. end.