tderef.pp 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. {****************************************************************}
  2. { CODE GENERATOR TEST PROGRAM }
  3. {****************************************************************}
  4. { NODE TESTED : secondderef() }
  5. {****************************************************************}
  6. { PRE-REQUISITES: secondload() }
  7. { secondassign() }
  8. { secondcalln() }
  9. { secondadd() }
  10. { secondtypeconv() }
  11. {****************************************************************}
  12. { DEFINES: }
  13. {****************************************************************}
  14. { REMARKS: }
  15. {****************************************************************}
  16. program tderef;
  17. type
  18. plongint = ^longint;
  19. ttestarray = array[1..64] of byte;
  20. ptestarray = ^ttestarray;
  21. pbyte = ^byte;
  22. var
  23. pl : plongint;
  24. parray : ptestarray;
  25. passed : boolean;
  26. ptr : pbyte;
  27. b: byte;
  28. Begin
  29. Write('secondderef() test...');
  30. passed := true;
  31. new(pl);
  32. new(parray);
  33. { left : LOC_REFERENCE }
  34. pl^:= $F0F0;
  35. if pl^ <> $F0F0 then
  36. passed := false;
  37. FillChar(parray^,sizeof(ttestarray),0);
  38. ptr:=pbyte((longint(parray)+32));
  39. ptr^ := $A0;
  40. if parray^[33] <> $A0 then
  41. passed := false;
  42. { left : LOC_REGISTER }
  43. b:=(pbyte((longint(parray)+32))^);
  44. if b <> $A0 then
  45. passed := false;
  46. dispose(pl);
  47. dispose(parray);
  48. if passed then
  49. WriteLn('Success.')
  50. else
  51. WriteLn('Failure.');
  52. end.
  53. {
  54. $Log$
  55. Revision 1.1 2001-06-30 02:02:06 carl
  56. + secondderef()
  57. }