summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gnat.dg/unchecked_convert3.adb
blob: 1354752167916af72f567e76a08a06a7c4bc8488 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
-- { dg-do run }
-- { dg-options "-gnatVa" }

with Unchecked_Conversion;

procedure Unchecked_Convert3 is

  type Word is range -(2**15) .. (2**15) - 1;
  type UWord is mod (2**16);

  function To_Word is new unchecked_conversion (UWord, Word);

  function F return UWord is
  begin
    return 65036;
  end;

  W : Word := To_Word(F);

begin
  null;
end;