Skip to content

Commit 360d666

Browse files
committed
Add test case for handling subprogram_body_stub
1 parent 0d40239 commit 360d666

File tree

4 files changed

+28
-0
lines changed

4 files changed

+28
-0
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
separate (P)
2+
procedure Inc (N : in out Integer) is
3+
Old_N : constant Integer := N;
4+
begin
5+
N := N + 1;
6+
pragma Assert (N = Old_N + 1);
7+
end Inc;
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
-- Use *.asu file extension for a subunit so that it is not included as a
2+
-- a top level unit to be analysed using by the regression test system.
3+
-- The gnat front-end will automatically analyse the subunit when it
4+
-- encounters the sybprogram_body_stub.
5+
pragma Source_File_Name (
6+
Subunit_File_Name => "*.asu",
7+
Dot_Replacement => "-");
8+
9+
procedure P (X : in out integer) is
10+
procedure Inc (N : in out Integer) is separate;
11+
Old_X : constant Integer := X;
12+
begin
13+
Inc (X);
14+
pragma Assert (X = Old_X + 1);
15+
end P;
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[2] file p-inc.asu line 6 assertion: SUCCESS
2+
[1] file p.adb line 14 assertion: FAILURE
3+
VERIFICATION FAILED
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)