1-- PR rtl-optimization/45394
2
3-- { dg-do compile }
4-- { dg-options "-O2 -g" }
5
6package body Opt6 is
7
8   function Current_Parameter (Iter : Command_Line_Iterator) return String is
9   begin
10      if Iter.Params = null
11        or else Iter.Current > Iter.Params'Last
12        or else Iter.Params (Iter.Current) = null
13      then
14         return "";
15
16      else
17         declare
18            P : constant String := Iter.Params (Iter.Current).all;
19
20         begin
21            --  Skip separator
22
23            return P (P'First + 1 .. P'Last);
24         end;
25      end if;
26   end Current_Parameter;
27
28end Opt6;
29