20060110-1.c: New test.

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

From-SVN: r109680
This commit is contained in:
Adam Nemet 2006-01-13 23:26:47 +00:00 committed by Adam Nemet
parent 4df8acd3c8
commit 41e0c1a3ad
3 changed files with 40 additions and 0 deletions

View File

@ -1,3 +1,8 @@
2006-01-13 Adam Nemet <anemet@caviumnetworks.com>
* gcc.c-torture/execute/20060110-1.c: New test.
* gcc.c-torture/execute/20060110-2.c: New test.
2006-01-13 Ulrich Weigand <uweigand@de.ibm.com>
* gcc.c-torture/compile/pr25310.c: Disable test on 16-bit targets.

View File

@ -0,0 +1,16 @@
extern void abort (void);
long long
f (long long a)
{
return (a << 32) >> 32;
}
long long a = 0x1234567876543210LL;
long long b = (0x1234567876543210LL << 32) >> 32;
int
main ()
{
if (f (a) != b)
abort ();
return 0;
}

View File

@ -0,0 +1,19 @@
extern void abort (void);
long long
f (long long a, long long b)
{
return ((a + b) << 32) >> 32;
}
long long a = 0x1234567876543210LL;
long long b = 0x2345678765432101LL;
long long c = ((0x1234567876543210LL + 0x2345678765432101LL) << 32) >> 32;
int
main ()
{
if (f (a, b) != c)
abort ();
return 0;
}