PR middle-end/77357 - strlen of constant strings not folded
[official-gcc.git] / gcc / testsuite / gcc.dg / pr59418.c
blob4b54ef2b42dcdb67ae835deb33e6862f865f8285
1 /* PR debug/59418 */
2 /* Reported by Ryan Mansfield <rmansfield@qnx.com> */
4 /* { dg-do compile } */
5 /* { dg-options "-Os -g" } */
6 /* { dg-options "-march=armv7-a+fp -mfloat-abi=hard -Os -g" { target { arm*-*-* && { ! arm_thumb1 } } } } */
8 extern int printf (const char *__format, ...);
9 double bar (const char *, int);
11 void
12 foo (const char *pptr, int caplen)
14 int type;
15 const char *tptr;
16 if (caplen < 4)
18 (void) printf ("foo");
19 return;
21 while (tptr < pptr)
23 switch (type)
25 case 0x01:
26 printf ("");
27 case 0x0b:
28 printf ("");
29 case 0x0e:
30 printf ("");
31 case 0x10:
32 printf ("%1.2fW", bar (tptr, caplen) / 1000.0);
35 printf ("foo");