Skip to content

Commit 8612cbd

Browse files
committed
Fix based on comments
1 parent e47f6d2 commit 8612cbd

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

testsuite/gnat2goto/tests/access-to-object/main.adb

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,20 @@ procedure Main is
33
type Day_Of_Month_Access is access all Day_Of_Month;
44

55
-- funny case where the subtype-indication has subtype-mark
6-
type C_String_Ptr is access String (1 .. Positive'Last);
6+
type Restricted_Day_Of_Month_Access is access all Day_Of_Month range 10 .. 15;
77

88
A : aliased Day_Of_Month;
99
Ptr1 : Day_Of_Month_Access := A'Access;
1010
Ptr2 : Day_Of_Month_Access := A'Access;
11+
12+
Restricted_A : aliased Day_Of_Month range 10 .. 15 := 12;
13+
Ptr3 : Restricted_Day_Of_Month_Access := Restricted_A'Access;
1114
begin
1215
Ptr1.all := 2;
1316
pragma Assert (A=2); -- should succeed
1417
Ptr2.all := 5;
1518
pragma Assert (Ptr1.all=4); -- should fail
19+
20+
Ptr3.all := 11;
21+
pragma Assert (Restricted_A = 11); -- should succeed
1622
end;
Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1-
[main.assertion.1] line 13 assertion A=2: SUCCESS
2-
[main.assertion.2] line 15 assertion Ptr1.all=4: FAILURE
1+
[main.assertion.1] line 16 assertion A=2: SUCCESS
2+
[main.assertion.2] line 18 assertion Ptr1.all=4: FAILURE
3+
[main.assertion.3] line 21 assertion Restricted_A = 11: SUCCESS
34
VERIFICATION FAILED

0 commit comments

Comments
 (0)