PR middle-end/77357 - strlen of constant strings not folded
[official-gcc.git] / gcc / testsuite / gcc.c-torture / compile / pr35006.c
blobfc343da9dab7ad674c30d49cd85a2cb988ae14df
1 /* { dg-require-effective-target alloca } */
2 typedef unsigned long grub_uint64_t;
3 typedef grub_uint64_t grub_size_t;
4 grub_cmdline_get (unsigned max_len, int echo_char)
6 unsigned xpos, ypos, ystart;
7 grub_size_t lpos, llen;
8 char buf[max_len];
9 void cl_print (int pos, int c)
11 char *p;
12 for (p = buf + pos; *p; p++)
14 if (xpos++ > 78)
15 grub_putchar ('\n');
16 grub_putchar (*p);
19 void cl_delete (unsigned len)
21 cl_set_pos ();
22 cl_print (lpos, ' ');
23 grub_memmove ();
24 cl_print (lpos, echo_char);
25 cl_set_pos ();
27 cl_delete (llen);
28 grub_size_t n = lpos;
29 cl_delete (n);