Skip to content

Add a with a procedure "in" parameter which is an element of an array… #265

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
merged 1 commit into from
Jul 25, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions testsuite/gnat2goto/tests/enum_in_param/enum_in.adb
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
procedure Enum_In is
type Enum is (One, Two, Three, Four, Five, Six);

subtype More_Than_Two is Enum range Three .. Six;

type Number_Array_Type is array (1 .. 6) of Enum;

Number_Array : constant Number_Array_Type :=
(1 => One,
2 => Two,
3 => Three,
4 => Four,
5 => Five,
6 => Six);

procedure P_Enum_In (E : Enum) is
begin
if E > Two then
pragma Assert (E in More_Than_Two);
end if;
end P_Enum_In;
begin
P_Enum_In (Number_Array (4));
end Enum_In;
1 change: 1 addition & 0 deletions testsuite/gnat2goto/tests/enum_in_param/test.opt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ALL XFAIL gnat2goto failed precondition from ireps.ads:1655
5 changes: 5 additions & 0 deletions testsuite/gnat2goto/tests/enum_in_param/test.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[precondition_instance.1] memcpy src/dst overlap: SUCCESS
[precondition_instance.2] memcpy source region readable: SUCCESS
[precondition_instance.3] memcpy destination region writeable: SUCCESS
[1] file enum_in.adb line 19 assertion: SUCCESS
VERIFICATION SUCCESSFUL
3 changes: 3 additions & 0 deletions testsuite/gnat2goto/tests/enum_in_param/test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from test_support import *

prove()