-
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/machu/preprocessor-support' into 'master'
Preprocessing support in generated code See merge request eng/ide/libadalang-tools!249
- Loading branch information
Showing
9 changed files
with
152 additions
and
3 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
20 changes: 20 additions & 0 deletions
20
testsuite/tests/test/tgen_preprocessor_definitions/src/procedure_under_test.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,20 @@ | ||
with Text_IO; use Text_IO; | ||
|
||
package body Procedure_Under_Test is | ||
|
||
procedure Test (Some_Value : Integer) is | ||
begin | ||
#if debug | ||
#if debug_symbol="true" | ||
if Some_Value > 0 and Some_Public_Value_1 = 0 and Some_Public_Value_2 = 0 then | ||
Put_Line (Some_Public_String); | ||
end if; | ||
#else | ||
Put_Line (Some_Public_String); | ||
#end if; | ||
#else | ||
Put_Line (Test_Failed); | ||
#end if; | ||
end Test; | ||
|
||
end Procedure_Under_Test; |
19 changes: 19 additions & 0 deletions
19
testsuite/tests/test/tgen_preprocessor_definitions/src/procedure_under_test.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,19 @@ | ||
package Procedure_Under_Test is | ||
|
||
Some_Public_String : String := $debug_string; | ||
|
||
#if debug | ||
Some_Public_Value_1 : Integer := 0; | ||
#else | ||
Some_Public_Value_1 : Integer := 200; | ||
#end if; | ||
|
||
#if debug_symbol="true" | ||
Some_Public_Value_2 : Integer := 0; | ||
#else | ||
Some_Public_Value_2 : Integer := 200; | ||
#end if; | ||
|
||
procedure Test (Some_Value : Integer); | ||
|
||
end Procedure_Under_Test; |
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 @@ | ||
#!/usr/bin/env bash | ||
|
||
rm -rf obj | ||
gnattest -q -P user_project.gpr --gen-test-vectors |
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 @@ | ||
description: Check that preprocessing is being handled properly by TGen | ||
|
||
driver: shell_script |
11 changes: 11 additions & 0 deletions
11
testsuite/tests/test/tgen_preprocessor_definitions/user_project.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,11 @@ | ||
project User_Project is | ||
|
||
for Source_Dirs use ("src"); | ||
for Create_Missing_Dirs use "True"; | ||
for Object_Dir use "obj"; | ||
|
||
package Compiler is | ||
for Default_Switches ("Ada") use ("-gnateDdebug", "-gnateDdebug_symbol=true", "-gnateDdebug_string=""hello"""); | ||
end Compiler; | ||
|
||
end User_Project; |