[cfe-commits] r40138 - /cfe/trunk/INPUTS/stpcpy-test.c

Chris Lattner sabre at nondot.org
Fri Jul 20 21:54:14 PDT 2007


Author: lattner
Date: Fri Jul 20 23:54:14 2007
New Revision: 40138

URL: http://llvm.org/viewvc/llvm-project?rev=40138&view=rev
Log:
add an evil macro expansion perf test from Neil.

Added:
    cfe/trunk/INPUTS/stpcpy-test.c

Added: cfe/trunk/INPUTS/stpcpy-test.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/INPUTS/stpcpy-test.c?rev=40138&view=auto

==============================================================================
--- cfe/trunk/INPUTS/stpcpy-test.c (added)
+++ cfe/trunk/INPUTS/stpcpy-test.c Fri Jul 20 23:54:14 2007
@@ -0,0 +1,47 @@
+#define __extension__
+
+#define __stpcpy(dest, src) (__extension__ (__builtin_constant_p (src) ? (__string2_1bptr_p (src) && strlen (src) + 1 <= 8 ? __stpcpy_small (dest, __stpcpy_args (src), strlen (src) + 1) : ((char *) __mempcpy (dest, src, strlen (src) + 1) - 1)) : __stpcpy (dest, src)))
+#define stpcpy(dest, src) __stpcpy (dest, src)
+#define __stpcpy_args(src) __extension__ __STRING2_SMALL_GET16 (src, 0), __extension__ __STRING2_SMALL_GET16 (src, 4), __extension__ __STRING2_SMALL_GET32 (src, 0), __extension__ __STRING2_SMALL_GET32 (src, 4)
+
+#define __mempcpy(dest, src, n) (__extension__ (__builtin_constant_p (src) && __builtin_constant_p (n) && __string2_1bptr_p (src) && n <= 8 ? __mempcpy_small (dest, __mempcpy_args (src), n) : __mempcpy (dest, src, n)))
+#define mempcpy(dest, src, n) __mempcpy (dest, src, n)
+#define __mempcpy_args(src) ((char *) (src))[0], ((char *) (src))[2], ((char *) (src))[4], ((char *) (src))[6], __extension__ __STRING2_SMALL_GET16 (src, 0), __extension__ __STRING2_SMALL_GET16 (src, 4), __extension__ __STRING2_SMALL_GET32 (src, 0), __extension__ __STRING2_SMALL_GET32 (src, 4)
+
+#define __STRING2_SMALL_GET16(src, idx) (((__const unsigned char *) (__const char *) (src))[idx + 1] << 8 | ((__const unsigned char *) (__const char *) (src))[idx])
+
+#define __STRING2_SMALL_GET32(src, idx) (((((__const unsigned char *) (__const char *) (src))[idx + 3] << 8 | ((__const unsigned char *) (__const char *) (src))[idx + 2]) << 8 | ((__const unsigned char *) (__const char *) (src))[idx + 1]) << 8 | ((__const unsigned char *) (__const char *) (src))[idx])
+
+stpcpy (stpcpy (stpcpy (stpcpy (a, b), c), d), e)
+stpcpy (stpcpy (stpcpy (stpcpy (a, b), c), d), e)
+stpcpy (stpcpy (stpcpy (stpcpy (a, b), c), d), e)
+stpcpy (stpcpy (stpcpy (stpcpy (a, b), c), d), e)
+stpcpy (stpcpy (stpcpy (stpcpy (a, b), c), d), e)
+stpcpy (stpcpy (stpcpy (stpcpy (a, b), c), d), e)
+stpcpy (stpcpy (stpcpy (stpcpy (a, b), c), d), e)
+stpcpy (stpcpy (stpcpy (stpcpy (a, b), c), d), e)
+stpcpy (stpcpy (stpcpy (stpcpy (a, b), c), d), e)
+stpcpy (stpcpy (stpcpy (stpcpy (a, b), c), d), e)
+stpcpy (stpcpy (stpcpy (stpcpy (a, b), c), d), e)
+stpcpy (stpcpy (stpcpy (stpcpy (a, b), c), d), e)
+stpcpy (stpcpy (stpcpy (stpcpy (a, b), c), d), e)
+stpcpy (stpcpy (stpcpy (stpcpy (a, b), c), d), e)
+stpcpy (stpcpy (stpcpy (stpcpy (a, b), c), d), e)
+stpcpy (stpcpy (stpcpy (stpcpy (a, b), c), d), e)
+stpcpy (stpcpy (stpcpy (stpcpy (a, b), c), d), e)
+stpcpy (stpcpy (stpcpy (stpcpy (a, b), c), d), e)
+stpcpy (stpcpy (stpcpy (stpcpy (a, b), c), d), e)
+stpcpy (stpcpy (stpcpy (stpcpy (a, b), c), d), e)
+stpcpy (stpcpy (stpcpy (stpcpy (a, b), c), d), e)
+stpcpy (stpcpy (stpcpy (stpcpy (a, b), c), d), e)
+stpcpy (stpcpy (stpcpy (stpcpy (a, b), c), d), e)
+stpcpy (stpcpy (stpcpy (stpcpy (a, b), c), d), e)
+stpcpy (stpcpy (stpcpy (stpcpy (a, b), c), d), e)
+stpcpy (stpcpy (stpcpy (stpcpy (a, b), c), d), e)
+stpcpy (stpcpy (stpcpy (stpcpy (a, b), c), d), e)
+stpcpy (stpcpy (stpcpy (stpcpy (a, b), c), d), e)
+stpcpy (stpcpy (stpcpy (stpcpy (a, b), c), d), e)
+stpcpy (stpcpy (stpcpy (stpcpy (a, b), c), d), e)
+stpcpy (stpcpy (stpcpy (stpcpy (a, b), c), d), e)
+stpcpy (stpcpy (stpcpy (stpcpy (a, b), c), d), e)
+stpcpy (stpcpy (stpcpy (stpcpy (a, b), c), d), e)





More information about the cfe-commits mailing list