ivarol32.pp 785 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. {$ifndef bigfile}
  2. {$ifdef fpc}
  3. {$mode delphi}
  4. {$else fpc}
  5. {$define FPC_HAS_TYPE_EXTENDED}
  6. {$endif fpc}
  7. {$endif bigfile}
  8. type
  9. {$ifdef FPC_COMP_IS_INT64}
  10. comp32 = double;
  11. {$else FPC_COMP_IS_INT64}
  12. comp32 = comp;
  13. {$endif FPC_COMP_IS_INT64}
  14. procedure test32(a: comp32); overload;
  15. begin
  16. writeln('comp32 called instead of char');
  17. end;
  18. procedure test32(a: char); overload;
  19. begin
  20. writeln('char called instead of comp32');
  21. halt(1)
  22. end;
  23. var
  24. x32: comp32;
  25. y32: char;
  26. procedure dotest32;
  27. var
  28. v: variant;
  29. begin
  30. try
  31. v := x32;
  32. test32(v);
  33. except
  34. on E : TObject do
  35. halt(1);
  36. end;
  37. try
  38. v := y32;
  39. test32(v);
  40. except
  41. on E : TObject do
  42. writeln('VVV');
  43. end;
  44. end;
  45. {$ifndef bigfile} begin
  46. dotest32;
  47. end. {$endif not bigfile}