taoc2.pp 532 B

123456789101112131415161718192021222324252627282930313233
  1. { %FAIL }
  2. { second simple array of const test }
  3. { there is no way to know the address of anything
  4. as the array of const is pushed directly }
  5. {$mode objfpc}
  6. program test_cdecl_array_of_const;
  7. var
  8. l : longint;
  9. const
  10. has_errors : boolean = false;
  11. procedure test(format : pchar; const args : array of const; var ll : longint);cdecl;
  12. begin
  13. ll:=5;
  14. end;
  15. begin
  16. l:=4;
  17. test('dummy',[],l);
  18. if l<>5 then
  19. has_errors:=true;
  20. l:=4;
  21. test('dummy',[345],l);
  22. if l<>5 then
  23. has_errors:=true;
  24. if has_errors then
  25. halt(1);
  26. end.