Debian Codegraph @

gcc/testsuite/gnat.dg/specs/alignment2.ads

raw
1 -- { dg-do compile }
2
3 with Interfaces; use Interfaces;
4
5 package Alignment2 is
6
7 pragma Warnings (Off, "*size*");
8
9 -- warning
10 type R1 is record
11 A, B, C, D : Integer_8;
12 end record;
13 for R1'Size use 32;
14 for R1'Alignment use 32; -- { dg-warning "suspiciously large alignment" }
15
16 -- warning
17 type R2 is record
18 A, B, C, D : Integer_8;
19 end record;
20 for R2'Alignment use 32; -- { dg-warning "suspiciously large alignment" }
21
22 -- OK, big size
23 type R3 is record
24 A, B, C, D : Integer_8;
25 end record;
26 for R3'Size use 32 * 8;
27 for R3'Alignment use 32;
28
29 -- OK, big size
30 type R4 is record
31 A, B, C, D, E, F, G, H : Integer_32;
32 end record;
33 for R4'Alignment use 32;
34
35 end Alignment2;