diff options
author | Richard Henderson <rth@gcc.gnu.org> | 2003-04-10 15:16:06 -0700 |
---|---|---|
committer | Richard Henderson <rth@gcc.gnu.org> | 2003-04-10 15:16:06 -0700 |
commit | 9dd67c6976864c3a44fbebc43dd38684fafc5f7b (patch) | |
tree | 6e058d34d8b554d7ad0bbe549bda86535333fe20 | |
parent | f90e4deafa94c9ffff4e446ec80fd9c08a15b65d (diff) | |
download | gcc-9dd67c6976864c3a44fbebc43dd38684fafc5f7b.zip gcc-9dd67c6976864c3a44fbebc43dd38684fafc5f7b.tar.gz gcc-9dd67c6976864c3a44fbebc43dd38684fafc5f7b.tar.bz2 |
New test.
From-SVN: r65439
-rw-r--r-- | gcc/testsuite/g++.dg/opt/reload2.C | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/opt/reload2.C b/gcc/testsuite/g++.dg/opt/reload2.C new file mode 100644 index 0000000..1af8aea --- /dev/null +++ b/gcc/testsuite/g++.dg/opt/reload2.C @@ -0,0 +1,42 @@ +// PR 10352 +// { dg-do compile } +// { dg-options -O2 } + +extern double fabs(double x); + +typedef struct { float x, y; } S; +typedef struct _T T; + +extern void fT( T *p ); +extern T *h(); +extern S g( ); + +static +int f(void) +{ + T *t=0; + int c=0; + S s; + + const S exp_s = {0.,0.}; + + if(!(t = h())) + { + c++; + } + + if(!c) + { + s = g(); + if( (fabs( (s.x) - (exp_s.x) ) > 1 ) + || (fabs( (s.y) - (exp_s.y) ) > 1 ) ) + { + c++; + } + } + + if(t) + fT(t); + + return c; +} |