Skip to content

Commit 7d755cc

Browse files
authored
Merge pull request #265 from tjj2017/enum_in_param
Add a with a procedure "in" parameter which is an element of an array…
2 parents dc35772 + 6fdb866 commit 7d755cc

File tree

4 files changed

+33
-0
lines changed

4 files changed

+33
-0
lines changed
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
procedure Enum_In is
2+
type Enum is (One, Two, Three, Four, Five, Six);
3+
4+
subtype More_Than_Two is Enum range Three .. Six;
5+
6+
type Number_Array_Type is array (1 .. 6) of Enum;
7+
8+
Number_Array : constant Number_Array_Type :=
9+
(1 => One,
10+
2 => Two,
11+
3 => Three,
12+
4 => Four,
13+
5 => Five,
14+
6 => Six);
15+
16+
procedure P_Enum_In (E : Enum) is
17+
begin
18+
if E > Two then
19+
pragma Assert (E in More_Than_Two);
20+
end if;
21+
end P_Enum_In;
22+
begin
23+
P_Enum_In (Number_Array (4));
24+
end Enum_In;
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
ALL XFAIL gnat2goto failed precondition from ireps.ads:1655
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
[precondition_instance.1] memcpy src/dst overlap: SUCCESS
2+
[precondition_instance.2] memcpy source region readable: SUCCESS
3+
[precondition_instance.3] memcpy destination region writeable: SUCCESS
4+
[1] file enum_in.adb line 19 assertion: SUCCESS
5+
VERIFICATION SUCCESSFUL
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
from test_support import *
2+
3+
prove()

0 commit comments

Comments
 (0)