PR tree-optimization/81303
[official-gcc.git] / gcc / testsuite / gnat.dg / test_enum_io.adb
blob10771c99f85181f5087ad2ec87931310ab32c86c
1 -- { dg-do run }
3 with Ada.Text_IO;
4 use Ada.Text_IO;
6 procedure Test_Enum_IO is
8 type Enum is (Literal);
9 package Enum_IO is new Enumeration_IO (Enum);
10 use Enum_IO;
12 File : File_Type;
13 Value: Enum;
14 Rest : String (1 ..30);
15 Last : Natural;
17 begin
19 Create (File, Mode => Out_File);
20 Put_Line (File, "Literax0000000l note the 'l' at the end");
22 Reset (File, Mode => In_File);
23 Get (File, Value);
24 Get_Line (File, Rest, Last);
26 Close (File);
28 Put_Line (Enum'Image (Value) & Rest (1 .. Last));
29 raise Program_Error;
31 exception
32 when Data_Error => null;
33 end Test_Enum_IO;