diff options
author | Fred Fish <fnf@specifix.com> | 2008-01-07 17:23:40 +0000 |
---|---|---|
committer | Tom Tromey <tromey@gcc.gnu.org> | 2008-01-07 17:23:40 +0000 |
commit | 681c6ab0dac42efce0ef2169e193e2fd99c34153 (patch) | |
tree | af95efa577b60bab897bc59c18fc2148c61eb432 /gcc | |
parent | 2eac9a765c07d55499a32f7e8bbd76440969665a (diff) | |
download | gcc-681c6ab0dac42efce0ef2169e193e2fd99c34153.zip gcc-681c6ab0dac42efce0ef2169e193e2fd99c34153.tar.gz gcc-681c6ab0dac42efce0ef2169e193e2fd99c34153.tar.bz2 |
re PR preprocessor/30363 (Support for -traditional-cpp is incomplete in current gcc relative to gcc 2.95.3)
libcpp
2008-01-07 Fred Fish <fnf@specifix.com>
PR preprocessor/30363:
* traditional.c (replace_args_and_push): Add local variable
cxtquote, calculate the replacement text size assuming a
worst case of every input character quoted with backslash,
and properly handle output quoting of quote characters in
actual arguments used in function-like macros.
gcc/testsuite
2008-01-07 Fred Fish <fnf@specifix.com>
PR preprocessor/30363:
* gcc.dg/cpp/trad/macroargs.c: Add code to test quoting in
macro expansions.
From-SVN: r131379
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/testsuite/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/cpp/trad/macroargs.c | 13 |
2 files changed, 19 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index ee0d673..6a9f9b5 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2008-01-07 Fred Fish <fnf@specifix.com> + + PR preprocessor/30363: + * gcc.dg/cpp/trad/macroargs.c: Add code to test quoting in + macro expansions. + 2008-01-07 Paul Thomas <pault@gcc.gnu.org> PR fortran/34672 diff --git a/gcc/testsuite/gcc.dg/cpp/trad/macroargs.c b/gcc/testsuite/gcc.dg/cpp/trad/macroargs.c index ce28ccc..c5f91d9 100644 --- a/gcc/testsuite/gcc.dg/cpp/trad/macroargs.c +++ b/gcc/testsuite/gcc.dg/cpp/trad/macroargs.c @@ -8,6 +8,17 @@ extern void abort (void); +void testquoting () +{ + const char *str1 = f("a", "\"a\""); + const char *str2 = f( \t, " \t"); + + if (strcmp (str1, "\"a\" \"\\\"a\\\"\"")) + abort (); + if (strcmp (str2, " \t \" \\t\"")) + abort (); +} + int main () { const char *str1 = f( foo ,bar); @@ -26,5 +37,7 @@ foo , 2"), "1 , 2")) abort (); + testquoting (); + return 0; } |