summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/builtins-57.c
diff options
context:
space:
mode:
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2007-01-24 14:13:28 +0000
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2007-01-24 14:13:28 +0000
commit3efb3a780ba5fb93843a92b6b6bdeeaa9a613ba3 (patch)
treed74175b61f1f24370f73c4e592be00e56e380347 /gcc/testsuite/gcc.dg/builtins-57.c
parent0ecbc158e2632910bf72f97ce5e816b204833993 (diff)
downloadgcc-3efb3a780ba5fb93843a92b6b6bdeeaa9a613ba3.tar.gz
2007-01-24 Richard Guenther <rguenther@suse.de>
PR testsuite/30181 * gcc.dg/builtins-57.c: Change to a link-time testcase to support non-C99 targets. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@121115 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite/gcc.dg/builtins-57.c')
-rw-r--r--gcc/testsuite/gcc.dg/builtins-57.c29
1 files changed, 19 insertions, 10 deletions
diff --git a/gcc/testsuite/gcc.dg/builtins-57.c b/gcc/testsuite/gcc.dg/builtins-57.c
index 87fbd44814e..361826cb00a 100644
--- a/gcc/testsuite/gcc.dg/builtins-57.c
+++ b/gcc/testsuite/gcc.dg/builtins-57.c
@@ -1,16 +1,25 @@
-/* { dg-do compile } */
-/* { dg-options "-fdump-tree-gimple" } */
+/* { dg-do link } */
+/* { dg-options "-std=c99 -ffinite-math-only" } */
-double foo (double x)
+#include "builtins-config.h"
+
+extern void link_error (void);
+
+extern double floor (double);
+extern double trunc (double);
+extern double fabs (double);
+
+void test (double x)
{
- return __builtin_floor (__builtin_fabs (x));
+#ifdef HAVE_C99_RUNTIME
+ if (floor (fabs (x)) != trunc (fabs (x)))
+ link_error ();
+#endif
+ if (__builtin_lfloor (fabs (x)) != (long)fabs (x))
+ link_error ();
}
-long bar (double x)
+int main (void)
{
- return __builtin_lfloor (__builtin_fabs (x));
+ return 0;
}
-
-/* { dg-final { scan-tree-dump-not "lfloor" "gimple" } } */
-/* { dg-final { scan-tree-dump "trunc" "gimple" } } */
-/* { dg-final { cleanup-tree-dump "gimple" } } */