From 267c45a84f8d6179b896c7ad5f14cd56ca25b821 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Laurent=20Th=C3=A9venoux?= Date: Thu, 29 Feb 2024 15:03:28 +0100 Subject: [PATCH] Add support for the Preelaborable_Initialization attribute --- ada/ast.py | 3 ++- .../preelaborable_initialization/test.adb | 11 ++++++++ .../preelaborable_initialization/test.out | 25 +++++++++++++++++++ .../preelaborable_initialization/test.yaml | 2 ++ 4 files changed, 40 insertions(+), 1 deletion(-) create mode 100644 testsuite/tests/name_resolution/preelaborable_initialization/test.adb create mode 100644 testsuite/tests/name_resolution/preelaborable_initialization/test.out create mode 100644 testsuite/tests/name_resolution/preelaborable_initialization/test.yaml diff --git a/ada/ast.py b/ada/ast.py index ca95e43ec..012066644 100644 --- a/ada/ast.py +++ b/ada/ast.py @@ -20586,7 +20586,8 @@ def xref_equation(): 'Has_Tagged_Values', 'Definite', 'Constrained', 'Initialized', 'Valid_Scalars', 'Unconstrained_Array', 'Library_Level', - 'Denorm', 'Signed_Zeros'), + 'Denorm', 'Signed_Zeros', + 'Preelaborable_Initialization'), Entity.prefix.sub_equation & Bind(Self.type_var, Self.bool_type), diff --git a/testsuite/tests/name_resolution/preelaborable_initialization/test.adb b/testsuite/tests/name_resolution/preelaborable_initialization/test.adb new file mode 100644 index 000000000..63c31c9f9 --- /dev/null +++ b/testsuite/tests/name_resolution/preelaborable_initialization/test.adb @@ -0,0 +1,11 @@ +-- Test for the Preelaborable aspect/attribute name resolution + +procedure Test is + type T is new Integer; + + type U is new T with + Preelaborable_Initializaton => T'Preelaborable_Initialization; + pragma Test_Block; +begin + null; +end Test; diff --git a/testsuite/tests/name_resolution/preelaborable_initialization/test.out b/testsuite/tests/name_resolution/preelaborable_initialization/test.out new file mode 100644 index 000000000..87d32de19 --- /dev/null +++ b/testsuite/tests/name_resolution/preelaborable_initialization/test.out @@ -0,0 +1,25 @@ +Analyzing test.adb +################## + +Resolving xrefs for node +******************************************************** + +Expr: + references: None + type: None + expected type: None +Expr: + references: None + type: + expected type: None +Expr: + references: + type: + expected type: None +Expr: + references: None + type: None + expected type: None + + +Done. diff --git a/testsuite/tests/name_resolution/preelaborable_initialization/test.yaml b/testsuite/tests/name_resolution/preelaborable_initialization/test.yaml new file mode 100644 index 000000000..173e325ff --- /dev/null +++ b/testsuite/tests/name_resolution/preelaborable_initialization/test.yaml @@ -0,0 +1,2 @@ +driver: name-resolution +input_sources: [test.adb]