tw0934.pp 393 B

12345678910111213141516171819202122
  1. { %OPT=-Or }
  2. { %CPU=i386 }
  3. { -Or option is not recognized by m68k compiler }
  4. {$mode objfpc}
  5. Type
  6. t = class(TObject)
  7. f1,f2:dword;
  8. constructor Init(p1, p2:dword);
  9. end;
  10. constructor t.Init(p1, p2:dword);
  11. begin
  12. f1:=p1; f2:=p2;
  13. end;
  14. var ti:t;
  15. begin
  16. ti:=t.Init(1,2);
  17. writeln(ti.f1, ', ', ti.f2); // prints garbage instead of t2
  18. if ti.f2<>2 then
  19. Halt(1);
  20. end.