aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg
diff options
context:
space:
mode:
authorAndrew Pinski <pinskia@physics.uc.edu>2005-11-04 00:23:01 +0000
committerAndrew Pinski <pinskia@gcc.gnu.org>2005-11-03 16:23:01 -0800
commit651ed94280e4b88bf4fb69be0451cf2766ec9ab0 (patch)
treee997615dea22c4f55a4cadbd3c4f72ca8ca0ca82 /gcc/testsuite/gcc.dg
parentabe60efd4bbd222f27ea4095ed0cb5f6c2baf09b (diff)
downloadgcc-651ed94280e4b88bf4fb69be0451cf2766ec9ab0.zip
gcc-651ed94280e4b88bf4fb69be0451cf2766ec9ab0.tar.gz
gcc-651ed94280e4b88bf4fb69be0451cf2766ec9ab0.tar.bz2
re PR preprocessor/22042 (stringification BUG)
2005-11-03 Andrew Pinski <pinskia@physics.uc.edu> PR preprocessor/22042 * macro.c (_cpp_builtin_macro_text): Lower the needed max buffer size. (cpp_quote_string): Don't octalify non printable charactors. 2005-11-03 Andrew Pinski <pinskia@physics.uc.edu> PR preprocessor/22042 * gcc.dg/cpp/strify4.c: New test. From-SVN: r106463
Diffstat (limited to 'gcc/testsuite/gcc.dg')
-rw-r--r--gcc/testsuite/gcc.dg/cpp/strify4.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/cpp/strify4.c b/gcc/testsuite/gcc.dg/cpp/strify4.c
new file mode 100644
index 0000000..b8b2f11
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/cpp/strify4.c
@@ -0,0 +1,25 @@
+/* { dg-do run } */
+/* Tests we stringify without changing unprintable characts.
+
+ Andrew Pinski */
+
+extern int strcmp (const char *, const char *);
+extern int puts (const char *);
+extern void abort (void);
+#define err(str) do { puts(str); abort(); } while (0)
+
+
+#define S(X) S2(X)
+#define S2(X) #X
+#define TAB " " /* Note there is a tab character here. */
+
+int main (int argc, char *argv[])
+{
+ /* The space before "bar" here is vital. */
+ char a[] = S(S(TAB));
+
+ if (strcmp (a, "\"\\\" \\\"\""))
+ err ("stringification caused octal");
+
+ return 0;
+}