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
/
p8
/
tst
/
expr.pcat
< prev
next >
Wrap
Text File
|
2006-01-29
|
894b
|
44 lines
(* This program tests IR code generation for arithmetic expressions. *)
program is
var x, y, z: integer := 0;
var a, b, c: real := 0.0;
begin
x := y;
x := 1234;
a := b;
a := 123.456;
x := - y;
x := + y;
x := y + z;
x := y - z;
x := y * z;
x := y div z;
x := y mod z;
a := - b;
a := + b;
a := b + c;
a := b - c;
a := b * c;
a := b / c;
a := x; (* Int-to-real conversion here. *)
a := 13; (* Int-to-real conversion here. *)
x := y + z + x + 6;
x := y + (z + (x + 7));
x := x * (y div -3) + x * (z - x mod 5);
x := 3 * y + 4 * (z - x);
a := 3.0 * b + 4.123 * (c - x);
x := (((+(-x - 1) div +(y - 2)) * (+(-z mod 3) + +(x div 4))) +
((-(+y - 5) + -(z - 6)) * (-(+x - 7) + -(y - 8))));
a := (((+(-b - 1.1) / +(c - 2.2)) * (+(-x / 3.3) + +(y / 4.4))) +
((-(+z - 5.5) + -(a - 6.6)) * (-(+b - 7.7) + -(c - 8.8))));
end;