File tree Expand file tree Collapse file tree 5 files changed +32
-12
lines changed
testsuite/tests/checks/deeply_nested_inlining Expand file tree Collapse file tree 5 files changed +32
-12
lines changed Original file line number Diff line number Diff line change @@ -7,12 +7,11 @@ fun inlined_body(name) = match name.p_referenced_decl()
77 | b@BaseSubpBody when b?.p_has_aspect("Inline")
88 => b
99 | EnumLiteralDecl => null
10- | GenericSubpInstantiation(f_generic_subp_name: *(
11- p_referenced_decl(): b@GenericSubpDecl(
12- p_has_aspect("Inline"): true)))
13- => b?.p_body_part()
14- | d@BasicDecl when d?.p_is_subprogram() and d?.p_has_aspect("Inline")
15- => d?.p_body_part()
10+ | g@GenericSubpInstantiation(f_generic_subp_name: *(p_referenced_decl(): b@GenericSubpDecl))
11+ when b.p_has_aspect("Inline") or g.p_has_aspect("Inline")
12+ => b.p_body_part()
13+ | d@BasicDecl when d.p_is_subprogram() and d.p_has_aspect("Inline")
14+ => d.p_body_part()
1615 | * => null
1716
1817# Return true if we reach a level ``n`` of inlining of 0
Original file line number Diff line number Diff line change @@ -35,4 +35,9 @@ package body Deeply_Inlined_2012 is
3535 New_P4;
3636 end P5 ;
3737
38+ procedure Free (Elem : in out T) is
39+ begin
40+ Free (Elem.C);
41+ end Free ;
42+
3843end Deeply_Inlined_2012 ;
Original file line number Diff line number Diff line change 1+ with Ada.Unchecked_Deallocation ;
2+
13package Deeply_Inlined_2012 is
24
35 generic
@@ -18,4 +20,20 @@ package Deeply_Inlined_2012 is
1820 generic
1921 procedure P5 with Inline; -- FLAG
2022
23+ type T is private ;
24+
25+ procedure Free (Elem : in out T); -- NOFLAG
26+
27+ private
28+ type U is null record ;
29+ type U_Access is access U;
30+
31+ procedure Free is new Ada.Unchecked_Deallocation -- NOFLAG
32+ (U, U_Access);
33+
34+ type T is record
35+ C : U_Access;
36+ end record ;
37+
38+ pragma Inline (Free);
2139end Deeply_Inlined_2012 ;
Original file line number Diff line number Diff line change 11package Inlined is
2-
32 procedure P0 ; -- NOFLAG
43 pragma Inline (P0);
54
@@ -17,5 +16,4 @@ package Inlined is
1716
1817 function F2 return Boolean; -- NOFLAG
1918 pragma Inline (F2);
20-
2119end Inlined ;
Original file line number Diff line number Diff line change @@ -38,11 +38,11 @@ deeply_inlined_2012.adb:32:14: rule violation: deeply nested inlining
383832 | procedure New_P4 is new P4; -- FLAG
3939 | ^^^^^^
4040
41- deeply_inlined_2012.ads:16 :14: rule violation: deeply nested inlining
42- 16 | procedure P4 with Inline; -- FLAG
41+ deeply_inlined_2012.ads:18 :14: rule violation: deeply nested inlining
42+ 18 | procedure P4 with Inline; -- FLAG
4343 | ^^
4444
45- deeply_inlined_2012.ads:19 :14: rule violation: deeply nested inlining
46- 19 | procedure P5 with Inline; -- FLAG
45+ deeply_inlined_2012.ads:21 :14: rule violation: deeply nested inlining
46+ 21 | procedure P5 with Inline; -- FLAG
4747 | ^^
4848
You can’t perform that action at this time.
0 commit comments