Debian Codegraph @

gcc/testsuite/gnat.dg/discr16.adb

raw
1 -- { dg-do compile }
2
3 with Discr16_G;
4 with Discr16_Cont; use Discr16_Cont;
5
6 procedure Discr16 is
7
8 generic
9 type T is (<>);
10 function MAX_ADD_G(X : T; I : INTEGER) return T;
11
12 function MAX_ADD_G(X : T; I : INTEGER) return T is
13 begin
14 return T'val(T'pos(X) + LONG_INTEGER(I));
15 end;
16
17 function MAX_ADD is new MAX_ADD_G(ES6A);
18
19 package P is new Discr16_G(ES6A, MAX_ADD);
20
21 begin
22 null;
23 end;