summaryrefslogtreecommitdiff
path: root/tests/test/treadonlydata2.pp
blob: 405b38f736a41309fefa6e37bdc09995bbd7474e (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
{%FAIL }

program treadonlydata2;

{$if defined(msdos) or defined(hasamiga) or defined(atari) or defined(palmos)}
  {$define target_does_not_support_rodata}
{$ekse}
  {$define target_supports_rodata}
{$endif}

{$mode  objfpc}
{$J-}
const
  c = 89;
  rc: LongInt = 5;
var
  p : pbyte;

begin
{$ifndef target_does_not_support_rodata}
  rc := 42;
{$else}
  { dummy code to also get a compile time error }
  p:=@c;
{$endif}
end.