view gcc/testsuite/gnat.dg/discr16.adb @ 158:494b0b89df80 default tip

...
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Mon, 25 May 2020 18:13:55 +0900
parents 04ced10e8804
children
line wrap: on
line source

-- { 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;