aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/cpp/macro4.c
diff options
context:
space:
mode:
authorNeil Booth <neilb@earthling.net>2000-10-29 11:49:09 +0000
committerNeil Booth <neil@gcc.gnu.org>2000-10-29 11:49:09 +0000
commit00c83d466116974609619c0c08dcafe7b79d5c81 (patch)
tree5a90721df34f0fbd284e9ba209cdb168101d88b2 /gcc/testsuite/gcc.dg/cpp/macro4.c
parent44ed91a1d664478bb2f6f2e277988908ce3675a5 (diff)
downloadgcc-00c83d466116974609619c0c08dcafe7b79d5c81.zip
gcc-00c83d466116974609619c0c08dcafe7b79d5c81.tar.gz
gcc-00c83d466116974609619c0c08dcafe7b79d5c81.tar.bz2
macro4.c, macro5.c: New tests.
* gcc.dg/cpp/macro4.c, macro5.c: New tests. * mi1.c, mi1c.h: Add null directives to multiple-include test. * mi5.c: Test multiple includes work with -C. * trigraphs.c: Test ^= version. From-SVN: r37124
Diffstat (limited to 'gcc/testsuite/gcc.dg/cpp/macro4.c')
-rw-r--r--gcc/testsuite/gcc.dg/cpp/macro4.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/cpp/macro4.c b/gcc/testsuite/gcc.dg/cpp/macro4.c
new file mode 100644
index 0000000..c0dfe41
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/cpp/macro4.c
@@ -0,0 +1,24 @@
+/* Copyright (C) 2000 Free Software Foundation, Inc. */
+
+/* { dg-do run } */
+
+/* Test source Neil Booth. GCC <= 2.96 don't get this right. */
+
+extern void abort (void);
+
+int glue (int x, int y)
+{
+ return x + y;
+}
+
+#define glue(x, y) x ## y
+#define xglue(x, y) glue (x, y)
+
+int main ()
+{
+ /* Should expand to glue (1, 2) as the second "glue" is nested. */
+ if (glue (xgl, ue) (1, 2) != 3)
+ abort ();
+
+ return 0;
+}