pascalabcnet/TestSuite/sizeof1.pas

19 lines
388 B
ObjectPascal
Raw Permalink Normal View History

2021-11-07 12:14:35 +03:00
type TRec = record
2015-05-14 22:35:07 +03:00
a: integer;
b: real;
c: char;
end;
2021-11-07 12:14:35 +03:00
type
t1 = class
o: t1;
end;
2015-05-14 22:35:07 +03:00
begin
assert(sizeof(integer)=4);
assert(sizeof(real)=8);
assert(sizeof(char)=2);
assert(sizeof(pointer)=System.Runtime.InteropServices.Marshal.SizeOf(typeof(pointer)));
assert(sizeof(TRec)=System.Runtime.InteropServices.Marshal.SizeOf(typeof(TRec)));
2021-11-07 12:14:35 +03:00
assert(sizeof(t1) > 0);
2015-05-14 22:35:07 +03:00
end.