summaryrefslogtreecommitdiff
path: root/fpcsrc/tests/webtbs/tw16772.pp
blob: 68853e0e969aefa50eb26f4ff39761df49002817 (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
30
31
32
33
34
{$ifdef fpc}{$mode delphi}{$endif}
{$ifdef MSWindows}{$apptype console}{$endif}
uses
  SysUtils;

type
  PByteArray=^TByteArray; 
var
  g : array [byte] of byte;

function GetArray: PByteArray;
begin
  Result:=@g[0];
end;

var
  p : PByteArray;
begin
  g[0]:=111;
  g[1]:=221;
  g[2]:=252;
  
  p:=PByteArray(@GetArray[0]);
  if p[0]<>111 then
    halt(1);

  p:=PByteArray(@((GetArray))[1]);
  if p[0]<>221 then
    halt(2);

  p:=PByteArray(@(GetArray[2])); 
  if p[0]<>252 then
    halt(3);
end.