fpul-usage-1.c: New.

* gcc.target/sh/fpul-usage-1.c: New.

From-SVN: r185406
This commit is contained in:
Oleg Endo 2012-03-15 01:18:04 +00:00
parent 1eb74c79d6
commit 5457d860af
2 changed files with 28 additions and 0 deletions

View File

@ -1,3 +1,7 @@
2012-03-15 Oleg Endo <olegendo@gcc.gnu.org>
* gcc.target/sh/fpul-usage-1.c: New.
2012-03-14 Oleg Endo <olegendo@gcc.gnu.org>
PR target/49468

View File

@ -0,0 +1,24 @@
/* Check that the FPUL register is used when reading a float as an int and
vice versa, as opposed to pushing and popping the values over the stack. */
/* { dg-do compile { target "sh*-*-*" } } */
/* { dg-options "-O1" } */
/* { dg-skip-if "" { "sh*-*-*" } { "-m1" "-m2" "-m4al" "*nofpu" "-m4-340*" "-m4-400*" "-m4-500*" "-m5*" } { "" } } */
/* { dg-final { scan-assembler "fpul" } } */
/* { dg-final { scan-assembler-not "r15" } } */
int
float_as_int (float val)
{
union { float f; int i; } u;
u.f = val;
return u.i;
}
float
int_as_float (int val)
{
union { float f; int i; } u;
u.i = val;
return u.f;
}