This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
New testcase gcc.c-torture/execute/built-in-setjmp.c
- To: gcc-patches at gcc dot gnu dot org
- Subject: New testcase gcc.c-torture/execute/built-in-setjmp.c
- From: kenner at vlsi1 dot ultra dot nyu dot edu (Richard Kenner)
- Date: Thu, 4 Jan 01 14:04:10 EST
I added the following testcase:
int buf[20];
int
main ()
{
char *p = (char *) alloca (20);
strcpy (p, "test");
if (__builtin_setjmp (buf))
{
if (strcmp (p, "test") != 0)
abort ();
exit (0);
}
{
int *q = (int *) alloca (p[2] * sizeof (int));
int i;
for (i = 0; i < p[2]; i++)
q[i] = 0;
while (1)
sub2 ();
}
}
sub2 ()
{
__builtin_longjmp (buf, 1);
}