PR tree-optimization/81303
[official-gcc.git] / gcc / testsuite / gnat.dg / allocator_maxalign2.adb
blob10644ea6b3c20f391183119d1e5d314405287b16
1 with System, System.Storage_Elements;
2 use System.Storage_Elements;
4 package body Allocator_Maxalign2 is
6 Max_Align : constant Storage_Offset := Standard'Maximum_Alignment;
8 procedure Validate is
9 use type System.Address;
10 begin
11 if Addr mod Max_Align /= 0 then
12 raise Program_Error;
13 end if;
14 end;
16 procedure Check is
17 I : Integer;
18 B : Block;
19 type Block_Access is access all Block;
20 A : Block_Access;
21 begin
22 Addr := I'Address;
23 Addr := B'Address;
24 Validate;
25 for I in 1 .. 50 loop
26 A := new Block;
27 Addr := A.all'Address;
28 Validate;
29 end loop;
31 end;
33 end;