* gcc.c-torture/execute/990531-1.c: New test.

From-SVN: r27261
This commit is contained in:
Jeffrey A Law 1999-05-30 23:40:07 +00:00 committed by Jeff Law
parent 6f0ef2f4db
commit 71fb005652
2 changed files with 27 additions and 0 deletions

View File

@ -1,3 +1,7 @@
Mon May 31 00:34:51 1999 Jeffrey A Law (law@cygnus.com)
* gcc.c-torture/execute/990531-1.c: New test.
Thu May 27 02:38:36 1999 Franz Sirl <Franz.Sirl-kernel@lauterbach.com>
* gcc.c-torture/compile/990527-1.c: New test.

View File

@ -0,0 +1,23 @@
unsigned long bad(int reg, unsigned long inWord)
{
union {
unsigned long word;
unsigned char byte[4];
} data;
data.word = inWord;
data.byte[reg] = 0;
return data.word;
}
main()
{
/* XXX This test could be generalized. */
if (sizeof (long) != 4)
exit (0);
if (bad (0, 0xdeadbeef) == 0xdeadbeef)
abort ();
exit (0);
}