diff options
author | rth <rth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-11-16 03:43:22 +0000 |
---|---|---|
committer | rth <rth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-11-16 03:43:22 +0000 |
commit | d2ee08fff5029812273d5adb3dd90db03bd9f1ff (patch) | |
tree | 70913b276b0ef4a27f6cf7629b7683f49f2d16f1 | |
parent | 7518fa75f757308e9af3559df02058455562d076 (diff) | |
download | gcc-d2ee08fff5029812273d5adb3dd90db03bd9f1ff.tar.gz |
* gcc.dg/torture/builtin-math-2.c: Split out fma tests...
* gcc.dg/torture/builtin-math-8.c: ... here. New file.
Use builtin_constant_p rather than scanning for builtin name.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@166791 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r-- | gcc/testsuite/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/torture/builtin-math-2.c | 15 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/torture/builtin-math-8.c | 34 |
3 files changed, 40 insertions, 15 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index a1fdddac84d..f6b4acabc73 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2010-11-15 Richard Henderson <rth@redhat.com> + + * gcc.dg/torture/builtin-math-2.c: Split out fma tests... + * gcc.dg/torture/builtin-math-8.c: ... here. New file. + Use builtin_constant_p rather than scanning for builtin name. + 2010-11-15 Nicola Pero <nicola.pero@meta-innovation.com> * objc.dg/property/dotsyntax-18.m: New. diff --git a/gcc/testsuite/gcc.dg/torture/builtin-math-2.c b/gcc/testsuite/gcc.dg/torture/builtin-math-2.c index 5c402873ab7..7e2ff138368 100644 --- a/gcc/testsuite/gcc.dg/torture/builtin-math-2.c +++ b/gcc/testsuite/gcc.dg/torture/builtin-math-2.c @@ -184,18 +184,6 @@ void bar() fool (__builtin_powl (__LDBL_MAX__, -3.5L)); TESTIT2 (pow, 2.0, -0x1p50); - foof (__builtin_fmaf (__FLT_MAX__, __FLT_MAX__, 0.0F)); - foof (__builtin_fmaf (__FLT_MAX__, 1.0F, __FLT_MAX__)); - foof (__builtin_fmaf (__FLT_MIN__, __FLT_MIN__, 0.0F)); - - foo (__builtin_fma (__DBL_MAX__, __DBL_MAX__, 0.0)); - foo (__builtin_fma (__DBL_MAX__, 1.0, __DBL_MAX__)); - foo (__builtin_fma (__DBL_MIN__, __DBL_MIN__, 0.0)); - - fool (__builtin_fmal (__LDBL_MAX__, __LDBL_MAX__, 0.0L)); - fool (__builtin_fmal (__LDBL_MAX__, 1.0L, __LDBL_MAX__)); - fool (__builtin_fmal (__LDBL_MIN__, __LDBL_MIN__, 0.0L)); - /* The sqrt arg must be [0 ... Inf] inclusive. */ TESTIT (sqrt, -0.5); TESTIT (sqrt, -0.0); @@ -351,9 +339,6 @@ void bar() /* { dg-final { scan-tree-dump-times "powf" 13 "original" { target { ! { spu*-*-* } } } } } */ /* { dg-final { scan-tree-dump-times "powf" 7 "original" { target { spu*-*-* } } } } */ /* { dg-final { scan-tree-dump-times "powl" 13 "original" } } */ -/* { dg-final { scan-tree-dump-times "fma " 3 "original" } } */ -/* { dg-final { scan-tree-dump-times "fmaf" 3 "original" } } */ -/* { dg-final { scan-tree-dump-times "fmal" 3 "original" } } */ /* { dg-final { scan-tree-dump-times "sqrt " 1 "original" } } */ /* { dg-final { scan-tree-dump-times "sqrtf" 1 "original" } } */ /* { dg-final { scan-tree-dump-times "sqrtl" 1 "original" } } */ diff --git a/gcc/testsuite/gcc.dg/torture/builtin-math-8.c b/gcc/testsuite/gcc.dg/torture/builtin-math-8.c new file mode 100644 index 00000000000..1a1a843e72c --- /dev/null +++ b/gcc/testsuite/gcc.dg/torture/builtin-math-8.c @@ -0,0 +1,34 @@ +/* { dg-do link } */ + +extern void link_error (void); + +int main() +{ + if (!__builtin_constant_p(1.0)) + link_error (); + if (!__builtin_constant_p(__builtin_fma (1.0, 1.0, 1.0))) + link_error (); + + if (__builtin_constant_p(__builtin_fmaf (__FLT_MAX__, __FLT_MAX__, 0.0F))) + link_error (); + if (__builtin_constant_p(__builtin_fmaf (__FLT_MAX__, 1.0F, __FLT_MAX__))) + link_error (); + if (__builtin_constant_p(__builtin_fmaf (__FLT_MIN__, __FLT_MIN__, 0.0F))) + link_error (); + + if (__builtin_constant_p(__builtin_fma (__DBL_MAX__, __DBL_MAX__, 0.0))) + link_error (); + if (__builtin_constant_p(__builtin_fma (__DBL_MAX__, 1.0, __DBL_MAX__))) + link_error (); + if (__builtin_constant_p(__builtin_fma (__DBL_MIN__, __DBL_MIN__, 0.0))) + link_error (); + + if (__builtin_constant_p(__builtin_fmal (__LDBL_MAX__, __LDBL_MAX__, 0.0L))) + link_error (); + if (__builtin_constant_p(__builtin_fmal (__LDBL_MAX__, 1.0L, __LDBL_MAX__))) + link_error (); + if (__builtin_constant_p(__builtin_fmal (__LDBL_MIN__, __LDBL_MIN__, 0.0L))) + link_error (); + + return 0; +} |