traise1.pp 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. { %RESULT=217 }
  2. {****************************************************************}
  3. { CODE GENERATOR TEST PROGRAM }
  4. { By Carl Eric Codere }
  5. {****************************************************************}
  6. { NODE TESTED : secondraise() }
  7. {****************************************************************}
  8. { PRE-REQUISITES: secondload() }
  9. { secondassign() }
  10. { secondtypeconv() }
  11. { secondtryexcept() }
  12. { secondcalln() }
  13. { secondadd() }
  14. {****************************************************************}
  15. { DEFINES: }
  16. { FPC = Target is FreePascal compiler }
  17. {****************************************************************}
  18. { REMARKS : Tested with Delphi 3 as reference implementation }
  19. {****************************************************************}
  20. program traise1;
  21. {$ifdef fpc}
  22. {$mode objfpc}
  23. {$endif}
  24. Type
  25. TAObject = class(TObject)
  26. a : longint;
  27. end;
  28. TBObject = Class(TObject)
  29. b : longint;
  30. constructor create(c: longint);
  31. end;
  32. { The test cases were taken from the SAL internal architecture manual }
  33. procedure fail;
  34. begin
  35. WriteLn('Failure.');
  36. halt(1);
  37. end;
  38. constructor tbobject.create(c:longint);
  39. begin
  40. inherited create;
  41. b:=c;
  42. end;
  43. var
  44. A: TAObject;
  45. Begin
  46. A:=TAobject.create;
  47. raise A;
  48. end.