summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gnat.dg/discr16.adb
blob: c4c24fd4d9c1481025057b3be907570ec3006c9a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
-- { dg-do compile }

with Discr16_G;
with Discr16_Cont; use Discr16_Cont;

procedure Discr16 is

  generic
    type T is (<>);
  function MAX_ADD_G(X : T; I : INTEGER) return T;

  function MAX_ADD_G(X : T; I : INTEGER) return T is
  begin
    return T'val(T'pos(X) + LONG_INTEGER(I));
  end;

  function MAX_ADD is new MAX_ADD_G(ES6A);

  package P is new Discr16_G(ES6A, MAX_ADD);

begin
  null;
end;