aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/testsuite/ChangeLog4
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/20010114-2.c31
2 files changed, 35 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 1a1d3f7..95a0cfe 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,7 @@
+2001-01-14 Franz Sirl <Franz.Sirl-kernel@lauterbach.com>
+
+ * gcc.c-torture/execute/20010114-2.c: New test.
+
2001-01-14 Joseph S. Myers <jsm28@cam.ac.uk>
* gcc.c-torture/compile/20010114-1.c: New test.
diff --git a/gcc/testsuite/gcc.c-torture/execute/20010114-2.c b/gcc/testsuite/gcc.c-torture/execute/20010114-2.c
new file mode 100644
index 0000000..e5ab948
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/execute/20010114-2.c
@@ -0,0 +1,31 @@
+extern void exit (int);
+extern void abort (void);
+
+float
+rintf (float x)
+{
+ static const float TWO23 = 8388608.0;
+
+ if (__builtin_fabs (x) < TWO23)
+ {
+ if (x > 0.0)
+ {
+ x += TWO23;
+ x -= TWO23;
+ }
+ else if (x < 0.0)
+ {
+ x = TWO23 - x;
+ x = -(x - TWO23);
+ }
+ }
+
+ return x;
+}
+
+int main (void)
+{
+ if (rintf (-1.5) != -2.0)
+ abort ();
+ exit (0);
+}