This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
testcase for loop bug
- To: egcs-patches at egcs dot cygnus dot com
- Subject: testcase for loop bug
- From: Jeffrey A Law <law at upchuck dot cygnus dot com>
- Date: Mon, 24 May 1999 14:12:07 -0600
- Reply-To: law at cygnus dot com
I've checked this into the mainline sources. It a test for a bug in the
loop pass of the compiler. A patch for the bug will be posted shortly.
* gcc.c-torture/execute/990524-1.c: New test.
char a[] = "12345";
char b[] = "12345";
void loop (char * pz, char * pzDta)
{
for (;;) {
switch (*(pz++) = *(pzDta++)) {
case 0:
goto loopDone2;
case '"':
case '\\':
pz[-1] = '\\';
*(pz++) = pzDta[-1];
}
} loopDone2:;
if (a - pz != b - pzDta)
abort ();
}
main()
{
loop (a, b);
exit (0);
}