diff --git a/tests/tbf/tb0125.pp b/tests/tbf/tb0125.pp new file mode 100644 index 0000000000..4113657b1f --- /dev/null +++ b/tests/tbf/tb0125.pp @@ -0,0 +1,25 @@ +{ %fail } +{ Returns this error under Delphi : +{ Error: Types of actual and formal var parameters must be identical } +{$ifdef fpc} +{$mode objfpc} +{$endif} +type + tsymbol = class + end; + + tderivedsymbol = class(tsymbol) + end; + + + +procedure testclass(var t: tsymbol); +begin +end; + +var + myclass : tderivedsymbol; +begin + myclass := tderivedsymbol.create; + testclass(myclass); +end. \ No newline at end of file diff --git a/tests/tbf/tb0126.pp b/tests/tbf/tb0126.pp new file mode 100644 index 0000000000..0358b167fc --- /dev/null +++ b/tests/tbf/tb0126.pp @@ -0,0 +1,25 @@ +{ %fail } +{ This program should fail compilation, since + the declaration is not the same as the actual + implementation, checked against Delphi 3 - + the class keyword is missing in front + of procedure tmyclass.myproc +} +{$ifdef fpc} +{$mode objfpc} +{$endif} +type + tmyclass = class + class procedure myproc;virtual; + end; + + { missing class keyword in front of procedure } + procedure tmyclass.myproc; + begin + end; + + +Begin +end. + + \ No newline at end of file diff --git a/tests/tbs/tb0408.pp b/tests/tbs/tb0408.pp new file mode 100644 index 0000000000..e87595a8d1 --- /dev/null +++ b/tests/tbs/tb0408.pp @@ -0,0 +1,22 @@ +{ This passes under Delphi and Borland pascal } +{ for objects, classes don't pass, cf. /tbf/tb0125 } +type + + tobjsymbol = object + end; + + tobjderivedsymbol = object(tobjsymbol) + end; + + + +procedure testobject(var t: tobjsymbol); +begin +end; + + +var + myobject : tobjderivedsymbol; +begin + testobject(myobject); +end. \ No newline at end of file