aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gnat.dg/limited_with4.adb
blob: 0d3f530c4f4250f6f369f314c2eec2547951eab0 (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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
-- { dg-do compile }

with Limited_With4_Pkg;

package body Limited_With4 is

  procedure Proc1 (A : Limited_With4_Pkg.Rec12 ; I : Integer) is
  begin
    if A.R.I /= I then
      raise Program_Error;
    end if;
  end;

  function Func1 (I : Integer) return Limited_With4_Pkg.Rec12 is
  begin
    return (I => I, R => (I => I));
  end;

  procedure Proc2 (A : Limited_With4_Pkg.Rec22 ; I : Integer) is
  begin
    if A.R.I /= I then
      raise Program_Error;
    end if;
  end;

  function Func2 (I : Integer) return Limited_With4_Pkg.Rec22 is
  begin
    return (I => I, R => (I => I));
  end;

  procedure Proc3 (A : Limited_With4_Pkg.Rec12 ; B : Limited_With4_Pkg.Rec22) is
  begin
    if A.R.I /= B.R.I then
      raise Program_Error;
    end if;
  end;

  function Func3 (A : Limited_With4_Pkg.Rec12) return Limited_With4_Pkg.Rec22 is
  begin
    return (I => A.R.I, R => (I => A.R.I));
  end;

end Limited_With4;