summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gnat.dg/opt40.adb
blob: aa9dc3fc2e7d91dac7f4a3ca3aeb351bb087c30b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
-- { dg-do compile }
-- { dg-options "-O2 -fdump-tree-optimized" }

pragma Suppress (Overflow_Check);

function Opt40 (X : Integer; Y : Integer) return Positive is
   Z : Integer;
begin
   if X >= Y then
      return 1;
   end if;
   Z := Y - X;
   return Z;
end;

-- { dg-final { scan-tree-dump-not "gnat_rcheck" "optimized" } }