-
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 'topic/37-stub-ada-version' into 'master'
Test: Bump default Ada version to Ada 2012 in stub helpers Closes #37 See merge request eng/ide/libadalang-tools!264
- Loading branch information
Showing
20 changed files
with
188 additions
and
18 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
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
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,6 @@ | ||
package body Dep is | ||
|
||
function Get_Acc (X : aliased Integer) return Int_Acc is | ||
(X'Unrestricted_Access); | ||
|
||
end Dep; |
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,7 @@ | ||
package Dep is | ||
|
||
type Int_Acc is access all Integer; | ||
|
||
function Get_Acc (X : aliased Integer) return Int_Acc; | ||
|
||
end Dep; |
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 Dep; | ||
|
||
package body Pkg is | ||
|
||
function Make_Acc (X : aliased Integer) return Dep.Int_Acc is | ||
begin | ||
return Dep.Get_Acc (X); | ||
end Make_Acc; | ||
|
||
end Pkg; |
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,7 @@ | ||
with Dep; | ||
|
||
package Pkg is | ||
|
||
function Make_Acc (X : aliased Integer) return Dep.Int_Acc; | ||
|
||
end Pkg; |
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 @@ | ||
project Prj is | ||
|
||
for Object_Dir use "obj"; | ||
|
||
package Compiler is | ||
|
||
for Default_Switches ("Ada") use ("-gnat12"); | ||
|
||
end Compiler; | ||
|
||
end Prj; |
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,2 @@ | ||
pragma Ada_2012; | ||
pragma Ada_2005; |
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,13 @@ | ||
#!/bin/bash | ||
|
||
gnattest -P prj.gpr --stub -q --stubs-dir=./stub_default | ||
gprbuild -P obj/gnattest_stub/harness/test_drivers.gpr -q | ||
|
||
# Check we have Ada_2012 by default | ||
grep "pragma Ada_2012;" ./obj/stub_default/Prj/dep-stub_data.ads | ||
|
||
# Same thing, but with Ada_2005 | ||
gnattest -P prj.gpr --stub -q --stubs-dir=./stub_05 -gnat05 | ||
gprbuild -P obj/gnattest_stub/harness/test_drivers.gpr -q | ||
|
||
grep "pragma Ada_2005;" ./obj/stub_05/Prj/dep-stub_data.ads |
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,6 @@ | ||
description: | ||
Check that the stubs generated by gnattest are compatible with Ada 2012. | ||
This used not to be the case because gnattest added a pragma Ada_2005 in | ||
some of the stub data units. | ||
|
||
driver: shell_script |
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,12 @@ | ||
package body Dep is | ||
|
||
function Get_CB return access function (X : aliased Integer) return Int_Acc | ||
is | ||
begin | ||
return Get_Acc'Unrestricted_Access; | ||
end Get_CB; | ||
|
||
function Get_Acc (X : aliased Integer) return Int_Acc is | ||
(X'Unrestricted_Access); | ||
|
||
end Dep; |
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,9 @@ | ||
package Dep is | ||
|
||
type Int_Acc is access all Integer; | ||
|
||
function Get_Acc (X : aliased Integer) return Int_Acc; | ||
|
||
function Get_CB return access function (X : aliased Integer) return Int_Acc; | ||
|
||
end Dep; |
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,12 @@ | ||
with Dep; | ||
|
||
package body Pkg is | ||
|
||
function Make_Acc (X : aliased Integer) return Dep.Int_Acc is | ||
CB : access function (X : aliased Integer) return Dep.Int_Acc := | ||
Dep.Get_CB; | ||
begin | ||
return CB (X); | ||
end Make_Acc; | ||
|
||
end Pkg; |
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,7 @@ | ||
with Dep; | ||
|
||
package Pkg is | ||
|
||
function Make_Acc (X : aliased Integer) return Dep.Int_Acc; | ||
|
||
end Pkg; |
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 @@ | ||
project Prj is | ||
|
||
for Object_Dir use "obj"; | ||
|
||
package Compiler is | ||
|
||
for Default_Switches ("Ada") use ("-gnat12"); | ||
|
||
end Compiler; | ||
|
||
end Prj; |
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 @@ | ||
dep.adb:63:10: warning: Stub for Get_CB is unimplemented, this might affect some tests [enabled by default] |
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 @@ | ||
#!/bin/bash | ||
|
||
gnattest -P prj.gpr --stub -q | ||
gprbuild -P obj/gnattest_stub/harness/test_drivers.gpr -q |
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,6 @@ | ||
description: | ||
Check that the stubs generated by gnattest are compatible with Ada 2012. | ||
This used not to be the case because gnattest added a pragma Ada_2005 in | ||
some of the stub data units. | ||
|
||
driver: shell_script |