PR ipa/83051
[official-gcc.git] / gcc / testsuite / gnat.dg / case_optimization1.adb
blob3273b16fe77ee9b649f5266de7cf8a445c8d4a37
1 -- { dg-do compile }
2 -- { dg-options "-O2" }
4 package body Case_Optimization1 is
6 function F (Op_Kind : Internal_Operator_Symbol_Kinds) return Integer is
7 begin
8 case Op_Kind is
9 when A_Not_Operator => return 3;
10 when An_Exponentiate_Operator => return 2;
11 when others => return 1;
12 end case;
13 end;
15 function Len (E : Element) return Integer is
16 Op_Kind : Internal_Element_Kinds := Int_Kind (E);
17 begin
18 return F (Int_Kind (E));
19 end;
21 end Case_Optimization1;