diff --git a/tests/test/testop.pp b/tests/test/testop.pp new file mode 100644 index 0000000000..0dddf8656d --- /dev/null +++ b/tests/test/testop.pp @@ -0,0 +1,15 @@ +uses + testop1,testop2; + +var + a,b,c : op1; + d,e,f : op2; + +begin + a.x:=67;a.y:=-45; + b.x:=89;b.y:=23; + c:=a+b; + e.x:=67;e.y:=-45; + f.x:=89;f.y:=23; + d:=e+f; +end. \ No newline at end of file diff --git a/tests/test/testop1.pp b/tests/test/testop1.pp new file mode 100644 index 0000000000..d04813dddb --- /dev/null +++ b/tests/test/testop1.pp @@ -0,0 +1,20 @@ +unit testop1; + +interface + +type + op1 = record + x,y : longint; + end; + +operator + (const a,b : op1) c : op1; + +implementation + +operator + (const a,b : op1) c : op1; +begin + c.x:=a.x+b.x; + c.y:=a.y+b.y; +end; + +end. \ No newline at end of file diff --git a/tests/test/testop2.pp b/tests/test/testop2.pp new file mode 100644 index 0000000000..58ffd470ae --- /dev/null +++ b/tests/test/testop2.pp @@ -0,0 +1,20 @@ +unit testop2; + +interface + +type + op2 = record + x,y : longint; + end; + +operator + (const a,b : op2) c : op2; + +implementation + +operator + (const a,b : op2) c : op2; +begin + c.x:=a.x+b.x; + c.y:=a.y+b.y; +end; + +end. \ No newline at end of file