aboutsummaryrefslogtreecommitdiff
path: root/testsuite/runnable/generic_pointer_arithmetic.elna
blob: abbca4b5f4f0e5c92fc6ffbfe5095008bd4a41b2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
program()
var
  base: [4]Int
  element: ^Int
  first: ^Word8
  second: ^Word8

begin
  element := base.ptr;
  first := cast(element: ^Word8);
  second := first + 1;
  assert(cast(second: Word) - cast(first: Word) = 1u);
  assert(second - 1 = first)
end.