bug0198.pp 553 B

12345678910111213141516171819202122232425262728293031
  1. {$mode fpcobj}
  2. type
  3. to1 = class (tobject)
  4. x : longint;
  5. constructor init;
  6. function GetCaps1 : Longint;virtual;abstract;
  7. function GetCaps2 : Longint;virtual;stdcall;
  8. function GetCaps : Longint;virtual;stdcall;abstract;
  9. destructor done;virtual;
  10. end;
  11. constructor to1.init;
  12. begin
  13. x:=5;
  14. end;
  15. function to1.GetCaps2 : longint;
  16. begin
  17. GetCaps2:=x;
  18. end;
  19. destructor to1.done;
  20. begin
  21. end;
  22. var o1 : to1;
  23. begin
  24. o1:=to1.create;
  25. if o1.getCaps2<>5 then halt(1);
  26. end.