diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index f951d73434bf..cca26ea953d8 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2006-01-13 Adam Nemet + + * gcc.c-torture/execute/20060110-1.c: New test. + * gcc.c-torture/execute/20060110-2.c: New test. + 2006-01-13 Ulrich Weigand * gcc.c-torture/compile/pr25310.c: Disable test on 16-bit targets. diff --git a/gcc/testsuite/gcc.c-torture/execute/20060110-1.c b/gcc/testsuite/gcc.c-torture/execute/20060110-1.c new file mode 100644 index 000000000000..112528ecf70f --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/execute/20060110-1.c @@ -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; +} diff --git a/gcc/testsuite/gcc.c-torture/execute/20060110-2.c b/gcc/testsuite/gcc.c-torture/execute/20060110-2.c new file mode 100644 index 000000000000..bf60f94366a9 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/execute/20060110-2.c @@ -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; +}