* gcc-interface/decl.c (gnat_to_gnu_entity) <E_Record_Type>: Don't
[official-gcc.git] / gcc / testsuite / gcc.c-torture / execute / 20041214-1.c
blob6ce2dc063ec3319960c13306c9f1838ba102c069
1 /* { dg-require-effective-target indirect_jumps } */
3 typedef long unsigned int size_t;
4 extern void abort (void);
5 extern char *strcpy (char *, const char *);
6 extern int strcmp (const char *, const char *);
7 typedef __builtin_va_list va_list;
8 static const char null[] = "(null)";
9 int g (char *s, const char *format, va_list ap)
11 const char *f;
12 const char *string;
13 char spec;
14 static const void *step0_jumps[] = {
15 &&do_precision,
16 &&do_form_integer,
17 &&do_form_string,
19 f = format;
20 if (*f == '\0')
21 goto all_done;
24 spec = (*++f);
25 goto *(step0_jumps[2]);
27 /* begin switch table. */
28 do_precision:
29 ++f;
30 __builtin_va_arg (ap, int);
31 spec = *f;
32 goto *(step0_jumps[2]);
34 do_form_integer:
35 __builtin_va_arg (ap, unsigned long int);
36 goto end;
38 do_form_string:
39 string = __builtin_va_arg (ap, const char *);
40 strcpy (s, string);
42 /* End of switch table. */
43 end:
44 ++f;
46 while (*f != '\0');
48 all_done:
49 return 0;
52 void
53 f (char *s, const char *f, ...)
55 va_list ap;
56 __builtin_va_start (ap, f);
57 g (s, f, ap);
58 __builtin_va_end (ap);
61 int
62 main (void)
64 char buf[10];
65 f (buf, "%s", "asdf", 0);
66 if (strcmp (buf, "asdf"))
67 abort ();
68 return 0;