gcc/testsuite/gnat.dg/opt41.adb
raw| 1 | -- { dg-do run } |
| 2 | -- { dg-options "-Os" } |
| 3 | |
| 4 | with Ada.Strings.Unbounded; use Ada.Strings.Unbounded; |
| 5 | with Opt41_Pkg; use Opt41_Pkg; |
| 6 | |
| 7 | procedure Opt41 is |
| 8 | R : Rec := (Five, To_Unbounded_String ("CONFIG")); |
| 9 | SP : String_Access := new String'(To_String (Rec_Write (R))); |
| 10 | RP : Rec_Ptr := new Rec'(Rec_Read (SP)); |
| 11 | begin |
| 12 | if RP.D /= R.D then |
| 13 | raise Program_Error; |
| 14 | end if; |
| 15 | end; |