summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gnat.dg/discr42.adb
blob: e3380b889bafcda9b4068b696da2b32f4801d322 (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 }

with Discr42_Pkg; use Discr42_Pkg;

procedure Discr42 is

  R : Rec;
  Pos : Natural := 1;

begin

  R := F (Pos);

  if Pos /= 2 then
    raise Program_Error;
  end if;

  if R /= (D => True, N => 4) then
    raise Program_Error;
  end if;

end;