Mercurial > hg > CbC > CbC_gcc
annotate gcc/testsuite/gnat.dg/case_optimization1.adb @ 158:494b0b89df80 default tip
...
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Mon, 25 May 2020 18:13:55 +0900 |
parents | 04ced10e8804 |
children |
rev | line source |
---|---|
111 | 1 -- { dg-do compile } |
2 -- { dg-options "-O2" } | |
3 | |
4 package body Case_Optimization1 is | |
5 | |
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; | |
14 | |
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; | |
20 | |
21 end Case_Optimization1; |