-
Notifications
You must be signed in to change notification settings - Fork 12
Add support for N_Block_Statement node #156
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
sonodtt
merged 1 commit into
diffblue:master
from
sonodtt:N_Block_Statement_node_support
Mar 19, 2019
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
13 changes: 0 additions & 13 deletions
13
testsuite/gnat2goto/tests/statement_new_block_N_Block_Statement/Statement_Block.adb
This file was deleted.
Oops, something went wrong.
47 changes: 47 additions & 0 deletions
47
testsuite/gnat2goto/tests/statement_new_block_N_Block_Statement/statement_block.adb
This file contains hidden or 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,47 @@ | ||
function Statement_Block return Integer is | ||
Var1 : Integer :=1; | ||
Var2 : Integer; | ||
|
||
function Sum_Plus_Three(Left, Right : Integer) return Integer is | ||
Local1 : Integer; | ||
begin | ||
declare | ||
Local2 : Integer := 1; | ||
begin | ||
Local1 := Local2 + Var1 + 1; | ||
Pragma Assert (Local1=3); | ||
end; | ||
return (Left + Right + Local1); | ||
end Sum_Plus_Three; | ||
|
||
begin | ||
---------------------------------------- | ||
-- the below nested function call works, but is out of scope | ||
-- and nested functions are not yet fully supported / tested | ||
---------------------------------------- | ||
-- Var1 := Sum_Plus_Three(3,4); | ||
-- pragma Assert (Var1=10); | ||
---------------------------------------- | ||
|
||
declare | ||
Var3 : Integer :=2; | ||
begin | ||
Var2 := Var3; | ||
pragma Assert (Var2=2); | ||
declare | ||
Var4 : Integer := Var3; | ||
begin | ||
Var2 := Var4 + Var2; | ||
Pragma Assert (Var2=4); | ||
end; | ||
end; | ||
|
||
declare | ||
Var5 : Integer := 6; | ||
begin | ||
Var2 := Var5 + Var2; | ||
end; | ||
|
||
pragma Assert (Var2=10); | ||
return Var2; | ||
end Statement_Block; |
1 change: 0 additions & 1 deletion
1
testsuite/gnat2goto/tests/statement_new_block_N_Block_Statement/test.opt
This file was deleted.
Oops, something went wrong.
5 changes: 5 additions & 0 deletions
5
testsuite/gnat2goto/tests/statement_new_block_N_Block_Statement/test.out
This file contains hidden or 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,5 @@ | ||
[4] file statement_block.adb line 12 assertion: SUCCESS | ||
[1] file statement_block.adb line 30 assertion: SUCCESS | ||
[2] file statement_block.adb line 35 assertion: SUCCESS | ||
[3] file statement_block.adb line 45 assertion: SUCCESS | ||
VERIFICATION SUCCESSFUL |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not append
do_subprogram_or_block
directly?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interface. Wrapper. Consistent with others. If impl. changes in future, has further checks etc - then this does not change, and the (consistent) structure is in place. Also the wrapper function has space for ... comments!