1 /* Copyright (C) 2000 Free Software Foundation.
3 Ensure all expected transformations of builtin printf occur and
4 that we honor side effects in the arguments.
6 Written by Kaveh R. Ghazi, 12/4/2000. */
8 extern int printf (const char *, ...);
9 extern void abort(void);
13 const char *const s1
= "hello world";
14 const char *const s2
[] = { s1
, 0 }, *const*s3
;
16 printf ("%s\n", "hello");
19 printf ("%s\n", *s3
++);
20 if (s3
!= s2
+1 || *s3
!= 0)
26 printf ("%c", **s3
++);
27 if (s3
!= s2
+1 || *s3
!= 0)
31 printf ("hello world\n");
33 /* Test at least one instance of the __builtin_ style. We do this
34 to ensure that it works and that the prototype is correct. */
35 __builtin_printf ("%s\n", "hello");
36 /* These builtin stubs are called by __builtin_printf, ensure their
37 prototypes are set correctly too. */
38 __builtin_putchar ('\n');
39 __builtin_puts ("hello");
45 /* When optimizing, all the above cases should be transformed into
46 something else. So any remaining calls to the original function
48 __attribute__ ((noinline
))
50 printf (const char *string
, ...)