From: Neil Booth Date: Sat, 8 Apr 2000 04:12:53 +0000 (+0000) Subject: * cpp-nullchar.c: New test. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=4db32ec69275ea82e039637fc078b683c0068884;p=gcc.git * cpp-nullchar.c: New test. From-SVN: r33014 --- diff --git a/gcc/testsuite/gcc.dg/cpp-nullchar.c b/gcc/testsuite/gcc.dg/cpp-nullchar.c new file mode 100644 index 00000000000..6e49e930559 --- /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 + +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 +