c++: prvalue of array type [PR111286]
[official-gcc.git] / gcc / testsuite / gnat.dg / opt97.adb
blob1bf6a750d75d7ed639ed615d7ebfd72ffefc55f2
1 -- { dg-do compile }
2 -- { dg-options "-O2 -fdump-tree-optimized" }
4 with System.Unsigned_Types; use System.Unsigned_Types;
6 function Opt97 (X, Y : Unsigned) return Unsigned is
8 pragma Suppress (All_Checks);
10 Z : Unsigned;
12 begin
13 if X >= 2 then
14 return 0;
15 end if;
17 Z := Y;
18 if X = 1 then
19 Z := Y + 4;
20 end if;
22 return Z / X;
23 end;
25 -- { dg-final { scan-tree-dump "/" "optimized" } }