diff options
Diffstat (limited to 'gcc/testsuite/gcc.dg/cpp/counter-1.c')
-rw-r--r-- | gcc/testsuite/gcc.dg/cpp/counter-1.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/cpp/counter-1.c b/gcc/testsuite/gcc.dg/cpp/counter-1.c new file mode 100644 index 000000000..80d8b7892 --- /dev/null +++ b/gcc/testsuite/gcc.dg/cpp/counter-1.c @@ -0,0 +1,20 @@ +/* Copyright (C) 2007 Free Software Foundation + Contributed by Ollie Wild <aaw@google.com> */ + +/* { dg-do preprocess } */ + +/* Tests __COUNTER__ macro is correctly expanded. */ + +#define counter __COUNTER__ + +#if __COUNTER__ != 0 +#error __COUNTER__ != 0 +#endif + +#if counter != 1 +#error counter != 1 +#endif + +#if __COUNTER__ != 2 +#error __COUNTER__ != 2 +#endif |