| 1 |
-- { dg-do compile } |
| 2 |
-- { dg-options "-O -fdump-tree-esra" } |
| 3 |
|
| 4 |
with Opt34_Pkg; use Opt34_Pkg; |
| 5 |
|
| 6 |
procedure Opt34 is |
| 7 |
|
| 8 |
function Local_Fun (Arg : T_Private) return T_Private is |
| 9 |
Result : T_Private; |
| 10 |
begin |
| 11 |
|
| 12 |
case Get_Integer (Arg) is |
| 13 |
when 1 => |
| 14 |
Result := Get_Private (100); |
| 15 |
when 2 => |
| 16 |
Result := T_Private_Zero; |
| 17 |
when others => |
| 18 |
null; |
| 19 |
end case; |
| 20 |
|
| 21 |
return Result; |
| 22 |
end Local_Fun; |
| 23 |
|
| 24 |
begin |
| 25 |
Assert (Get_Integer (Local_Fun (Get_Private (1))) = 100); |
| 26 |
end; |
| 27 |
|
| 28 |
-- { dg-final { scan-tree-dump "Created a replacement for result" "esra" } } |