Browse Source

* check added

pierre 22 years ago
parent
commit
6263453375
1 changed files with 39 additions and 0 deletions
  1. 39 0
      tests/webtbs/tw2332.pp

+ 39 - 0
tests/webtbs/tw2332.pp

@@ -0,0 +1,39 @@
+{ Source provided for Free Pascal Bug Report 2332 }
+{ Submitted by "Sergey Kosarevsky" on  2003-01-21 }
+{ e-mail: [email protected] }
+
+{$static on }
+
+Type tObject=Object
+        Constructor Init;
+        Function GetVMT:Pointer;Static;
+        Destructor Done;Virtual;
+     End;
+
+Function tObject.GetVMT:Pointer;
+Begin
+   Exit(TypeOf(Self));
+End;
+
+Constructor tObject.Init;
+Begin
+End;
+
+Destructor tObject.Done;
+Begin
+End;
+
+Var O:tObject;
+
+Begin
+   O.Init;
+   WriteLn(Longint(TypeOf(tObject)));
+   WriteLn(Longint(O.GetVMT));
+   WriteLn(Longint(tObject.GetVMT));
+   if (O.GetVMT<>TypeOf(tObject)) or (TypeOf(tObject)<>tObject.GetVMT) then
+     begin
+       writeln('Error with typeof');
+       halt(1);
+     end;
+End.
+