From 6d91a9542e8a61079cecb68a8d510cb0af06e594 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Laurent=20Th=C3=A9venoux?= Date: Wed, 3 Jan 2024 17:39:11 +0100 Subject: [PATCH] nameres: add an option to traverse generic instantiations The new option is `--traverse-generics`. It can be sets in test.yaml using the field `traverse_generics` sets to `true`, as shown in the added test generic_subp_named_param_2 (which is a simple copy of generic_subp_named_param using the name-resolution driver). --- testsuite/ada/nameres.adb | 61 +++- testsuite/drivers/name_resolution_driver.py | 6 + .../generic_subp_named_param_2/test.adb | 19 + .../generic_subp_named_param_2/test.out | 333 ++++++++++++++++++ .../generic_subp_named_param_2/test.yaml | 3 + .../generic_subp_named_param_2/test_2.adb | 28 ++ .../generic_subp_named_param_2/test_3.adb | 19 + .../traverse_generic_and_stub/pkg-foo.adb | 7 + .../traverse_generic_and_stub/pkg.adb | 3 + .../traverse_generic_and_stub/pkg.ads | 4 + .../traverse_generic_and_stub/test.adb | 8 + .../traverse_generic_and_stub/test.out | 83 +++++ .../traverse_generic_and_stub/test.yaml | 3 + 13 files changed, 572 insertions(+), 5 deletions(-) create mode 100644 testsuite/tests/name_resolution/generic_subp_named_param_2/test.adb create mode 100644 testsuite/tests/name_resolution/generic_subp_named_param_2/test.out create mode 100644 testsuite/tests/name_resolution/generic_subp_named_param_2/test.yaml create mode 100644 testsuite/tests/name_resolution/generic_subp_named_param_2/test_2.adb create mode 100644 testsuite/tests/name_resolution/generic_subp_named_param_2/test_3.adb create mode 100644 testsuite/tests/name_resolution/traverse_generic_and_stub/pkg-foo.adb create mode 100644 testsuite/tests/name_resolution/traverse_generic_and_stub/pkg.adb create mode 100644 testsuite/tests/name_resolution/traverse_generic_and_stub/pkg.ads create mode 100644 testsuite/tests/name_resolution/traverse_generic_and_stub/test.adb create mode 100644 testsuite/tests/name_resolution/traverse_generic_and_stub/test.out create mode 100644 testsuite/tests/name_resolution/traverse_generic_and_stub/test.yaml diff --git a/testsuite/ada/nameres.adb b/testsuite/ada/nameres.adb index f7bf5f536..45df6a187 100644 --- a/testsuite/ada/nameres.adb +++ b/testsuite/ada/nameres.adb @@ -139,6 +139,10 @@ procedure Nameres is package Resolve_All is new Parse_Flag (App.Args.Parser, "-A", "--all", "Resolve every cross reference"); + package Traverse_Generics is new Parse_Flag + (App.Args.Parser, "-G", "--traverse-generics", + "Traverse generic instantiations"); + package Solve_Line is new Parse_Option (App.Args.Parser, "-L", "--solve-line", "Only analyze line N", Natural, Default_Val => 0); @@ -754,7 +758,10 @@ procedure Nameres is -- Decode a pragma node and run actions accordingly (trigger name -- resolution, output a section name, ...). - procedure Resolve_Node (Node : Ada_Node; Show_Slocs : Boolean := True); + procedure Resolve_Node + (Node : Ada_Node; + Show_Slocs : Boolean := True; + In_Generic_Instantiation : Boolean := False); -- Run name resolution testing on Node. -- -- This involves running P_Resolve_Names on Node, displaying resolved @@ -770,7 +777,9 @@ procedure Nameres is -- Return whether we should use N as an entry point for name resolution -- testing. - procedure Resolve_Block (Block : Ada_Node); + procedure Resolve_Block + (Block : Ada_Node; + In_Generic_Instantiation : Boolean := False); -- Call Resolve_Node on all xref entry points (according to -- Is_Xref_Entry_Point) in Block except for Block itself. @@ -860,7 +869,9 @@ procedure Nameres is -- Resolve_Block -- ------------------- - procedure Resolve_Block (Block : Ada_Node) is + procedure Resolve_Block + (Block : Ada_Node; + In_Generic_Instantiation : Boolean := False) is procedure Resolve_Entry_Point (Node : Ada_Node); -- Callback for tree traversal in Block @@ -872,7 +883,9 @@ procedure Nameres is procedure Resolve_Entry_Point (Node : Ada_Node) is begin if Node /= Block then - Resolve_Node (Node); + Resolve_Node + (Node, + In_Generic_Instantiation => In_Generic_Instantiation); end if; end Resolve_Entry_Point; @@ -886,7 +899,10 @@ procedure Nameres is -- Resolve_Node -- ------------------ - procedure Resolve_Node (Node : Ada_Node; Show_Slocs : Boolean := True) is + procedure Resolve_Node + (Node : Ada_Node; + Show_Slocs : Boolean := True; + In_Generic_Instantiation : Boolean := False) is function XFAIL return Boolean; -- If there is an XFAIL pragma for the node being resolved, show the @@ -1035,6 +1051,41 @@ procedure Nameres is end if; end if; + -- Traverse generics instantiations + + if Args.Traverse_Generics.Get then + if Node.Kind in Ada_Generic_Instantiation then + declare + Generic_Decl : constant Basic_Decl := + Node.As_Generic_Instantiation.P_Designated_Generic_Decl; + Generic_Body : constant Body_Node := + Generic_Decl.P_Body_Part_For_Decl; + begin + if Verbose then + Put_Title + ('*', "Traversing generic node " & Generic_Decl.Image); + end if; + Resolve_Block (Generic_Decl.As_Ada_Node, True); + if not Generic_Body.Is_Null then + if Verbose then + Put_Title + ('*', + "Traversing generic node " & Generic_Body.Image); + end if; + Resolve_Block (Generic_Body.As_Ada_Node, True); + end if; + end; + elsif In_Generic_Instantiation and then + Node.Parent.Kind in Ada_Body_Stub + -- Body_Stub isn't an entry point, but its Subp_Spec is. So, + -- check if Node.Parent is a Body_Stub. + then + Resolve_Block + (Node.Parent.As_Body_Stub.P_Next_Part_For_Decl.As_Ada_Node, + True); + end if; + end if; + -- Post-processing output if Verbose then diff --git a/testsuite/drivers/name_resolution_driver.py b/testsuite/drivers/name_resolution_driver.py index ee3ea5070..de74d8815 100644 --- a/testsuite/drivers/name_resolution_driver.py +++ b/testsuite/drivers/name_resolution_driver.py @@ -49,6 +49,9 @@ class NameResolutionDriver(BaseDriver): * ``sort_by_basename``: Boolean (false by default): whether to pass the ``--sort-by-basename`` switch to ``nameres``. + + * ``traverse_generics``: Boolean (false by default): whether to pass the + ``--traverse-generics`` switch to ``nameres``. """ perf_supported = True @@ -134,6 +137,9 @@ def run(self): if self.test_env.get("sort_by_basename"): args.append("--sort-by-basename") + if self.test_env.get("traverse_generics"): + args.append("--traverse-generics") + # Add optional explicit list of sources to process args += input_sources diff --git a/testsuite/tests/name_resolution/generic_subp_named_param_2/test.adb b/testsuite/tests/name_resolution/generic_subp_named_param_2/test.adb new file mode 100644 index 000000000..6fa0e18bf --- /dev/null +++ b/testsuite/tests/name_resolution/generic_subp_named_param_2/test.adb @@ -0,0 +1,19 @@ +procedure Test is + generic + with procedure Foo (X : Integer := 42); + procedure Gen; + + procedure Gen is + begin + Foo (42); + Foo (X => 42); + Foo; + end Gen; + + procedure Bar (Y : Integer) is null; + + procedure My_Gen is new Gen (Bar); + pragma Test_Statement; +begin + null; +end Test; diff --git a/testsuite/tests/name_resolution/generic_subp_named_param_2/test.out b/testsuite/tests/name_resolution/generic_subp_named_param_2/test.out new file mode 100644 index 000000000..2c5df5fa5 --- /dev/null +++ b/testsuite/tests/name_resolution/generic_subp_named_param_2/test.out @@ -0,0 +1,333 @@ +Analyzing test.adb +################## + +Resolving xrefs for node +********************************************************************************** + +Expr: + references: + type: None + expected type: None +Expr: + references: + type: None + expected type: None +Traversing generic node <| GenericSubpDecl ["Gen"] test.adb:2:4-4:18 [test.adb:15:4] |> +*************************************************************************************** + +Resolving xrefs for node <| GenericFormalSubpDecl ["Foo"] test.adb:3:7-3:46 [test.adb:15:4] |> +********************************************************************************************** + + +Resolving xrefs for node <| SubpSpec test.adb:3:12-3:45 [test.adb:15:4] |> +************************************************************************** + + +Resolving xrefs for node <| ParamSpec ["X"] test.adb:3:27-3:44 [test.adb:15:4] |> +********************************************************************************* + +Expr: <| Id "Integer" test.adb:3:31-3:38 [test.adb:15:4] |> + references: + type: None + expected type: None +Expr: <| Int test.adb:3:42-3:44 [test.adb:15:4] |> + references: None + type: + expected type: + +Resolving xrefs for node <| SubpSpec test.adb:4:4-4:17 [test.adb:15:4] |> +************************************************************************* + + +Traversing generic node <| SubpBody ["Gen"] test.adb:6:4-11:12 [test.adb:15:4] |> +********************************************************************************* + +Resolving xrefs for node <| SubpSpec test.adb:6:4-6:17 [test.adb:15:4] |> +************************************************************************* + + +Resolving xrefs for node <| CallStmt test.adb:8:7-8:16 [test.adb:15:4] |> +************************************************************************* + +Expr: <| CallExpr test.adb:8:7-8:15 [test.adb:15:4] |> + references: + type: None + expected type: None +Expr: <| Id "Foo" test.adb:8:7-8:10 [test.adb:15:4] |> + references: + type: None + expected type: None +Expr: <| Int test.adb:8:12-8:14 [test.adb:15:4] |> + references: None + type: + expected type: + +Resolving xrefs for node <| CallStmt test.adb:9:7-9:21 [test.adb:15:4] |> +************************************************************************* + +Expr: <| CallExpr test.adb:9:7-9:20 [test.adb:15:4] |> + references: + type: None + expected type: None +Expr: <| Id "Foo" test.adb:9:7-9:10 [test.adb:15:4] |> + references: + type: None + expected type: None +Expr: <| Id "X" test.adb:9:12-9:13 [test.adb:15:4] |> + references: + type: None + expected type: None +Expr: <| Int test.adb:9:17-9:19 [test.adb:15:4] |> + references: None + type: + expected type: + +Resolving xrefs for node <| CallStmt test.adb:10:7-10:11 [test.adb:15:4] |> +*************************************************************************** + +Expr: <| Id "Foo" test.adb:10:7-10:10 [test.adb:15:4] |> + references: + type: None + expected type: None + +Resolving xrefs for node <| EndName test.adb:11:8-11:11 [test.adb:15:4] |> +************************************************************************** + +Expr: <| EndName test.adb:11:8-11:11 [test.adb:15:4] |> + references: <| DefiningName "Gen" test.adb:6:14-6:17 [test.adb:15:4] |> + type: None + expected type: None +Expr: <| Id "Gen" test.adb:11:8-11:11 [test.adb:15:4] |> + references: <| DefiningName "Gen" test.adb:6:14-6:17 [test.adb:15:4] |> + type: None + expected type: None + + + +Analyzing test_2.adb +#################### + +Resolving xrefs for node +******************************************************************************** + +Expr: + references: + type: None + expected type: None +Expr: + references: + type: None + expected type: None +Traversing generic node <| GenericSubpDecl ["G2"] test_2.adb:11:4-13:17 [test_2.adb:23:4] |> +******************************************************************************************** + +Resolving xrefs for node <| GenericFormalSubpDecl ["Bar"] test_2.adb:12:7-12:40 [test_2.adb:23:4] |> +**************************************************************************************************** + + +Resolving xrefs for node <| SubpSpec test_2.adb:12:12-12:39 [test_2.adb:23:4] |> +******************************************************************************** + + +Resolving xrefs for node <| ParamSpec ["B"] test_2.adb:12:27-12:38 [test_2.adb:23:4] |> +*************************************************************************************** + +Expr: <| Id "Integer" test_2.adb:12:31-12:38 [test_2.adb:23:4] |> + references: + type: None + expected type: None + +Resolving xrefs for node <| SubpSpec test_2.adb:13:4-13:16 [test_2.adb:23:4] |> +******************************************************************************* + + +Traversing generic node <| SubpBody ["G2"] test_2.adb:15:4-19:11 [test_2.adb:23:4] |> +************************************************************************************* + +Resolving xrefs for node <| SubpSpec test_2.adb:15:4-15:16 [test_2.adb:23:4] |> +******************************************************************************* + + +Resolving xrefs for node <| GenericSubpInstantiation ["I1"] test_2.adb:16:7-16:36 [test_2.adb:23:4] |> +****************************************************************************************************** + +Expr: <| Id "G1" test_2.adb:16:27-16:29 [test_2.adb:23:4] |> + references: + type: None + expected type: None +Expr: <| Id "Bar" test_2.adb:16:31-16:34 [test_2.adb:23:4] |> + references: <| DefiningName "Bar" test_2.adb:12:22-12:25 [test_2.adb:23:4] |> + type: None + expected type: None +Traversing generic node <| GenericSubpDecl ["G1"] test_2.adb:2:4-4:17 [test_2.adb:23:4, test_2.adb:16:7] |> +*********************************************************************************************************** + +Resolving xrefs for node <| GenericFormalSubpDecl ["Foo"] test_2.adb:3:7-3:40 [test_2.adb:23:4, test_2.adb:16:7] |> +******************************************************************************************************************* + + +Resolving xrefs for node <| SubpSpec test_2.adb:3:12-3:39 [test_2.adb:23:4, test_2.adb:16:7] |> +*********************************************************************************************** + + +Resolving xrefs for node <| ParamSpec ["A"] test_2.adb:3:27-3:38 [test_2.adb:23:4, test_2.adb:16:7] |> +****************************************************************************************************** + +Expr: <| Id "Integer" test_2.adb:3:31-3:38 [test_2.adb:23:4, test_2.adb:16:7] |> + references: + type: None + expected type: None + +Resolving xrefs for node <| SubpSpec test_2.adb:4:4-4:16 [test_2.adb:23:4, test_2.adb:16:7] |> +********************************************************************************************** + + +Traversing generic node <| SubpBody ["G1"] test_2.adb:6:4-9:11 [test_2.adb:23:4, test_2.adb:16:7] |> +**************************************************************************************************** + +Resolving xrefs for node <| SubpSpec test_2.adb:6:4-6:16 [test_2.adb:23:4, test_2.adb:16:7] |> +********************************************************************************************** + + +Resolving xrefs for node <| CallStmt test_2.adb:8:7-8:20 [test_2.adb:23:4, test_2.adb:16:7] |> +********************************************************************************************** + +Expr: <| CallExpr test_2.adb:8:7-8:19 [test_2.adb:23:4, test_2.adb:16:7] |> + references: + type: None + expected type: None +Expr: <| Id "Foo" test_2.adb:8:7-8:10 [test_2.adb:23:4, test_2.adb:16:7] |> + references: + type: None + expected type: None +Expr: <| Id "A" test_2.adb:8:12-8:13 [test_2.adb:23:4, test_2.adb:16:7] |> + references: + type: None + expected type: None +Expr: <| Int test_2.adb:8:17-8:18 [test_2.adb:23:4, test_2.adb:16:7] |> + references: None + type: + expected type: + +Resolving xrefs for node <| EndName test_2.adb:9:8-9:10 [test_2.adb:23:4, test_2.adb:16:7] |> +********************************************************************************************* + +Expr: <| EndName test_2.adb:9:8-9:10 [test_2.adb:23:4, test_2.adb:16:7] |> + references: <| DefiningName "G1" test_2.adb:6:14-6:16 [test_2.adb:23:4, test_2.adb:16:7] |> + type: None + expected type: None +Expr: <| Id "G1" test_2.adb:9:8-9:10 [test_2.adb:23:4, test_2.adb:16:7] |> + references: <| DefiningName "G1" test_2.adb:6:14-6:16 [test_2.adb:23:4, test_2.adb:16:7] |> + type: None + expected type: None + + +Resolving xrefs for node <| CallStmt test_2.adb:18:7-18:10 [test_2.adb:23:4] |> +******************************************************************************* + +Expr: <| Id "I1" test_2.adb:18:7-18:9 [test_2.adb:23:4] |> + references: <| DefiningName "I1" test_2.adb:16:17-16:19 [test_2.adb:23:4] |> + type: None + expected type: None + +Resolving xrefs for node <| EndName test_2.adb:19:8-19:10 [test_2.adb:23:4] |> +****************************************************************************** + +Expr: <| EndName test_2.adb:19:8-19:10 [test_2.adb:23:4] |> + references: <| DefiningName "G2" test_2.adb:15:14-15:16 [test_2.adb:23:4] |> + type: None + expected type: None +Expr: <| Id "G2" test_2.adb:19:8-19:10 [test_2.adb:23:4] |> + references: <| DefiningName "G2" test_2.adb:15:14-15:16 [test_2.adb:23:4] |> + type: None + expected type: None + + + +Analyzing test_3.adb +#################### + +Resolving xrefs for node +************************************************************************************ + +Expr: + references: + type: None + expected type: None +Expr: + references: + type: None + expected type: None +Traversing generic node <| GenericSubpDecl ["Gen"] test_3.adb:4:4-6:18 [test_3.adb:15:4] |> +******************************************************************************************* + +Resolving xrefs for node <| GenericFormalSubpDecl ["Foo"] test_3.adb:5:7-5:43 [test_3.adb:15:4] |> +************************************************************************************************** + + +Resolving xrefs for node <| SubpSpec test_3.adb:5:12-5:42 [test_3.adb:15:4] |> +****************************************************************************** + + +Resolving xrefs for node <| ParamSpec ["X", "Y"] test_3.adb:5:27-5:41 [test_3.adb:15:4] |> +****************************************************************************************** + +Expr: <| Id "Integer" test_3.adb:5:34-5:41 [test_3.adb:15:4] |> + references: + type: None + expected type: None + +Resolving xrefs for node <| SubpSpec test_3.adb:6:4-6:17 [test_3.adb:15:4] |> +***************************************************************************** + + +Traversing generic node <| SubpBody ["Gen"] test_3.adb:8:4-11:12 [test_3.adb:15:4] |> +************************************************************************************* + +Resolving xrefs for node <| SubpSpec test_3.adb:8:4-8:17 [test_3.adb:15:4] |> +***************************************************************************** + + +Resolving xrefs for node <| CallStmt test_3.adb:10:7-10:28 [test_3.adb:15:4] |> +******************************************************************************* + +Expr: <| CallExpr test_3.adb:10:7-10:27 [test_3.adb:15:4] |> + references: + type: None + expected type: None +Expr: <| Id "Foo" test_3.adb:10:7-10:10 [test_3.adb:15:4] |> + references: + type: None + expected type: None +Expr: <| Id "Y" test_3.adb:10:12-10:13 [test_3.adb:15:4] |> + references: + type: None + expected type: None +Expr: <| Int test_3.adb:10:17-10:18 [test_3.adb:15:4] |> + references: None + type: + expected type: +Expr: <| Id "X" test_3.adb:10:20-10:21 [test_3.adb:15:4] |> + references: + type: None + expected type: None +Expr: <| Int test_3.adb:10:25-10:26 [test_3.adb:15:4] |> + references: None + type: + expected type: + +Resolving xrefs for node <| EndName test_3.adb:11:8-11:11 [test_3.adb:15:4] |> +****************************************************************************** + +Expr: <| EndName test_3.adb:11:8-11:11 [test_3.adb:15:4] |> + references: <| DefiningName "Gen" test_3.adb:8:14-8:17 [test_3.adb:15:4] |> + type: None + expected type: None +Expr: <| Id "Gen" test_3.adb:11:8-11:11 [test_3.adb:15:4] |> + references: <| DefiningName "Gen" test_3.adb:8:14-8:17 [test_3.adb:15:4] |> + type: None + expected type: None + + + +Done. diff --git a/testsuite/tests/name_resolution/generic_subp_named_param_2/test.yaml b/testsuite/tests/name_resolution/generic_subp_named_param_2/test.yaml new file mode 100644 index 000000000..4bcc9124d --- /dev/null +++ b/testsuite/tests/name_resolution/generic_subp_named_param_2/test.yaml @@ -0,0 +1,3 @@ +driver: name-resolution +input_sources: [test.adb, test_2.adb, test_3.adb] +traverse_generics: true diff --git a/testsuite/tests/name_resolution/generic_subp_named_param_2/test_2.adb b/testsuite/tests/name_resolution/generic_subp_named_param_2/test_2.adb new file mode 100644 index 000000000..0c877a79d --- /dev/null +++ b/testsuite/tests/name_resolution/generic_subp_named_param_2/test_2.adb @@ -0,0 +1,28 @@ +procedure Test_2 is + generic + with procedure Foo (A : Integer); + procedure G1; + + procedure G1 is + begin + Foo (A => 2); + end G1; + + generic + with procedure Bar (B : Integer); + procedure G2; + + procedure G2 is + procedure I1 is new G1 (Bar); + begin + I1; + end G2; + + procedure Baz (C : Integer) is null; + + procedure I2 is new G2 (Baz); + pragma Test_Statement; +begin + null; +end Test_2; + diff --git a/testsuite/tests/name_resolution/generic_subp_named_param_2/test_3.adb b/testsuite/tests/name_resolution/generic_subp_named_param_2/test_3.adb new file mode 100644 index 000000000..8fa7c25b3 --- /dev/null +++ b/testsuite/tests/name_resolution/generic_subp_named_param_2/test_3.adb @@ -0,0 +1,19 @@ +-- Check that it also works when parameter packing doesn't match between +-- the formal and the actual. +procedure Test_3 is + generic + with procedure Foo (X, Y : Integer); + procedure Gen; + + procedure Gen is + begin + Foo (Y => 1, X => 2); + end Gen; + + procedure Bar (A : Integer; B : Integer) is null; + + procedure My_Gen is new Gen (Bar); + pragma Test_Statement; +begin + null; +end Test_3; diff --git a/testsuite/tests/name_resolution/traverse_generic_and_stub/pkg-foo.adb b/testsuite/tests/name_resolution/traverse_generic_and_stub/pkg-foo.adb new file mode 100644 index 000000000..035f85d93 --- /dev/null +++ b/testsuite/tests/name_resolution/traverse_generic_and_stub/pkg-foo.adb @@ -0,0 +1,7 @@ +with Ada.Text_IO; use Ada.Text_IO; + +separate (Pkg) +procedure Foo is +begin + Put_Line ("Visit Foo!"); +end Foo; diff --git a/testsuite/tests/name_resolution/traverse_generic_and_stub/pkg.adb b/testsuite/tests/name_resolution/traverse_generic_and_stub/pkg.adb new file mode 100644 index 000000000..612519c6a --- /dev/null +++ b/testsuite/tests/name_resolution/traverse_generic_and_stub/pkg.adb @@ -0,0 +1,3 @@ +package body Pkg is + procedure Foo is separate; +end Pkg; diff --git a/testsuite/tests/name_resolution/traverse_generic_and_stub/pkg.ads b/testsuite/tests/name_resolution/traverse_generic_and_stub/pkg.ads new file mode 100644 index 000000000..c54a1377f --- /dev/null +++ b/testsuite/tests/name_resolution/traverse_generic_and_stub/pkg.ads @@ -0,0 +1,4 @@ +generic +package Pkg is + procedure Foo; +end Pkg; diff --git a/testsuite/tests/name_resolution/traverse_generic_and_stub/test.adb b/testsuite/tests/name_resolution/traverse_generic_and_stub/test.adb new file mode 100644 index 000000000..3dff4280c --- /dev/null +++ b/testsuite/tests/name_resolution/traverse_generic_and_stub/test.adb @@ -0,0 +1,8 @@ +with Pkg; + +procedure Test is + package My_Pkg is new Pkg; + pragma Test_Statement; +begin + null; +end Test; diff --git a/testsuite/tests/name_resolution/traverse_generic_and_stub/test.out b/testsuite/tests/name_resolution/traverse_generic_and_stub/test.out new file mode 100644 index 000000000..8cc0e465e --- /dev/null +++ b/testsuite/tests/name_resolution/traverse_generic_and_stub/test.out @@ -0,0 +1,83 @@ +Analyzing test.adb +################## + +Resolving xrefs for node +*********************************************************************************** + +Expr: + references: + type: None + expected type: None +Traversing generic node <| GenericPackageDecl ["Pkg"] pkg.ads:1:1-4:9 [test.adb:4:4] |> +*************************************************************************************** + +Resolving xrefs for node <| SubpSpec pkg.ads:3:4-3:17 [test.adb:4:4] |> +*********************************************************************** + + +Resolving xrefs for node <| EndName pkg.ads:4:5-4:8 [test.adb:4:4] |> +********************************************************************* + +Expr: <| EndName pkg.ads:4:5-4:8 [test.adb:4:4] |> + references: + type: None + expected type: None +Expr: <| Id "Pkg" pkg.ads:4:5-4:8 [test.adb:4:4] |> + references: + type: None + expected type: None + +Traversing generic node <| PackageBody ["Pkg"] pkg.adb:1:1-3:9 [test.adb:4:4] |> +******************************************************************************** + +Resolving xrefs for node <| SubpSpec pkg.adb:2:4-2:17 [test.adb:4:4] |> +*********************************************************************** + +Resolving xrefs for node <| SubpSpec pkg-foo.adb:4:1-4:14 [test.adb:4:4] |> +*************************************************************************** + + +Resolving xrefs for node <| CallStmt pkg-foo.adb:6:4-6:28 [test.adb:4:4] |> +*************************************************************************** + +Expr: <| CallExpr pkg-foo.adb:6:4-6:27 [test.adb:4:4] |> + references: + type: None + expected type: None +Expr: <| Id "Put_Line" pkg-foo.adb:6:4-6:12 [test.adb:4:4] |> + references: + type: None + expected type: None +Expr: <| Str ""Visit Foo!"" pkg-foo.adb:6:14-6:26 [test.adb:4:4] |> + references: None + type: + expected type: + +Resolving xrefs for node <| EndName pkg-foo.adb:7:5-7:8 [test.adb:4:4] |> +************************************************************************* + +Expr: <| EndName pkg-foo.adb:7:5-7:8 [test.adb:4:4] |> + references: <| DefiningName "Foo" pkg-foo.adb:4:11-4:14 [test.adb:4:4] |> + type: None + expected type: None +Expr: <| Id "Foo" pkg-foo.adb:7:5-7:8 [test.adb:4:4] |> + references: <| DefiningName "Foo" pkg-foo.adb:4:11-4:14 [test.adb:4:4] |> + type: None + expected type: None + + +Resolving xrefs for node <| EndName pkg.adb:3:5-3:8 [test.adb:4:4] |> +********************************************************************* + +Expr: <| EndName pkg.adb:3:5-3:8 [test.adb:4:4] |> + references: <| DefiningName "Pkg" pkg.adb:1:14-1:17 [test.adb:4:4] |> + type: None + expected type: None +Expr: <| Id "Pkg" pkg.adb:3:5-3:8 [test.adb:4:4] |> + references: <| DefiningName "Pkg" pkg.adb:1:14-1:17 [test.adb:4:4] |> + type: None + expected type: None + + + +Done. diff --git a/testsuite/tests/name_resolution/traverse_generic_and_stub/test.yaml b/testsuite/tests/name_resolution/traverse_generic_and_stub/test.yaml new file mode 100644 index 000000000..6c2fc1a63 --- /dev/null +++ b/testsuite/tests/name_resolution/traverse_generic_and_stub/test.yaml @@ -0,0 +1,3 @@ +driver: name-resolution +input_sources: [test.adb] +traverse_generics: true