-
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 'leo/135_name_conflict' into 'master'
TGen: Fix wrong code generation for wrappers in case of name conflict Closes #135 See merge request eng/ide/libadalang-tools!187
- Loading branch information
Showing
10 changed files
with
127 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
with Ada.Text_IO; use Ada.Text_IO; | ||
|
||
with TGen; | ||
with Simple.TGen_Wrappers; | ||
|
||
procedure Main is | ||
begin | ||
begin | ||
Simple.TGen_Wrappers.test (4); | ||
exception | ||
when TGen.Precondition_Error => | ||
Put_Line ("Unexpected exception from tgen wrapper"); | ||
end; | ||
begin | ||
Simple.TGen_Wrappers.test(1); | ||
Put_Line ("Missing exception from tgen wrapper"); | ||
exception | ||
when TGen.Precondition_Error => | ||
null; | ||
end; | ||
end Main; |
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 @@ | ||
#!/bin/bash | ||
|
||
LALTOOLS_ROOT=$(dirname $(which gnattest))/.. | ||
TEMPLATES_PATH=$LALTOOLS_ROOT/share/tgen/templates | ||
mkdir -p test/obj obj | ||
tgen_marshalling -P test/test.gpr --templates-dir=$TEMPLATES_PATH -o test/tgen_support test/simple.ads | ||
gprbuild -q -P test_wrapper.gpr -cargs -gnata |
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 @@ | ||
description: Test that TGen generates precondition wrappers that can be | ||
compiled when a parameter of the tested subprogram has the same name as | ||
the package in which it is defined. | ||
|
||
driver: shell_script | ||
control: | ||
- [XFAIL, 'x86', 'Marshalling not working for 32bits (UB03-008)'] |
5 changes: 5 additions & 0 deletions
5
testsuite/tests/test/135_tgen_wrapper_conflict/test/simple.adb
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 @@ | ||
package body Simple is | ||
|
||
procedure Test (Simple : Integer) is null; | ||
|
||
end Simple; |
6 changes: 6 additions & 0 deletions
6
testsuite/tests/test/135_tgen_wrapper_conflict/test/simple.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 @@ | ||
package Simple is | ||
|
||
procedure Test (Simple : Integer) with | ||
Pre => Simple >= 1 and then Simple >= 2; | ||
|
||
end Simple; |
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 @@ | ||
project Test is | ||
|
||
for Object_Dir use "obj"; | ||
for Source_Dirs use ("."); | ||
|
||
end Test; |
10 changes: 10 additions & 0 deletions
10
testsuite/tests/test/135_tgen_wrapper_conflict/test_wrapper.gpr
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 "test/tgen_support/tgen_support.gpr"; | ||
with "tgen_rts.gpr"; | ||
|
||
project Test_Wrapper is | ||
|
||
for Object_Dir use "obj"; | ||
for Source_Dirs use ("."); | ||
for Main use ("main.adb"); | ||
|
||
end Test_Wrapper; |