1 /* { dg-require-effective-target alloca } */
2 typedef unsigned long grub_uint64_t;
3 typedef grub_uint64_t grub_size_t;
grub_cmdline_get(unsigned max_len,int echo_char)4 grub_cmdline_get (unsigned max_len, int echo_char)
5 {
6   unsigned xpos, ypos, ystart;
7   grub_size_t lpos, llen;
8   char buf[max_len];
9   void cl_print (int pos, int c)
10   {
11       char *p;
12       for (p = buf + pos; *p; p++)
13       {
14         if (xpos++ > 78)
15           grub_putchar ('\n');
16         grub_putchar (*p);
17       }
18  }
19  void cl_delete (unsigned len)
20  {
21    cl_set_pos ();
22    cl_print (lpos, ' ');
23    grub_memmove ();
24    cl_print (lpos, echo_char);
25    cl_set_pos ();
26  }
27  cl_delete (llen);
28  grub_size_t n = lpos;
29  cl_delete (n);
30 }
31