Skip to content

Commit 720991b

Browse files
Petr Bauchchrisr-diffblue
authored andcommitted
Add test for attribute signal
Just to check that gnat2goto will not produce the unsupported feature report.
1 parent db2ffc5 commit 720991b

File tree

3 files changed

+28
-0
lines changed

3 files changed

+28
-0
lines changed
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
procedure Pragma_Machine_Attribute is
2+
3+
procedure Timer_Interrupt;
4+
pragma Machine_Attribute (Timer_Interrupt, "signal");
5+
6+
Seconds_Count : Integer := 0;
7+
Interval : Integer := 1;
8+
Timeout : Boolean := False;
9+
10+
procedure Timer_Interrupt is
11+
begin
12+
Seconds_Count := Seconds_Count + 1;
13+
if Seconds_Count = Interval then
14+
Timeout := True;
15+
end if;
16+
end Timer_Interrupt;
17+
18+
begin
19+
Timer_Interrupt;
20+
21+
pragma Assert (Timeout and Interval = Seconds_Count);
22+
23+
end Pragma_Machine_Attribute;
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[1] file pragma_machine_attribute.adb line 21 assertion: SUCCESS
2+
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)