1-- { dg-do run }
2-- { dg-options "-gnatVa" }
3
4with Unchecked_Conversion;
5
6procedure Unchecked_Convert3 is
7
8  type Word is range -(2**15) .. (2**15) - 1;
9  type UWord is mod (2**16);
10
11  function To_Word is new unchecked_conversion (UWord, Word);
12
13  function F return UWord is
14  begin
15    return 65036;
16  end;
17
18  W : Word := To_Word(F);
19
20begin
21  null;
22end;
23