aboutsummaryrefslogtreecommitdiff
path: root/testsuite/runnable/pointer_subtraction.elna
blob: 41d45f631162a15c18f8e89cd320b85753290a6c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
program()
var
  a: [4]Int
  first: ^Int
  third: ^Int
  diff: Int
  c: ^const Int
  diff_const: Int

begin
  first := @a[1];
  third := @a[3];
  diff := third - first;
  c := third;
  diff_const := c - first;
  assert(diff = 2);
  assert(diff_const = 2)
end.