1-- { dg-do compile }
2-- { dg-options "-O2 -fdump-tree-optimized" }
3
4with Ada.Command_Line; use Ada.Command_Line;
5with Opt86_Pkg; use Opt86_Pkg;
6
7procedure Opt86B is
8
9  S1, S2, S3, S4 : Enum;
10
11begin
12
13  S1 := Enum'Value (Argument (1));
14  S2 := Enum'Value (Argument (2));
15  S3 := Enum'Value (Argument (3));
16  S4 := Enum'Value (Argument (4));
17
18  if S1 in Val2 | Val3 | Val9 | Val29 then
19    raise Program_Error;
20  end if;
21
22  if S2 not in Val2 | Val3 | Val9 | Val29 then
23    raise Program_Error;
24  end if;
25
26  if S3 = Val1 or S3 = Val4 or S3 = Val8 or S3 = Val13 then
27    raise Program_Error;
28  end if;
29
30  if S4 /= Val1 and S4 /= Val4 and S4 /= Val8 and S4 /= Val13 then
31    raise Program_Error;
32  end if;
33
34end;
35
36-- { dg-final { scan-tree-dump-not "> 29" "optimized" } }
37-- { dg-final { scan-tree-dump-not "> 13" "optimized" } }
38