1 /* Ensure that transformations of *printf are performed correctly
2 regardless of -fexec-charset. See PR 25120. */
4 /* { dg-do compile } */
5 /* { dg-require-iconv "IBM1047" } */
6 /* { dg-options "-O2 -fexec-charset=IBM1047" } */
7 /* { dg-final { scan-assembler-not "printf" } } */
8 /* { dg-final { scan-assembler-not "fprintf" } } */
9 /* { dg-final { scan-assembler-not "sprintf" } } */
13 void foo (char *dst
, const char *src
)
16 printf ("hello world\n");
18 printf ("%s", "hello world\n");
20 printf ("%s\n", "hello world");
23 fprintf (stdout
, "\n");
24 fprintf (stdout
, "hello world\n");
25 fprintf (stdout
, "%s", "\n");
26 fprintf (stdout
, "%s", "hello world\n");
27 fprintf (stdout
, "%c", '\n');
28 fprintf (stdout
, "%s", src
);
30 sprintf (dst
, "hello world\n");
31 sprintf (dst
, "%s", src
);