summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gnat.dg/gcov/check.adb
blob: b3cb8e36b92d69c1f960f6c951798739cf3273bc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
-- { dg-options "-fprofile-arcs -ftest-coverage" }
-- { dg-do run { target native } } */

procedure Check is

  function Add1 (I1, I2 : Integer) return Integer is
  begin
    return I1 + I2;  -- count(1)
  end;

  function Add2 (I1, I2 : Integer) return Integer is
    pragma Suppress (Overflow_Check);
  begin
    return I1 + I2;  -- count(1)
  end;

begin
  if Add1 (1, 2) /= 3 then
    raise Program_Error;
  end if;

  if Add2 (1, 2) /= 3 then
    raise Program_Error;
  end if;
end;

-- { dg-final { run-gcov check.adb } }