Commit 21d0fa1e by Arnaud Charlet

Add new tests.

From-SVN: r127555
parent 04fdb7f8
package deref1 is
type T is tagged limited null record;
procedure Op (Obj : in out T);
end deref1;
with deref1;
package deref2 is
type NT is tagged limited private;
function PT_View (Obj : not null access NT)
return not null access deref1.T'Class;
private
type PT (Obj : not null access NT) is new deref1.T with null record;
type NT is tagged limited record
PT_View : aliased PT (NT'Access);
end record;
end;
-- { dg-do compile }
with deref2;
procedure deref3 is
Obj : aliased deref2.NT;
begin
deref2.PT_View (Obj'Access).Op;
Obj.PT_View.all.Op;
Obj.PT_View.Op;
end;
-- { dg-do compile }
procedure Discr_Test is
procedure P is begin null; end P;
task type Tsk1 is
entry rvT;
end Tsk1;
task body Tsk1 is
begin
accept rvT;
end Tsk1;
task type Tsk2 (pS : not null access procedure) is
entry rvT;
end Tsk2;
task body Tsk2 is
tskT : Tsk1;
begin
accept rvT do
requeue tskT.rvT;
end rvT;
pS.all;
end;
Obj : Tsk2 (P'access);
begin
Obj.rvT;
end;
package body elim1 is
procedure d (a : t) is
begin
null;
end;
end;
pragma Eliminate (p, d);
package elim1 is
type t is tagged null record;
procedure d (a : t);
end;
-- { dg-do run }
with elim1;
procedure elim2 is
begin
null;
end;
-- { dg-do compile }
package limited1 is
pragma Pure;
type Buffer is limited interface;
type Synchronous_Buffer_Type is synchronized interface and Buffer;
type Client_Buffer_Type is new Synchronous_Buffer_Type with private;
private
type Client_Buffer_Type is new Synchronous_Buffer_Type with null record;
end limited1;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment