aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gcc.dg/cpp/counter-1.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc-4.9/gcc/testsuite/gcc.dg/cpp/counter-1.c')
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/counter-1.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/counter-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/counter-1.c
new file mode 100644
index 000000000..80d8b7892
--- /dev/null
+++ b/gcc-4.9/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