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.c-torture/execute/complex-7.c | 56 +++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 gcc/testsuite/gcc.c-torture/execute/complex-7.c (limited to 'gcc/testsuite/gcc.c-torture/execute/complex-7.c') diff --git a/gcc/testsuite/gcc.c-torture/execute/complex-7.c b/gcc/testsuite/gcc.c-torture/execute/complex-7.c new file mode 100644 index 000000000..c5bf89df7 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/execute/complex-7.c @@ -0,0 +1,56 @@ +/* Test argument passing of complex values. The MIPS64 compiler had a + bug when they were split between registers and the stack. */ +/* Origin: Joseph Myers */ + +volatile _Complex float f1 = 1.1f + 2.2if; +volatile _Complex float f2 = 3.3f + 4.4if; +volatile _Complex float f3 = 5.5f + 6.6if; +volatile _Complex float f4 = 7.7f + 8.8if; +volatile _Complex float f5 = 9.9f + 10.1if; +volatile _Complex double d1 = 1.1 + 2.2i; +volatile _Complex double d2 = 3.3 + 4.4i; +volatile _Complex double d3 = 5.5 + 6.6i; +volatile _Complex double d4 = 7.7 + 8.8i; +volatile _Complex double d5 = 9.9 + 10.1i; +volatile _Complex long double ld1 = 1.1L + 2.2iL; +volatile _Complex long double ld2 = 3.3L + 4.4iL; +volatile _Complex long double ld3 = 5.5L + 6.6iL; +volatile _Complex long double ld4 = 7.7L + 8.8iL; +volatile _Complex long double ld5 = 9.9L + 10.1iL; + +extern void abort (void); +extern void exit (int); + +__attribute__((noinline)) void +check_float (int a, _Complex float a1, _Complex float a2, + _Complex float a3, _Complex float a4, _Complex float a5) +{ + if (a1 != f1 || a2 != f2 || a3 != f3 || a4 != f4 || a5 != f5) + abort (); +} + +__attribute__((noinline)) void +check_double (int a, _Complex double a1, _Complex double a2, + _Complex double a3, _Complex double a4, _Complex double a5) +{ + if (a1 != d1 || a2 != d2 || a3 != d3 || a4 != d4 || a5 != d5) + abort (); +} + +__attribute__((noinline)) void +check_long_double (int a, _Complex long double a1, _Complex long double a2, + _Complex long double a3, _Complex long double a4, + _Complex long double a5) +{ + if (a1 != ld1 || a2 != ld2 || a3 != ld3 || a4 != ld4 || a5 != ld5) + abort (); +} + +int +main (void) +{ + check_float (0, f1, f2, f3, f4, f5); + check_double (0, d1, d2, d3, d4, d5); + check_long_double (0, ld1, ld2, ld3, ld4, ld5); + exit (0); +} -- cgit v1.2.3