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