PR target/84336
[official-gcc.git] / gcc / testsuite / gnat.dg / opt65.adb
blob7b429b6b1a39726f5e8d0f2fff702413a1f9130d
1 -- { dg-do run }
2 -- { dg-options "-O2" }
4 with Ada.Command_Line; use Ada.Command_Line;
6 procedure Opt65 is
8 procedure Check_Version_And_Help (Version_String : String) is
9 Help_Switch_Present : Boolean := False;
10 Next_Arg : Natural := 1;
11 begin
12 while Next_Arg <= Argument_Count loop
13 declare
14 Next_Argv : constant String := Argument (Next_Arg);
15 begin
16 if Next_Argv = "--help" then
17 Help_Switch_Present := True;
18 end if;
19 Next_Arg := Next_Arg + 1;
20 end;
21 end loop;
23 if Help_Switch_Present then
24 raise Program_Error;
25 end if;
26 end;
28 begin
29 Check_Version_And_Help ("version");
30 end;