summaryrefslogtreecommitdiff
path: root/fpcsrc/tests/test/tchlp5.pp
blob: 5458812a8550fa5073f03376f3640f337bc8c25a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
{ the size of a class helper is equivalent to that of a pointer }
program tchlp5;

{$ifdef fpc}
  {$mode delphi}
{$endif}
{$apptype console}

type
  TTest = class
    s: String;
    i32: Integer;
    b: Boolean;
    i64: Int64;
  end;

  TTestHelper = class helper for TTest
  end;

var
  res: Integer;
begin
  res := SizeOf(TTestHelper);
  Writeln('SizeOf(TTest): ', SizeOf(TTest));
  Writeln('SizeOf(TTestHelper): ', res);
  if res <> SizeOf(Pointer) then
    Halt(1);
  Writeln('ok');
end.