aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorNeil Booth <neil@gcc.gnu.org>2000-04-08 04:12:53 +0000
committerNeil Booth <neil@gcc.gnu.org>2000-04-08 04:12:53 +0000
commit4db32ec69275ea82e039637fc078b683c0068884 (patch)
treef4c42ad06879cd61c5f3a6d6aa44242a963fea59 /gcc
parent64aaf40718c2f7664d6bb6de25575ca2451a59b3 (diff)
downloadgcc-4db32ec69275ea82e039637fc078b683c0068884.zip
gcc-4db32ec69275ea82e039637fc078b683c0068884.tar.gz
gcc-4db32ec69275ea82e039637fc078b683c0068884.tar.bz2
* cpp-nullchar.c: New test.
From-SVN: r33014
Diffstat (limited to 'gcc')
-rw-r--r--gcc/testsuite/gcc.dg/cpp-nullchar.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/cpp-nullchar.c b/gcc/testsuite/gcc.dg/cpp-nullchar.c
new file mode 100644
index 0000000..6e49e93
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/cpp-nullchar.c
@@ -0,0 +1,30 @@
+/* Copyright (C) 2000 Free Software Foundation, Inc. */
+
+/* { dg-do run } */
+
+/* This string contains embedded nulls which should be preserved. */
+static char x[] = "A string /* { dg-warning "null.*string" "nulls in string" { target *-*-* } 6 } */
+
+#include <string.h>
+
+int
+main ()
+{
+ return strlen(x) != 8;
+}
+
+/* This comment with preprocessor silently. */
+
+/* Some random nulls among whitespace to be warned about once. */
+
+#define N
+#if 0 == '#endif
+
+#if 0#endif
+
+/* The null here should act as a whitespace separator. */
+#define X
+#if X != 1
+#error /* { dg-bogus "error" "Check X defined OK" } */
+#endif
+