Skip to content

Do cu specs #113

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jan 28, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions gnat2goto/driver/driver.adb
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,20 @@ package body Driver is
end;

if not Add_Start then
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Default mode "don't add comments" to this thing I had to figure out what it is doing by looking at the the out parameter in another function.
Status: "on".
:)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed, and noted for the next time.

-- If the compilation unit is not a subprogram body then there is
-- no function/procedure to call
-- CBMC does not like that so we add cprover_start with empty body
Start_Symbol.Name := Start_Name;
Start_Symbol.PrettyName := Start_Name;
Start_Symbol.BaseName := Start_Name;

Set_Return_Type (Start_Type, Void_Type);

Start_Symbol.SymType := Start_Type;
Start_Symbol.Value := Start_Body;
Start_Symbol.Mode := Intern ("C");

Global_Symbol_Table.Insert (Start_Name, Start_Symbol);
Put_Line (Sym_Tab_File,
Create (SymbolTable2Json (Global_Symbol_Table)).Write);
else
Expand Down
503 changes: 395 additions & 108 deletions gnat2goto/driver/tree_walk.adb

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
with Ada.Text_IO;
procedure Test_Long_Integer is
x: Long_Long_Integer := 1152921504606846976;
begin
Expand Down
9 changes: 9 additions & 0 deletions testsuite/gnat2goto/tests/package_type/package_type.adb
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
with Test; use Test;
-- without "use" just "with" does not introduce the operators associated with
-- the type from with-ed package
procedure Package_Type
is
Small_Number : Range_10 := 4;
begin
pragma Assert (Small_Number * 2 = 8);
end Package_Type;
4 changes: 4 additions & 0 deletions testsuite/gnat2goto/tests/package_type/test.ads
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
package Test
is
type Range_10 is range 1..10;
end Test;
1 change: 1 addition & 0 deletions testsuite/gnat2goto/tests/package_type/test.out
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
VERIFICATION SUCCESSFUL
3 changes: 3 additions & 0 deletions testsuite/gnat2goto/tests/package_type/test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from test_support import *

prove()
7 changes: 7 additions & 0 deletions testsuite/gnat2goto/tests/packages/packages.adb
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
with Test;

procedure Packages
is
begin
pragma Assert (Test.Double (1) = 2);
end Packages;
8 changes: 8 additions & 0 deletions testsuite/gnat2goto/tests/packages/test.adb
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package body Test
is
function Double(Input : Positive) return Positive
is
begin
return Input + Input;
end Double;
end Test;
4 changes: 4 additions & 0 deletions testsuite/gnat2goto/tests/packages/test.ads
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
package Test
is
function Double(Input : Positive) return Positive;
end Test;
1 change: 1 addition & 0 deletions testsuite/gnat2goto/tests/packages/test.opt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ALL XFAIL cbmc returns failed verification (calling function without body)
3 changes: 3 additions & 0 deletions testsuite/gnat2goto/tests/packages/test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from test_support import *

prove()