cpp-mi.c: Fix switches.

cpp-redef-2.c: New.

From-SVN: r32431
This commit is contained in:
Zack Weinberg 2000-03-08 20:38:06 +00:00
parent 38b24ee220
commit 2b01d2d999
2 changed files with 29 additions and 4 deletions

View File

@ -6,10 +6,8 @@
/* We have to test two cases: C comments at the top and C++ comments
at the top. */
/*
{ dg-do preprocess }
{ dg-options "-Wp,-lang-c-c++-comments" }
*/
/* { dg-do preprocess }
{ dg-options "" } */
#include "cpp-mic.h"
#include "cpp-mic.h"

View File

@ -0,0 +1,27 @@
/* Test for redefining macros with significant differences. */
/* { dg-do preprocess }
{ dg-options "-pedantic -Wall" } */
#define mac(a, b) (a) + (b)
#define mac(a, b) (a) * (b)
#define mac(a, b) (a) * (x)
#define ro(x) foo x bar
#define ro(x, b) foo x bar
#define va(a...) a
#define va(...) __VA_ARGS__
/* { dg-warning "redefined" "redef mac" { target *-*-* } 7 }
{ dg-warning "redefined" "redef mac" { target *-*-* } 8 }
{ dg-warning "redefined" "redef ro" { target *-*-* } 11 }
{ dg-warning "redefined" "redef va" { target *-*-* } 14 }
{ dg-warning "previous" "prev def mac" { target *-*-* } 6 }
{ dg-warning "previous" "prev def mac" { target *-*-* } 7 }
{ dg-warning "previous" "prev def ro" { target *-*-* } 10 }
{ dg-warning "previous" "prev def va" { target *-*-* } 13 }
{ dg-warning "varargs" "named varargs" { target *-*-* } 13 }
{ dg-warning "varargs" "anon varargs" { target *-*-* } 14 } */