From 222e2a7620e6520ffaf4fc4e69d79c18da31542e Mon Sep 17 00:00:00 2001 From: "Zancanaro; Carlo" Date: Mon, 24 Sep 2012 09:58:17 +1000 Subject: Add the clang library to the repo (with some of my changes, too). --- clang/INPUTS/stpcpy-test.c | 47 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 clang/INPUTS/stpcpy-test.c (limited to 'clang/INPUTS/stpcpy-test.c') diff --git a/clang/INPUTS/stpcpy-test.c b/clang/INPUTS/stpcpy-test.c new file mode 100644 index 0000000..b96a806 --- /dev/null +++ b/clang/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) -- cgit v1.2.3