Skip to content

Commit 56f1226

Browse files
Merge pull request #113 from xbauch/do_cu_specs
Do cu specs
2 parents c61cba5 + de7ab01 commit 56f1226

File tree

12 files changed

+449
-109
lines changed

12 files changed

+449
-109
lines changed

gnat2goto/driver/driver.adb

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,20 @@ package body Driver is
257257
end;
258258

259259
if not Add_Start then
260+
-- If the compilation unit is not a subprogram body then there is
261+
-- no function/procedure to call
262+
-- CBMC does not like that so we add cprover_start with empty body
263+
Start_Symbol.Name := Start_Name;
264+
Start_Symbol.PrettyName := Start_Name;
265+
Start_Symbol.BaseName := Start_Name;
266+
267+
Set_Return_Type (Start_Type, Void_Type);
268+
269+
Start_Symbol.SymType := Start_Type;
270+
Start_Symbol.Value := Start_Body;
271+
Start_Symbol.Mode := Intern ("C");
272+
273+
Global_Symbol_Table.Insert (Start_Name, Start_Symbol);
260274
Put_Line (Sym_Tab_File,
261275
Create (SymbolTable2Json (Global_Symbol_Table)).Write);
262276
else

gnat2goto/driver/tree_walk.adb

Lines changed: 395 additions & 108 deletions
Large diffs are not rendered by default.

testsuite/gnat2goto/tests/long_integer/test_long_integer.adb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
with Ada.Text_IO;
21
procedure Test_Long_Integer is
32
x: Long_Long_Integer := 1152921504606846976;
43
begin
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
with Test; use Test;
2+
-- without "use" just "with" does not introduce the operators associated with
3+
-- the type from with-ed package
4+
procedure Package_Type
5+
is
6+
Small_Number : Range_10 := 4;
7+
begin
8+
pragma Assert (Small_Number * 2 = 8);
9+
end Package_Type;
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
package Test
2+
is
3+
type Range_10 is range 1..10;
4+
end Test;
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
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()
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
with Test;
2+
3+
procedure Packages
4+
is
5+
begin
6+
pragma Assert (Test.Double (1) = 2);
7+
end Packages;
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
package body Test
2+
is
3+
function Double(Input : Positive) return Positive
4+
is
5+
begin
6+
return Input + Input;
7+
end Double;
8+
end Test;
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
package Test
2+
is
3+
function Double(Input : Positive) return Positive;
4+
end Test;

0 commit comments

Comments
 (0)