aboutsummaryrefslogtreecommitdiff
path: root/SingleSource/Regression/C/gcc-c-torture/execute/ieee/20010114-2.c
diff options
context:
space:
mode:
Diffstat (limited to 'SingleSource/Regression/C/gcc-c-torture/execute/ieee/20010114-2.c')
-rw-r--r--SingleSource/Regression/C/gcc-c-torture/execute/ieee/20010114-2.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/SingleSource/Regression/C/gcc-c-torture/execute/ieee/20010114-2.c b/SingleSource/Regression/C/gcc-c-torture/execute/ieee/20010114-2.c
new file mode 100644
index 00000000..e5ab9485
--- /dev/null
+++ b/SingleSource/Regression/C/gcc-c-torture/execute/ieee/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);
+}