gcc/testsuite/gnat.dg/array34.adb
raw| 1 | -- { dg-do run } |
| 2 | |
| 3 | procedure Array34 is |
| 4 | |
| 5 | type Arr is array (1 .. 6) of Short_Short_Integer; |
| 6 | for Arr'Alignment use 4; |
| 7 | |
| 8 | type Rec is record |
| 9 | A : Arr; |
| 10 | B: Short_Integer; |
| 11 | end record; |
| 12 | pragma Pack (Rec); |
| 13 | |
| 14 | R : Rec; |
| 15 | |
| 16 | begin |
| 17 | R.B := 31415; |
| 18 | R.A := (others => 0); |
| 19 | if R.B /= 31415 then |
| 20 | raise Program_Error; |
| 21 | end if; |
| 22 | end; |