-
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.
V713-005: Improve
get_aspect
for pragma Convention
& co.
- Loading branch information
Showing
5 changed files
with
67 additions
and
1 deletion.
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
12 changes: 12 additions & 0 deletions
12
testsuite/tests/properties/get_aspect_pragma_convention/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,12 @@ | ||
procedure Test is | ||
X : Integer := 0 | ||
with Convention => C; | ||
--% node.p_get_aspect("Convention").value | ||
|
||
Y : Integer := 0; | ||
--% node.p_get_aspect("Convention").value | ||
pragma Convention (C, Y); | ||
begin | ||
null; | ||
end Test; | ||
|
11 changes: 11 additions & 0 deletions
11
testsuite/tests/properties/get_aspect_pragma_convention/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 <ObjectDecl ["X"] test.adb:2:4-3:28> | ||
==================================================== | ||
|
||
Eval 'node.p_get_aspect("Convention").value' | ||
Result: <Id "C" test.adb:3:26-3:27> | ||
|
||
Working on node <ObjectDecl ["Y"] test.adb:6:4-6:21> | ||
==================================================== | ||
|
||
Eval 'node.p_get_aspect("Convention").value' | ||
Result: <Id "C" test.adb:8:23-8:24> |
2 changes: 2 additions & 0 deletions
2
testsuite/tests/properties/get_aspect_pragma_convention/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] |
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,21 @@ | ||
type: bugfix | ||
title: Improve ``get_aspect`` for ``pragma Convention`` | ||
description: | | ||
Previously, calling ``get_aspect("Convention")`` on the declaration of | ||
``X`` in the snippet below would return an ``Aspect`` struct whose | ||
``value`` field would contain the identifier ``X``: | ||
..code:: ada | ||
X : Integer; | ||
pragma Convention (C, X); | ||
It will now return ``C``, because that's what would have been returned if | ||
one had used the Ada 2012 aspect notation instead: | ||
..code:: ada | ||
X : Integer | ||
with Convention => C; | ||
date: 2022-09-12 |