-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'machu/195-ada_2005-pragma-gets-added-in-a-loop' into 'm…
…aster' Emit `pragma Ada_2005` only once when generating stubs Closes #195 See merge request eng/ide/libadalang-tools!245
- Loading branch information
Showing
10 changed files
with
115 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
project Input is | ||
for Source_Dirs use ("src"); | ||
for Object_Dir use "obj"; | ||
for Source_Files use ("input.adb", "input.ads"); | ||
end Input; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
with "input"; | ||
|
||
project Ops is | ||
for Source_Dirs use ("src"); | ||
for Object_Dir use "obj"; | ||
|
||
for Source_Files use ("square.adb", "square.ads"); | ||
end Ops; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
|
||
with Text_IO; | ||
|
||
package body Input is | ||
function Read_Number return Integer is | ||
S : String := Text_IO.Get_Line; | ||
begin | ||
return Integer'Value (S); | ||
end Read_Number; | ||
end Input; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
package Input is | ||
function Read_Number return Integer; | ||
end Input; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
with Input; | ||
|
||
package body Square is | ||
|
||
function Square return Integer is | ||
A : Integer := Input.Read_Number; | ||
begin | ||
return A * A; | ||
end Square; | ||
|
||
end Square; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
package Square is | ||
function Square return Integer; | ||
-- Returns a square of a number | ||
end Square; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
-- begin read only | ||
-- id:2.2/00/ | ||
-- | ||
-- This section can be used to add with clauses if necessary. | ||
-- | ||
-- end read only | ||
|
||
pragma Ada_2005; | ||
-- begin read only | ||
-- end read only | ||
|
||
package Input.Stub_Data is | ||
|
||
-- begin read only | ||
-- id:2.2/04/a5520b8be5540073/b568d47f2e244743/0/Read_Number/ | ||
-- end read only | ||
type Stub_Data_Type_Read_Number_a5520b_b568d4 is record | ||
Read_Number_Result : Integer; | ||
|
||
Stub_Counter : Natural := 0; | ||
end record; | ||
Stub_Data_Read_Number_a5520b_b568d4 : Stub_Data_Type_Read_Number_a5520b_b568d4; | ||
procedure Set_Stub_Read_Number_a5520b_b568d4 | ||
(Read_Number_Result : Integer := Stub_Data_Read_Number_a5520b_b568d4.Read_Number_Result); | ||
-- begin read only | ||
-- end read only | ||
|
||
end Input.Stub_Data; | ||
-- begin read only | ||
-- id:2.2/00/ | ||
-- | ||
-- This section can be used to add with clauses if necessary. | ||
-- | ||
-- end read only | ||
|
||
pragma Ada_2005; | ||
-- begin read only | ||
-- end read only | ||
|
||
package Input.Stub_Data is | ||
|
||
-- begin read only | ||
-- id:2.2/04/a5520b8be5540073/b568d47f2e244743/0/Read_Number/ | ||
-- end read only | ||
type Stub_Data_Type_Read_Number_a5520b_b568d4 is record | ||
Read_Number_Result : Integer; | ||
|
||
Stub_Counter : Natural := 0; | ||
end record; | ||
Stub_Data_Read_Number_a5520b_b568d4 : Stub_Data_Type_Read_Number_a5520b_b568d4; | ||
procedure Set_Stub_Read_Number_a5520b_b568d4 | ||
(Read_Number_Result : Integer := Stub_Data_Read_Number_a5520b_b568d4.Read_Number_Result); | ||
-- begin read only | ||
-- end read only | ||
|
||
end Input.Stub_Data; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -e | ||
|
||
STUB_LOCATION='obj/gnattest_stub/stubs/Input/input-stub_data.ads' | ||
|
||
gnattest --stub -P ops.gpr 2> /dev/null | ||
cat $STUB_LOCATION | ||
gnattest --stub -P ops.gpr 2> /dev/null | ||
cat $STUB_LOCATION |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
description: | ||
gnattest test | ||
|
||
driver: shell_script |