Skip analyzer strndup test on hppa*-*-hpux*
[official-gcc.git] / gcc / testsuite / gnat.dg / opt103.adb
blob8509fa31f926038e246a33480d164f5c919d4712
1 -- { dg-do compile }
2 -- { dg-options "-O -gnatn -fdump-tree-optimized" }
4 package body Opt103 is
6 function Read return Mode is
7 S : String := Get;
8 M : Mode;
10 begin
11 -- There should be a single call to Value_Enumeration_Pos after inlining
13 if Mode'Valid_Value (S) then
14 M := Mode'Value (S);
15 else
16 raise Program_Error;
17 end if;
19 return M;
20 end;
22 function Translate (S : String) return Mode is
23 M : Mode;
25 begin
26 -- There should be a single call to Value_Enumeration_Pos after inlining
28 if Mode'Valid_Value (S) then
29 M := Mode'Value (S);
30 else
31 raise Program_Error;
32 end if;
34 return M;
35 end;
37 end Opt103;
39 -- { dg-final { scan-tree-dump-times ".value_enumeration_pos" 2 "optimized" } }