aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gcc.dg/cpp/paste7.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc-4.9/gcc/testsuite/gcc.dg/cpp/paste7.c')
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/paste7.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/paste7.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/paste7.c
new file mode 100644
index 000000000..ce29db847
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/paste7.c
@@ -0,0 +1,19 @@
+/* { dg-do run } */
+
+#define D_2 1, 2
+#define C_2(X, I0, I1) X##_a = I0, X##_b = I1
+#define B_2(X, I) C_2(X, I)
+#define A(N, X) B_##N (X, D_##N)
+
+extern void abort(void);
+extern void exit(int);
+
+int x_a, x_b;
+
+int main(void)
+{
+ A(2, x);
+ if (x_a != 1 || x_b != 2)
+ abort();
+ exit(0);
+}