aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/cpp-if4.c
diff options
context:
space:
mode:
authorZack Weinberg <zack@wolery.cumb.org>2000-05-10 19:29:20 +0000
committerZack Weinberg <zack@gcc.gnu.org>2000-05-10 19:29:20 +0000
commite43a157747ca2a71a4a55c16b2bc6299e9a636c8 (patch)
treef3b430924614b3fbd0ba60c6319d5b379b8108b6 /gcc/testsuite/gcc.dg/cpp-if4.c
parentfa5572714eed920f6d162a1d7ab08d990926ba83 (diff)
downloadgcc-e43a157747ca2a71a4a55c16b2bc6299e9a636c8.zip
gcc-e43a157747ca2a71a4a55c16b2bc6299e9a636c8.tar.gz
gcc-e43a157747ca2a71a4a55c16b2bc6299e9a636c8.tar.bz2
cppexp.c (lex): Use %.*s to print non-NUL-terminated string.
* cppexp.c (lex): Use %.*s to print non-NUL-terminated string. Make error message friendlier. From-SVN: r33829
Diffstat (limited to 'gcc/testsuite/gcc.dg/cpp-if4.c')
-rw-r--r--gcc/testsuite/gcc.dg/cpp-if4.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/cpp-if4.c b/gcc/testsuite/gcc.dg/cpp-if4.c
new file mode 100644
index 0000000..84764fb
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/cpp-if4.c
@@ -0,0 +1,8 @@
+/* Regression test for proper error message. The token name isn't
+ NUL terminated, so we would print garbage after it. */
+/* { dg-do compile } */
+
+#if 1 += 2 /* { dg-error "'\\+=' is not allowed" "+= in if" } */
+syntax_error
+#endif
+int foo;