summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/complex-5.c
diff options
context:
space:
mode:
authorupstream source tree <ports@midipix.org>2015-03-15 20:14:05 -0400
committerupstream source tree <ports@midipix.org>2015-03-15 20:14:05 -0400
commit554fd8c5195424bdbcabf5de30fdc183aba391bd (patch)
tree976dc5ab7fddf506dadce60ae936f43f58787092 /gcc/testsuite/gcc.dg/complex-5.c
downloadcbb-gcc-4.6.4-554fd8c5195424bdbcabf5de30fdc183aba391bd.tar.bz2
cbb-gcc-4.6.4-554fd8c5195424bdbcabf5de30fdc183aba391bd.tar.xz
obtained gcc-4.6.4.tar.bz2 from upstream website;upstream
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.
Diffstat (limited to 'gcc/testsuite/gcc.dg/complex-5.c')
-rw-r--r--gcc/testsuite/gcc.dg/complex-5.c55
1 files changed, 55 insertions, 0 deletions
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 <jsm28@gcc.gnu.org> */
+
+/* { dg-do run { target i?86-*-linux* x86_64-*-linux* } } */
+/* { dg-options "-std=c99 -O -ffloat-store -lm" } */
+
+#include <fenv.h>
+#include <stdlib.h>
+
+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);
+}