diff options
author | Steve Baird <baird@adacore.com> | 2019-09-19 08:14:52 +0000 |
---|---|---|
committer | Pierre-Marie de Rodat <pmderodat@gcc.gnu.org> | 2019-09-19 08:14:52 +0000 |
commit | 0c27222c60b26cd21588576f140abd04f1d8a853 (patch) | |
tree | 644c9e9873f147c02c00846ae01ab92a4e3d0feb /gcc/testsuite/gnat.dg | |
parent | c3a75a09b8424c192b32a39fa273d27db5b9c039 (diff) | |
download | gcc-0c27222c60b26cd21588576f140abd04f1d8a853.zip gcc-0c27222c60b26cd21588576f140abd04f1d8a853.tar.gz gcc-0c27222c60b26cd21588576f140abd04f1d8a853.tar.bz2 |
[Ada] Accept concatentation arguments to pragma Annotate
In cases where pragma Annotate accepts a string literal as an argument,
we now also accept a concatenation of string literals.
2019-09-19 Steve Baird <baird@adacore.com>
gcc/ada/
* sem_prag.adb (Preferred_String_Type): A new function. Given an
expression, determines whether the preference rules defined for
the third-and-later arguments of pragma Annotate suffice to
determine the type of the expression. If so, then the preferred
type is returned; if not then Empty is returned. Handles
concatenations.
(Analyze_Pragma): Replace previous code, which dealt only with
string literals, with calls to the new Preferred_String_Type
function, which also handles concatenations.
* doc/gnat_rm/implementation_defined_pragmas.rst: Update
documentation for pragma Annotate.
* gnat_rm.texi: Regenerate.
gcc/testsuite/
* gnat.dg/annotation1.adb: New testcase.
From-SVN: r275957
Diffstat (limited to 'gcc/testsuite/gnat.dg')
-rw-r--r-- | gcc/testsuite/gnat.dg/annotation1.adb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/gcc/testsuite/gnat.dg/annotation1.adb b/gcc/testsuite/gnat.dg/annotation1.adb new file mode 100644 index 0000000..6ed14da --- /dev/null +++ b/gcc/testsuite/gnat.dg/annotation1.adb @@ -0,0 +1,7 @@ +-- { dg-do compile } + +procedure Annotation1 is + pragma Annotate (Some_Tool, Some_Action, "abc" & "def"); +begin + null; +end Annotation1;
\ No newline at end of file |