2 -- { dg-options "-gnatws -O3" }
3 -- { dg-options "-gnatws -O3 -msse" { target i?86-*-* x86_64-*-* } }
5 with System.Soft_Links;
7 package body Loop_Optimization9 is
9 package SSL renames System.Soft_Links;
11 First_Temp_File_Name : constant String := "GNAT-TEMP-000000.TMP";
13 Current_Temp_File_Name : String := First_Temp_File_Name;
15 Temp_File_Name_Last_Digit : constant Positive :=
16 First_Temp_File_Name'Last - 4;
18 function Argument_String_To_List
19 (Arg_String : String) return Argument_List_Access
21 Max_Args : constant Integer := Arg_String'Length;
22 New_Argv : Argument_List (1 .. Max_Args);
23 New_Argc : Natural := 0;
27 Idx := Arg_String'First;
30 exit when Idx > Arg_String'Last;
33 Quoted : Boolean := False;
34 Backqd : Boolean := False;
41 -- An unquoted space is the end of an argument
43 if not (Backqd or Quoted)
44 and then Arg_String (Idx) = ' '
48 -- Start of a quoted string
50 elsif not (Backqd or Quoted)
51 and then Arg_String (Idx) = '"'
55 -- End of a quoted string and end of an argument
57 elsif (Quoted and not Backqd)
58 and then Arg_String (Idx) = '"'
63 -- Following character is backquoted
65 elsif Arg_String (Idx) = '\' then
68 -- Turn off backquoting after advancing one character
76 exit when Idx > Arg_String'Last;
81 New_Argc := New_Argc + 1;
82 New_Argv (New_Argc) :=
83 new String'(Arg_String (Old_Idx .. Idx - 1));
87 return new Argument_List'(New_Argv (1 .. New_Argc));
88 end Argument_String_To_List;
90 procedure Create_Temp_File_Internal
91 (FD : out File_Descriptor;
92 Name : out String_Access)
98 Pos := Temp_File_Name_Last_Digit;
102 case Current_Temp_File_Name (Pos) is
104 Current_Temp_File_Name (Pos) :=
105 Character'Succ (Current_Temp_File_Name (Pos));
109 Current_Temp_File_Name (Pos) := '0';
122 end Create_Temp_File_Internal;
124 end Loop_Optimization9;