fpc/tests/test/tisorec2.pp
florian 2fdd3e2d0a + introduce tvariantrecbranch to be able to store
all needed information for iso compatible variant records
* new for variant records as required by iso pascal
+ tests

git-svn-id: trunk@24241 -
2013-04-14 15:50:42 +00:00

27 lines
420 B
ObjectPascal

{ %fail }
{$mode iso}
type
tr = record
l : longint;
case i : integer of
1 : (s : array[0..255] of char);
2 : (n : integer);
3 : (w : word; case j : integer of
1 : (s : array[0..255] of char);
2 : (a : integer);
);
end;
pr = ^tr;
var
r : pr;
begin
new(r,3,2,4);
if r^.i<>3 then
halt(1);
if r^.j<>2 then
halt(1);
dispose(r);
writeln('ok');
end.