1// RUN: %clang_cc1 -S -O3 -fno-builtin -o - %s | FileCheck %s 2// rdar://10551066 3 4typedef __SIZE_TYPE__ size_t; 5 6double ceil(double x); 7double copysign(double,double); 8double cos(double x); 9double fabs(double x); 10double floor(double x); 11char *strcat(char *s1, const char *s2); 12char *strncat(char *s1, const char *s2, size_t n); 13char *strchr(const char *s, int c); 14char *strrchr(const char *s, int c); 15int strcmp(const char *s1, const char *s2); 16int strncmp(const char *s1, const char *s2, size_t n); 17char *strcpy(char *s1, const char *s2); 18char *stpcpy(char *s1, const char *s2); 19char *strncpy(char *s1, const char *s2, size_t n); 20size_t strlen(const char *s); 21char *strpbrk(const char *s1, const char *s2); 22size_t strspn(const char *s1, const char *s2); 23double strtod(const char *nptr, char **endptr); 24float strtof(const char *nptr, char **endptr); 25long double strtold(const char *nptr, char **endptr); 26long int strtol(const char *nptr, char **endptr, int base); 27long long int strtoll(const char *nptr, char **endptr, int base); 28unsigned long int strtoul(const char *nptr, char **endptr, int base); 29unsigned long long int strtoull(const char *nptr, char **endptr, int base); 30 31double t1(double x) { return ceil(x); } 32// CHECK: t1 33// CHECK: ceil 34 35double t2(double x, double y) { return copysign(x,y); } 36// CHECK: t2 37// CHECK: copysign 38 39double t3(double x) { return cos(x); } 40// CHECK: t3 41// CHECK: cos 42 43double t4(double x) { return fabs(x); } 44// CHECK: t4 45// CHECK: fabs 46 47double t5(double x) { return floor(x); } 48// CHECK: t5 49// CHECK: floor 50 51char *t6(char *x) { return strcat(x, ""); } 52// CHECK: t6 53// CHECK: strcat 54 55char *t7(char *x) { return strncat(x, "", 1); } 56// CHECK: t7 57// CHECK: strncat 58 59char *t8(void) { return strchr("hello, world", 'w'); } 60// CHECK: t8 61// CHECK: strchr 62 63char *t9(void) { return strrchr("hello, world", 'w'); } 64// CHECK: t9 65// CHECK: strrchr 66 67int t10(void) { return strcmp("foo", "bar"); } 68// CHECK: t10 69// CHECK: strcmp 70 71int t11(void) { return strncmp("foo", "bar", 3); } 72// CHECK: t11 73// CHECK: strncmp 74 75char *t12(char *x) { return strcpy(x, "foo"); } 76// CHECK: t12 77// CHECK: strcpy 78 79char *t13(char *x) { return stpcpy(x, "foo"); } 80// CHECK: t13 81// CHECK: stpcpy 82 83char *t14(char *x) { return strncpy(x, "foo", 3); } 84// CHECK: t14 85// CHECK: strncpy 86 87size_t t15(void) { return strlen("foo"); } 88// CHECK: t15 89// CHECK: strlen 90 91char *t16(char *x) { return strpbrk(x, ""); } 92// CHECK: t16 93// CHECK: strpbrk 94 95size_t t17(char *x) { return strspn(x, ""); } 96// CHECK: t17 97// CHECK: strspn 98 99double t18(char **x) { return strtod("123.4", x); } 100// CHECK: t18 101// CHECK: strtod 102 103float t19(char **x) { return strtof("123.4", x); } 104// CHECK: t19 105// CHECK: strtof 106 107long double t20(char **x) { return strtold("123.4", x); } 108// CHECK: t20 109// CHECK: strtold 110 111long int t21(char **x) { return strtol("1234", x, 10); } 112// CHECK: t21 113// CHECK: strtol 114 115long int t22(char **x) { return strtoll("1234", x, 10); } 116// CHECK: t22 117// CHECK: strtoll 118 119long int t23(char **x) { return strtoul("1234", x, 10); } 120// CHECK: t23 121// CHECK: strtoul 122 123long int t24(char **x) { return strtoull("1234", x, 10); } 124// CHECK: t24 125// CHECK: strtoull 126