diff options
author | Chris Lattner <sabre@nondot.org> | 2007-07-21 04:54:14 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2007-07-21 04:54:14 +0000 |
commit | a84538ea2b16bbccab64367e16c93aa6b8bb0169 (patch) | |
tree | 604f80def4ffef4072bbf497e458ab769f375c42 | |
parent | d472b31d8037b506fd98531daf40aa5f85afb5e8 (diff) |
add an evil macro expansion perf test from Neil.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40138 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | INPUTS/stpcpy-test.c | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/INPUTS/stpcpy-test.c b/INPUTS/stpcpy-test.c new file mode 100644 index 0000000000..b96a8066e6 --- /dev/null +++ b/INPUTS/stpcpy-test.c @@ -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) |