mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-04-11 01:30:55 +08:00
cpp-mi.c: Fix switches.
cpp-redef-2.c: New. From-SVN: r32431
This commit is contained in:
parent
38b24ee220
commit
2b01d2d999
@ -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"
|
||||
|
27
gcc/testsuite/gcc.dg/cpp-redef-2.c
Normal file
27
gcc/testsuite/gcc.dg/cpp-redef-2.c
Normal 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 } */
|
Loading…
x
Reference in New Issue
Block a user