usmul.c: New test.

* gcc.c-torture/execute/usmul.c: New test.

From-SVN: r107257
This commit is contained in:
Bernd Schmidt 2005-11-20 18:25:59 +00:00 committed by Bernd Schmidt
parent 90d55c93fb
commit 23ffc23579
2 changed files with 37 additions and 0 deletions

View file

@ -1,3 +1,7 @@
2005-11-20 Bernd Schmidt <bernd.schmidt@analog.com>
* gcc.c-torture/execute/usmul.c: New test.
2005-11-19 James A. Morrison <phython@gcc.gnu.org>
* gcc.dg/tree-ssa/vrp22.c: New test.

View file

@ -0,0 +1,33 @@
int __attribute__ ((noinline)) foo (short x, unsigned short y)
{
return x * y;
}
int __attribute__ ((noinline)) bar (unsigned short x, short y)
{
return x * y;
}
int main ()
{
if (foo (-2, 0xffff) != -131070)
abort ();
if (foo (2, 0xffff) != 131070)
abort ();
if (foo (-32768, 0x8000) != -1073741824)
abort ();
if (foo (32767, 0x8000) != 1073709056)
abort ();
if (bar (0xffff, -2) != -131070)
abort ();
if (bar (0xffff, 2) != 131070)
abort ();
if (bar (0x8000, -32768) != -1073741824)
abort ();
if (bar (0x8000, 32767) != 1073709056)
abort ();
exit (0);
}