This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: i386 XFmode testcase
- To: law at cygnus dot com
- Subject: Re: i386 XFmode testcase
- From: hjl at lucon dot org (H.J. Lu)
- Date: Mon, 16 Feb 1998 11:35:57 -0800 (PST)
- Cc: egcs at cygnus dot com
>
>
> It occurs to me that that testcase could easily live in gcc.dg;
> its driver is more suited to handling tests for specific targets.
>
> Can you rewrite the test within the gcc.dg framework (look at
> other .c files in gcc.dg for examples).
>
> jeff
>
Here it is.
Thanks.
--
H.J. Lu (hjl@gnu.org)
--
Mon Feb 16 11:17:27 1998 H.J. Lu (hjl@gnu.org)
* gcc.dg/980211-1.c: New to test long double on
x86.
--- /dev/null Wed Dec 31 16:00:00 1969
+++ gcc.dg/980211-1.c Mon Feb 16 11:31:37 1998
@@ -0,0 +1,27 @@
+/* Test long double on x86. */
+
+/* { dg-do run { target i?86-*-* } } */
+/* { dg-options -O2 } */
+
+__inline int
+__signbitl (long double __x)
+{
+ union { long double __l; int __i[3]; } __u = { __l: __x };
+
+ return (__u.__i[2] & 0x8000) != 0;
+}
+
+void
+foo (long double x, long double y)
+{
+ long double z = x / y;
+ if (__signbitl (x) && __signbitl (z))
+ abort ();
+}
+
+int main()
+{
+ if (sizeof (long double) > sizeof (double))
+ foo (-0.0, -1.0);
+ return 0;
+}