summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gnat.dg/task_name.ads
blob: 2d9d3ab15044ed4fa2f458d6372673347bf0599b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
with Ada.Finalization;
package task_name is
   type Base_Controller is
     abstract new Ada.Finalization.Limited_Controlled with null record;

   type Extended_Controller is
     abstract new Base_Controller with private;

   type Task_Object (Controller : access Extended_Controller'Class) is
     limited private;
private
   type String_Access is access string;

   type Extended_Controller is
     abstract new Base_Controller with record
        Thread : aliased Task_Object (Extended_Controller'Access);
        Name   : String_Access := new string'("the_name_of_the_task");
     end record;

   task type Task_Object (Controller : access Extended_Controller'Class) is           pragma Task_Name (Controller.Name.all);
   end Task_Object;
end;