aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gnat.dg/small_alignment.adb
blob: fbe1c21457c07d71481e067d5807c526a708b33d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
-- { dg-do run }
-- { dg-options "-gnatws" }

procedure Small_Alignment is

  type My_Integer is new Integer;
  for My_Integer'Alignment use 1;

  function Set_A return My_Integer is
  begin
    return 12;
  end;

  function Set_B return My_Integer is
  begin
    return 6;
  end;

  C : Character;
  A : My_Integer := Set_A;
  B : My_Integer := Set_B;

begin
  A := A * B / 2;
  if A /= 36 then
    raise Program_Error;
  end if;
end;