Commit edf50130 by Zack Weinberg

cast-qual-1.c: Add missing dg-bogus tag.

1999-09-03 19:31 -0700  Zack Weinberg  <zack@bitmover.com>

	* gcc.dg/cast-qual-1.c: Add missing dg-bogus tag.
	* gcc.dg/compare1.c: Fix typo.
	* gcc-dg/cpp-unc.c, cpp-unc1.c, cpp-unc2.c, cpp-unc3.c: New
	files which test the preprocessor's unterminated conditional
	diagnostics.

From-SVN: r29097
parent 99dccabc
...@@ -20,7 +20,7 @@ bad_cast(const void *bar) ...@@ -20,7 +20,7 @@ bad_cast(const void *bar)
void void
good_assign(const void *bar) good_assign(const void *bar)
{ {
char *const *foo = bar; char *const *foo = bar; /* { dg-bogus "initialization discards" "discarding `const' warning" } */
} }
void void
......
...@@ -22,5 +22,5 @@ int main() ...@@ -22,5 +22,5 @@ int main()
{ {
enum machine_mode mode = DImode; enum machine_mode mode = DImode;
return (mode == Pmode); /* dg-bogus "warning:" "comparison between signed and unsigned" } */ return (mode == Pmode); /* { dg-bogus "warning:" "comparison between signed and unsigned" } */
} }
/* { dg-do preprocess } */
/* Tests for un-terminated conditional diagnostics.
Copyright (c) 1999 Free Software Foundation.
Contributed by Zack Weinberg, who made it up all by himself. */
#endif /* { dg-error "#endif" "#endif without #if" } */
#else /* { dg-error "#else" "#else without #if" } */
#endif /* { dg-error "#endif" "#endif after #else without #if" } */
#elif 0 /* { dg-error "#elif" "#elif without #if" } */
#endif /* { dg-error "#endif" "#endif after #else without #if" } */
#if 1 /* { dg-bogus "unterminated" "terminated true conditional" } */
blah
#endif
#if 0 /* { dg-bogus "unterminated" "terminated false conditional" } */
ignored
#endif
/* We shouldn't see unbalanced conditionals inside #if'ed out #includes. */
#if 0
#include "cpp-unc1.c"
#endif
/* The ifdef below should not get an error just because there's a bad if
inside the included file.
The odd dg-error tag on the include matches the "In file included from"
message. */
#define FOO
#ifdef FOO /* { dg-bogus "unterminated" "nested unterm" } */
#include "cpp-unc1.c" /* { dg-error "" } */
#endif
/* dg.exp doesn't read the included files for tags, so we have to
do them explicitly here. */
/* { dg-error "#if" "unc1.h: unterminated #if" { target native } 3 } */
/* Tests for un-terminated conditionals: 1. */
#if 1 /* { dg-error "unterminated" "unterminated #if" } */
#ifdef notdef /* { dg-bogus "unterminated" "nested terminated #ifdef" } */
blah blah blah
#endif
more text
/* oops! */
/* Tests for unterminated conditionals: 2. */
#ifdef __sparc__ /* { dg-error "unterminated" "unterminated if-elif-elif..." } */
sparc
#elif defined __powerpc__
ppc
#elif defined __i386__
i386
#elif defined __vax__
vax
/* Tests for unterminated conditionals: 3. */
#if 1 /* { dg-error "#else" "unterminated #else" } */
#else
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment