diff options
| author | zack <zack@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-04-06 00:11:27 +0000 | 
|---|---|---|
| committer | zack <zack@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-04-06 00:11:27 +0000 | 
| commit | b8ac6d64fd01ffeeada147ad2bc18540e3dcf5fc (patch) | |
| tree | 96a5719c17971c2bd64d8d94618af3563737c202 | |
| parent | 2185f051e66474b4c07026ef4a2be7e2a621ef35 (diff) | |
| download | ppe42-gcc-b8ac6d64fd01ffeeada147ad2bc18540e3dcf5fc.tar.gz ppe42-gcc-b8ac6d64fd01ffeeada147ad2bc18540e3dcf5fc.zip | |
	PR optimization/10024
	* gcc.c-torture/compile/20030405-1.c: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@65280 138bc75d-0d04-0410-961f-82ee72b054a4
| -rw-r--r-- | gcc/testsuite/ChangeLog | 21 | ||||
| -rw-r--r-- | gcc/testsuite/gcc.c-torture/compile/20030405-1.c | 58 | 
2 files changed, 71 insertions, 8 deletions
| diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 24f448944a9..23e87cc8404 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2003-04-05  Zack Weinberg  <zack@codesourcery.com> + +	PR optimization/10024 +	* gcc.c-torture/compile/20030405-1.c: New test. +  2003-04-04  Geoffrey Keating  <geoffk@apple.com>  	* gcc.dg/pch/static-3.c: New. @@ -12,7 +17,7 @@  2003-04-03  Mike Stump  <mrs@apple.com>  	* lib/scanasm.exp (scan-assembler): Add xfail processing for -        target arg. +	target arg.  	(scan-assembler-times, scan-assembler-not): Likewise.  	(scan-assembler-dem, scan-assembler-dem-not): Likewise. @@ -28,9 +33,9 @@  2003-04-02  Aldy Hernandez  <aldyh@redhat.com> -        * g++.dg/eh/simd-2.C (vecfunc): Fix typo. +	* g++.dg/eh/simd-2.C (vecfunc): Fix typo. -        * g++.dg/eh/simd-1.C (vecfunc): Same. +	* g++.dg/eh/simd-1.C (vecfunc): Same.  2003-04-01  Roger Sayle  <roger@eyesopen.com> @@ -42,12 +47,12 @@  2003-04-01  Aldy Hernandez  <aldyh@redhat.com> -        * g++.dg/eh/simd-1.C: New. -        * g++.dg/eh/simd-2.C: New. +	* g++.dg/eh/simd-1.C: New. +	* g++.dg/eh/simd-2.C: New.  2003-03-01  Aldy Hernandez  <aldyh@redhat.com> -        * gcc.c-torture/execute/simd-3.c: New. +	* gcc.c-torture/execute/simd-3.c: New.  2003-03-31  Mark Mitchell  <mark@codesourcery.com> @@ -90,7 +95,7 @@  2003-03-30  Glen Nakamura  <glen@imodulo.com> -        * gcc.dg/20030324-1.c: Add comments and abort if test fails. +	* gcc.dg/20030324-1.c: Add comments and abort if test fails.  2003-03-28  Roger Sayle  <roger@eyesopen.com> @@ -199,7 +204,7 @@  	PR c++/9898, c++/383  	* g++.dg/template/conv6.C: New test. -	 +  	PR c++/10119  	* g++.dg/template/ptrmem5.C: New test. diff --git a/gcc/testsuite/gcc.c-torture/compile/20030405-1.c b/gcc/testsuite/gcc.c-torture/compile/20030405-1.c new file mode 100644 index 00000000000..2e61f1fa3ff --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/20030405-1.c @@ -0,0 +1,58 @@ +/* PR optimization/10024 */ +extern int *allegro_errno; +typedef long fixed; +extern inline int +fixfloor (fixed x) +{ +  if (x >= 0) +    return (x >> 16); +  else +    return ~((~x) >> 16); +} +extern inline int +fixtoi (fixed x) +{ +  return fixfloor (x) + ((x & 0x8000) >> 15); +} +extern inline fixed +ftofix (double x) +{ +  if (x > 32767.0) +    { +      *allegro_errno = 34; +      return 0x7FFFFFFF; +    } +  if (x < -32767.0) +    { +      *allegro_errno = 34; +      return -0x7FFFFFFF; +    } +  return (long) (x * 65536.0 + (x < 0 ? -0.5 : 0.5)); +} +extern inline double +fixtof (fixed x) +{ +  return (double) x / 65536.0; +} +extern inline fixed +fixdiv (fixed x, fixed y) +{ +  if (y == 0) +    { +      *allegro_errno = 34; +      return (x < 0) ? -0x7FFFFFFF : 0x7FFFFFFF; +    } +  else +    return ftofix (fixtof (x) / fixtof (y)); +} +extern inline fixed +itofix (int x) +{ +  return x << 16; +} + +int +foo (int n) +{ +  return fixtoi (fixdiv (itofix (512), itofix (n))); +} | 

