1 /* PR tree-optimization/89998 */
2
3 unsigned int sprintf (char *str, const char *fmt, ...);
4 unsigned int snprintf (char *str, __SIZE_TYPE__ len, const char *fmt, ...);
5
6 int
f1(char * s)7 f1 (char *s)
8 {
9 return sprintf (s, "foo");
10 }
11
12 int
f2(char * s)13 f2 (char *s)
14 {
15 return sprintf (s, "%d", 123);
16 }
17
18 int
f3(int * p,char * s)19 f3 (int *p, char *s)
20 {
21 const char *t = "bar";
22 return sprintf (s, "%s", t);
23 }
24
25 int
f4(char * s)26 f4 (char *s)
27 {
28 return snprintf (s, 8, "foo");
29 }
30
31 int
f5(char * s)32 f5 (char *s)
33 {
34 return snprintf (s, 8, "%d", 123);
35 }
36
37 int
f6(int * p,char * s)38 f6 (int *p, char *s)
39 {
40 const char *t = "bar";
41 return snprintf (s, 8, "%s", t);
42 }
43