Skip to content

Instantly share code, notes, and snippets.

@joseph-montanez
Created March 1, 2013 06:17
Show Gist options
  • Save joseph-montanez/5062788 to your computer and use it in GitHub Desktop.
Save joseph-montanez/5062788 to your computer and use it in GitHub Desktop.
pragma License (Gpl);
pragma Ada_2012;
with Ada.Text_IO;
procedure App is
package I_IO is new Ada.Text_IO.Integer_IO (Integer);
function Add (X : in Integer; Y : in Integer) return Integer
with
Pre => X > 5,
Post => Add'Result > 5;
A : Integer;
B : Integer;
function Add (X : in Integer; Y : in Integer) return Integer
is
begin
return X + Y;
end Add;
begin
A := 1;
B := 1;
Ada.Text_IO.Put ("Output: ");
I_IO.Put (Add (A, B));
return;
end App;
project App is
for Source_Dirs use (".");
for Main use ("app.adb");
package Builder is
for Default_Switches ("ada") use ("-gnatVa", "-gnatwa", "-gnaty", "-g");
end Builder;
package Compiler is
for Default_Switches ("ada") use ("-gnatVa", "-gnatwa", "-gnaty", "-g");
end Compiler;
end App;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment