summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/cpp/20000625-2.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.dg/cpp/20000625-2.c')
-rw-r--r--gcc/testsuite/gcc.dg/cpp/20000625-2.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/cpp/20000625-2.c b/gcc/testsuite/gcc.dg/cpp/20000625-2.c
new file mode 100644
index 00000000000..e9834503fd0
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/cpp/20000625-2.c
@@ -0,0 +1,27 @@
+/* More paste corner cases from glibc. */
+/* { dg-do run } */
+
+#define symbol_version(name, version) name##@##version
+
+#define str(x) xstr(x)
+#define xstr(x) #x
+
+const char a[] = str(symbol_version(getrlimit, GLIBC_2.0));
+const char b[] = str(getrlimit@GLIBC_2.0);
+const char c[] = "getrlimit@GLIBC_2.0";
+
+#include <stdlib.h>
+#include <string.h>
+
+int
+main(void)
+{
+ if(strcmp(a, b))
+ abort();
+ if(strcmp(b, c))
+ abort();
+ if(strcmp(c, a))
+ abort();
+
+ return 0;
+}