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 / p10 / tst / array2.pcat < prev    next >
Text File  |  2006-02-17  |  811b  |  34 lines

  1. (* This program tests IR code generation for array constructors. *)
  2.  
  3. program is
  4.     var a1, a2, a3, a4, a5: T1 := nil;
  5.         b1: B1 := nil;
  6.         c1: T2 := nil;
  7.         x: real := 0.0;
  8.         i: integer := 0;
  9.  
  10.     type T1 is array of integer;
  11.     type T2 is array of T1;
  12.  
  13.     type B1 is array of real;
  14.  
  15.     begin
  16.  
  17.       a1 := T1 {{ 11, 12, 13, 14, 15 }};
  18.  
  19.       b1 := B1 {{ 1.1, 1.2, 1.3, 1.4, 1.5 }};
  20.  
  21.       a2 := T1 {{ i*11, i*12, i*13, i*14, i*15 }};
  22.  
  23.       a3 := T1 {{ 100 of 11111, 200 of 22222, 300 of 33333, 400 of 44444 }};
  24.  
  25.       a3 := T1 {{ 100*i of 11111, 200*i of 22222, 300*i of 33333 }};
  26.  
  27.       a4 := T1 {{ 100 of 11111, 22222, 33333, 400 of 44444, 555555 }};
  28.  
  29.       a5:= T1 {{ i*100 of 111, 222, 333, i*400 of 444, 555 }};
  30.  
  31.       c1 := T2 {{ a1, a2, 100 of a3, 200*i of a4, a5 }};
  32.  
  33.     end;
  34.