aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOleg Endo <olegendo@gcc.gnu.org>2012-11-11 23:58:06 +0000
committerOleg Endo <olegendo@gcc.gnu.org>2012-11-11 23:58:06 +0000
commit358ac8ff1c77a36d11144752956d28be44ca13b2 (patch)
tree35467f5c05e71c54c097d2d3ffc6c270115eaf41
parented15a7eeaa1f85ad6907aea61d145538e05eb19e (diff)
downloadgcc-358ac8ff1c77a36d11144752956d28be44ca13b2.zip
gcc-358ac8ff1c77a36d11144752956d28be44ca13b2.tar.gz
gcc-358ac8ff1c77a36d11144752956d28be44ca13b2.tar.bz2
sh4a-fprun.c: Add test_sinf and test_cosf noinline wrappers around sinf and cosf.
* gcc.target/sh/sh4a-fprun.c: Add test_sinf and test_cosf noinline wrappers around sinf and cosf. From-SVN: r193419
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/gcc.target/sh/sh4a-fprun.c28
2 files changed, 28 insertions, 5 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index b8d7da3..ca40015 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2012-11-11 Oleg Endo <olegendo@gcc.gnu.org>
+
+ * gcc.target/sh/sh4a-fprun.c: Add test_sinf and test_cosf noinline
+ wrappers around sinf and cosf.
+
2012-11-11 H.J. Lu <hongjiu.lu@intel.com>
PR middle-end/55247
diff --git a/gcc/testsuite/gcc.target/sh/sh4a-fprun.c b/gcc/testsuite/gcc.target/sh/sh4a-fprun.c
index 40c2b05..e5fbc4a 100644
--- a/gcc/testsuite/gcc.target/sh/sh4a-fprun.c
+++ b/gcc/testsuite/gcc.target/sh/sh4a-fprun.c
@@ -11,25 +11,43 @@ float sqrt_arg = 4.0f, sqrt_res = 2.0f;
float dg2rad_f;
double dg2rad_d;
-void check_f (float res, float expected) {
+float __attribute__ ((noinline))
+test_sinf (float x)
+{
+ return sinf (x);
+}
+
+float __attribute ((noinline))
+test_cosf (float x)
+{
+ return cosf (x);
+}
+
+void
+check_f (float res, float expected)
+{
if (res >= expected - 0.001f && res <= expected + 0.001f)
return;
abort ();
}
-void check_d (double res, double expected) {
+void
+check_d (double res, double expected)
+{
if (res >= expected - 0.001 && res <= expected + 0.001)
return;
abort ();
}
-int main() {
+int
+main()
+{
check_f (sqrtf(sqrt_arg), sqrt_res);
dg2rad_f = dg2rad_d = atan(1) / 45;
- check_f (sinf(90*dg2rad_f), 1);
- check_f (cosf(90*dg2rad_f), 0);
+ check_f (test_sinf(90*dg2rad_f), 1);
+ check_f (test_cosf(90*dg2rad_f), 0);
check_d (sin(-90*dg2rad_d), -1);
check_d (cos(180*dg2rad_d), -1);
check_d (sin(-45*dg2rad_d) * cosf(135*dg2rad_f), 0.5);