This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: testcase question (portability)
- From: Janis Johnson <janis187 at us dot ibm dot com>
- To: Aldy Hernandez <aldyh at redhat dot com>
- Cc: gcc at gcc dot gnu dot org
- Date: Tue, 24 Feb 2004 16:44:13 -0800
- Subject: Re: testcase question (portability)
- References: <20040224230620.GA14209@redhat.com>
On Tue, Feb 24, 2004 at 07:06:20PM -0400, Aldy Hernandez wrote:
> Hi folks.
>
> I'm thinking of adding this test, but I'm not sure it's 64-bit
> portable, sane across all architectures, etc. BTW, this is the
> distilled testcase for the patch I just committed.
>
> Cheers.
> Aldy
>
> #define IM 2147483648u
>
> int main()
> {
> int ival = 0x7ea4766d;
>
> ival = (int) ((float) ival * 43.999F / (float) IM);
> if (ival != 43)
> abort ();
> exit (0);
> }
With default options this test compiles and runs without aborting on
powerpc-linux, powerpc64-linux, ia64-linux, and i686-pc-linux-gnu using
whatever random versions of GCC were installed on the systems I tried.
Janis