2015-05-04 Andrew Sutton <andrew.n.sutton@gmail.com>
[official-gcc.git] / gcc / testsuite / gnat.dg / assert1.adb
blobd761cd0d99090c2836e96957625577219dd7648b
1 -- { dg-do run }
2 -- { dg-options "-gnatws" }
4 pragma Assertion_Policy (Check);
5 with Text_IO; use Text_IO;
6 procedure assert1 is
7 type p1 is array (1 .. 113) of Boolean;
8 pragma Pack (p1);
9 type p2 is array (1 .. 13) of Boolean;
10 pragma Pack (p2);
11 type p3 is array (1 .. 113) of Boolean;
12 pragma Pack (p3);
13 for p3'size use 113;
14 type p4 is array (1 .. 13) of Boolean;
15 pragma Pack (p4);
16 for p4'size use 13;
17 v1 : p1;
18 v2 : p2;
19 v3 : p3;
20 v4 : p4;
21 begin
22 pragma Assert (p1'Size = 120);
23 pragma Assert (p2'Size = 13);
24 pragma Assert (p3'Size = 113);
25 pragma Assert (p4'Size = 13);
26 pragma Assert (p1'Value_Size = 120);
27 pragma Assert (p2'Value_Size = 13);
28 pragma Assert (p3'Value_Size = 113);
29 pragma Assert (p4'Value_Size = 13);
30 pragma Assert (p1'Object_Size = 120);
31 pragma Assert (p2'Object_Size = 16);
32 pragma Assert (p3'Object_Size = 120);
33 pragma Assert (p4'Object_Size = 16);
34 pragma Assert (v1'Size = 120);
35 pragma Assert (v2'Size = 16);
36 pragma Assert (v3'Size = 120);
37 pragma Assert (v4'Size = 16);
38 null;
39 end;