diff options
Diffstat (limited to 'gcc/testsuite/gcc.dg/i386-ssefn-3.c')
-rw-r--r-- | gcc/testsuite/gcc.dg/i386-ssefn-3.c | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/i386-ssefn-3.c b/gcc/testsuite/gcc.dg/i386-ssefn-3.c new file mode 100644 index 0000000..2816919 --- /dev/null +++ b/gcc/testsuite/gcc.dg/i386-ssefn-3.c @@ -0,0 +1,43 @@ +/* Execution test for argument passing with SSE and local functions + Written by Paolo Bonzini, 25 January 2005 */ + +/* { dg-do run { target i?86-*-* } } */ +/* { dg-options "-O2 -msse -mfpmath=sse" } */ +#include <assert.h> +#include "i386-cpuid.h" + +static float xs (void) +{ + return 3.14159265; +} + +float ys (float a) +{ + return xs () * a; +} + +static double xd (void) +{ + return 3.1415926535; +} + +double yd (double a) +{ + return xd () * a; +} + +int main() +{ + unsigned long cpu_facilities; + + cpu_facilities = i386_cpuid (); + + if (cpu_facilities & bit_SSE) + { + assert (ys (1) == xs ()); + assert (ys (2) == xs () * 2); + assert (yd (1) == xd ()); + assert (yd (2) == xd () * 2); + } + return 0; +} |