gcc/testsuite/gnat.dg/sso18.adb
raw| 1 | -- { dg-do run } |
| 2 | -- { dg-options "-O2" } |
| 3 | |
| 4 | with System; |
| 5 | |
| 6 | procedure SSO18 is |
| 7 | |
| 8 | type Arr is array (1..32) of Short_Integer; |
| 9 | type Rev_Arr is array (1..32) of Short_Integer |
| 10 | with Scalar_Storage_Order => System.High_Order_First; |
| 11 | C : constant Arr := (others => 16); |
| 12 | RA : Rev_Arr; |
| 13 | A : Arr; |
| 14 | |
| 15 | begin |
| 16 | RA := Rev_Arr(C); |
| 17 | A := Arr (RA); |
| 18 | if A /= C or else RA(1) /= 16 then |
| 19 | raise Program_Error; |
| 20 | end if; |
| 21 | end; |