From 554fd8c5195424bdbcabf5de30fdc183aba391bd Mon Sep 17 00:00:00 2001 From: upstream source tree Date: Sun, 15 Mar 2015 20:14:05 -0400 Subject: obtained gcc-4.6.4.tar.bz2 from upstream website; verified gcc-4.6.4.tar.bz2.sig; imported gcc-4.6.4 source tree from verified upstream tarball. downloading a git-generated archive based on the 'upstream' tag should provide you with a source tree that is binary identical to the one extracted from the above tarball. if you have obtained the source via the command 'git clone', however, do note that line-endings of files in your working directory might differ from line-endings of the respective files in the upstream repository. --- gcc/testsuite/gcc.dg/complex-5.c | 55 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 gcc/testsuite/gcc.dg/complex-5.c (limited to 'gcc/testsuite/gcc.dg/complex-5.c') diff --git a/gcc/testsuite/gcc.dg/complex-5.c b/gcc/testsuite/gcc.dg/complex-5.c new file mode 100644 index 000000000..41c4ba0b9 --- /dev/null +++ b/gcc/testsuite/gcc.dg/complex-5.c @@ -0,0 +1,55 @@ +/* PR middle-end/33088 */ +/* Origin: Joseph S. Myers */ + +/* { dg-do run { target i?86-*-linux* x86_64-*-linux* } } */ +/* { dg-options "-std=c99 -O -ffloat-store -lm" } */ + +#include +#include + +volatile int x[1024]; + +void __attribute__((noinline)) +fill_stack (void) +{ + volatile int y[1024]; + int i; + for (i = 0; i < 1024; i++) + y[i] = 0x7ff00000; + for (i = 0; i < 1024; i++) + x[i] = y[i]; +} + +volatile _Complex double vc; + +void __attribute__((noinline)) +use_complex (_Complex double c) +{ + vc = c; +} + +double t0, t1, t2, t3; + +#define USE_COMPLEX(X, R, C) \ + do { __real__ X = R; __imag__ X = C; use_complex (X); } while (0) + +void __attribute__((noinline)) +use_stack (void) +{ + _Complex double a, b, c, d; + USE_COMPLEX (a, t0, t1); + USE_COMPLEX (b, t1, t2); + USE_COMPLEX (c, t2, t3); + USE_COMPLEX (d, t3, t0); +} + +int +main (void) +{ + fill_stack (); + feclearexcept (FE_INVALID); + use_stack (); + if (fetestexcept (FE_INVALID)) + abort (); + exit (0); +} -- cgit v1.2.3