home *** CD-ROM | disk | FTP | other *** search
/ ftp.ee.pdx.edu / 2014.02.ftp.ee.pdx.edu.tar / ftp.ee.pdx.edu / pub / users / Harry / compilers / p11 / tst / alloc2.pcat < prev    next >
Text File  |  2006-03-05  |  1KB  |  49 lines

  1. (* This program tests IRallocate, IRloadIndirect, and IRstore. *)
  2.  
  3. program is
  4.  
  5.   type R is record
  6.               f1: integer;
  7.               f2: real;
  8.               f3: boolean;
  9.               f4: integer;
  10.               f5: real;
  11.               f6: R2;
  12.             end;
  13.   type R2 is record
  14.               f1: integer;
  15.               f2: real;
  16.               f3: boolean;
  17.               f4: integer;
  18.               f5: real;
  19.             end;
  20.   var p: R := nil;
  21.  
  22. begin
  23.  
  24.   p := R {f1 := 123;
  25.           f2 := 123.456;
  26.           f3 := true;
  27.           f4 := 321;
  28.           f5 := 654.321;
  29.           f6 := R2 {f1 := 111;
  30.                     f2 := 222.333;
  31.                     f3 := false;
  32.                     f4 := 444;
  33.                     f5 := 555.666
  34.                    }
  35.          };
  36.   write ("Should print 123...", p.f1);
  37.   write ("Should print 123.456...", p.f2);
  38.   write ("Should print TRUE...", p.f3);
  39.   write ("Should print 321...", p.f4);
  40.   write ("Should print 654.321...", p.f5);
  41.   write ("Should print 111...", p.f6.f1);
  42.   write ("Should print 222.333...", p.f6.f2);
  43.   write ("Should print FALSE...", p.f6.f3);
  44.   write ("Should print 444...", p.f6.f4);
  45.   write ("Should print 555.666...", p.f6.f5);
  46.  
  47. end;
  48.  
  49.