aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gnat.dg/elab4_pkg.adb
blob: db91dc712a8b13e5788d6e01a220a7dfb97cd1df (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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
with Ada.Text_IO; use Ada.Text_IO;

package body Elab4_Pkg is

   --------------------------------------------------
   -- Call to call, instantiation, task activation --
   --------------------------------------------------

   procedure Suppressed_Call_1 is
      package Inst is new ABE_Gen;
      T : ABE_Task;
   begin
      ABE_Call;
   end Suppressed_Call_1;

   function Elaborator_1 return Boolean is
   begin
      pragma Warnings ("L");
      Suppressed_Call_1;
      pragma Warnings ("l");
      return True;
   end Elaborator_1;

   Elab_1 : constant Boolean := Elaborator_1;

   procedure Suppressed_Call_2 is
      package Inst is new ABE_Gen;
      T : ABE_Task;
   begin
      ABE_Call;
   end Suppressed_Call_2;

   function Elaborator_2 return Boolean is
   begin
      Suppressed_Call_2;
      return True;
   end Elaborator_2;

   Elab_2 : constant Boolean := Elaborator_2;

   -----------------------------------------------------------
   -- Instantiation to call, instantiation, task activation --
   -----------------------------------------------------------

   package body Suppressed_Generic is
      procedure Force_Body is begin null; end Force_Body;
      package Inst is new ABE_Gen;
      T : ABE_Task;
   begin
      ABE_Call;
   end Suppressed_Generic;

   function Elaborator_3 return Boolean is
      pragma Warnings ("L");
      package Inst is new Suppressed_Generic;
      pragma Warnings ("l");
   begin
      return True;
   end Elaborator_3;

   Elab_3 : constant Boolean := Elaborator_3;

   -------------------------------------------------------------
   -- Task activation to call, instantiation, task activation --
   -------------------------------------------------------------

   task body Suppressed_Task is
      package Inst is new ABE_Gen;
      T : ABE_Task;
   begin
      ABE_Call;
   end Suppressed_Task;

   function Elaborator_4 return Boolean is
      pragma Warnings ("L");
      T : Suppressed_Task;
      pragma Warnings ("l");
   begin
      return True;
   end Elaborator_4;

   Elab_4 : constant Boolean := Elaborator_4;

   procedure ABE_Call is
   begin
      Put_Line ("ABE_Call");
   end ABE_Call;

   package body ABE_Gen is
      procedure Force_Body is begin null; end Force_Body;
   begin
      Put_Line ("ABE_Gen");
   end ABE_Gen;

   task body ABE_Task is
   begin
      Put_Line ("ABE_Task");
   end ABE_Task;
end Elab4_Pkg;