diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index ac434256adc..43adb4719ed 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2014-07-13 Tom de Vries + + * gcc.target/i386/fuse-caller-save-xmm-run.c: New test. + * gcc.target/i386/fuse-caller-save-xmm.c: New test. + 2014-07-13 Edward Smith-Rowland <3dw4rd@verizon.net> PR C++/60209 - Declaration of user-defined literal operator cause error diff --git a/gcc/testsuite/gcc.target/i386/fuse-caller-save-xmm-run.c b/gcc/testsuite/gcc.target/i386/fuse-caller-save-xmm-run.c new file mode 100644 index 00000000000..66b133c40ac --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/fuse-caller-save-xmm-run.c @@ -0,0 +1,32 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -msse -fuse-caller-save" } */ + +typedef double v2df __attribute__((vector_size (16))); + +static v2df __attribute__((noinline)) +bar (v2df a) +{ + return a + (v2df){ 3.0, 3.0 }; +} + +v2df __attribute__((noinline)) +foo (v2df y) +{ + return y + bar (y); +} + +int +main (void) +{ + int success; + union { + v2df v; + double d[2]; + } u; + + u.v = foo ((v2df){ 5.0, 5.0}); + success = (u.d[0] == 13.0 + && u.d[1] == 13.0); + + return !success; +} diff --git a/gcc/testsuite/gcc.target/i386/fuse-caller-save-xmm.c b/gcc/testsuite/gcc.target/i386/fuse-caller-save-xmm.c new file mode 100644 index 00000000000..ff21f0cdb3a --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/fuse-caller-save-xmm.c @@ -0,0 +1,37 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -msse -fuse-caller-save" } */ + +typedef double v2df __attribute__((vector_size (16))); + +static v2df __attribute__((noinline)) +bar (v2df a) +{ + return a + (v2df){ 3.0, 3.0 }; +} + +v2df __attribute__((noinline)) +foo (v2df y) +{ + return y + bar (y); +} + +int +main (void) +{ + int success; + union { + v2df v; + double d[2]; + } u; + + u.v = foo ((v2df){ 5.0, 5.0}); + success = (u.d[0] == 13.0 + && u.d[1] == 13.0); + + return !success; +} + +/* { dg-final { scan-assembler-not "movaps\t%xmm1, \\(%rsp\\)" } } */ +/* { dg-final { scan-assembler-not "movapd\t\\(%rsp\\), %xmm1" } } */ +/* { dg-final { scan-assembler-times ".cfi_def_cfa_offset 16" 1 } } */ +/* { dg-final { scan-assembler-times ".cfi_def_cfa_offset 32" 1 } } */