gcc/testsuite/gnat.dg/specs/storage_offset1.ads
raw| 1 | -- { dg-do compile } |
| 2 | |
| 3 | with System.Storage_Elements; use System.Storage_Elements; |
| 4 | with System; |
| 5 | |
| 6 | package Storage_Offset1 is |
| 7 | |
| 8 | type Rec is record |
| 9 | I1, I2 : Integer; |
| 10 | end record; |
| 11 | |
| 12 | type Ptr is access all Rec; |
| 13 | |
| 14 | R : Ptr := new Rec; |
| 15 | |
| 16 | Offset : constant Storage_Offset := R.I1'Address - R.I2'Address; |
| 17 | |
| 18 | end Storage_Offset1; |