-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adapt resolve_names_from_closest_entry_point to use own xref_initial_…
…env.
- Loading branch information
Showing
4 changed files
with
70 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
testsuite/tests/name_resolution/declare_expr_aggregate_2/test.adb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
pragma Ada_2022; | ||
|
||
procedure Test is | ||
type A is array (Natural range 0 .. 1) of Integer; | ||
|
||
function F return A is | ||
(declare | ||
I : constant Integer := 0; | ||
J : constant Integer := 1; | ||
begin (I, J)); | ||
--% node.findall(lal.AggregateAssoc)[0].f_r_expr.p_referenced_decl() | ||
|
||
type B is array (Natural range 0 .. 1) of A; | ||
K : Integer := 3; | ||
|
||
function H return B is | ||
(declare | ||
K : constant Integer := 2; | ||
begin (B'First => (K, K), B'Last => (K, K))); | ||
--% node.findall(lal.AggregateAssoc)[-1].f_r_expr.p_referenced_decl() | ||
begin | ||
null; | ||
end; |
11 changes: 11 additions & 0 deletions
11
testsuite/tests/name_resolution/declare_expr_aggregate_2/test.out
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
Working on node <ExprFunction ["F"] test.adb:6:4-10:21> | ||
======================================================= | ||
|
||
Eval 'node.findall(lal.AggregateAssoc)[0].f_r_expr.p_referenced_decl()' | ||
Result: <ObjectDecl ["I"] test.adb:8:9-8:35> | ||
|
||
Working on node <ExprFunction ["H"] test.adb:16:4-19:52> | ||
======================================================== | ||
|
||
Eval 'node.findall(lal.AggregateAssoc)[-1].f_r_expr.p_referenced_decl()' | ||
Result: <ObjectDecl ["K"] test.adb:18:9-18:35> |
2 changes: 2 additions & 0 deletions
2
testsuite/tests/name_resolution/declare_expr_aggregate_2/test.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
driver: inline-playground | ||
input_sources: [test.adb] |