PR tree-optimization/81303
[official-gcc.git] / gcc / testsuite / gnat.dg / string_slice.adb
blobc14ae49b7b7d9a02789004f981deaa05ec827f88
1 -- { dg-do run }
2 -- { dg-options "-O" }
4 procedure string_slice is
6 subtype Key_T is String (1 .. 3);
8 function One_Xkey return Key_T is
9 Key : Key_T := "XXX";
10 begin
11 Key (1 .. 2) := "__";
12 return Key;
13 end;
15 Key : Key_T := One_Xkey;
17 begin
18 if Key (3) /= 'X' then
19 raise Program_Error;
20 end if;
21 end;