This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH 5/5][testsuite] Use stdint.h when needing int of exact size


On Sun, 2007-08-05 at 13:40 +0200, Rask Ingemann Lambertsen wrote:
> On Tue, Jul 24, 2007 at 07:24:53PM +0200, Rask Ingemann Lambertsen wrote:
> > 
> > Index: gcc.c-torture/execute/simd-4.c
> > ===================================================================
> > --- gcc.c-torture/execute/simd-4.c	(revision 126653)
> > +++ gcc.c-torture/execute/simd-4.c	(working copy)
> > @@ -1,17 +1,18 @@
> > -typedef int __attribute__((vector_size(8))) v2si;
> > -long long s64;
> > +#include <stdint.h>
> > +typedef int32_t __attribute__((vector_size(8))) v2si;
> > +int64_t s64;
> >  
> > -static inline long long
> > +static inline int64_t
> >  __ev_convert_s64 (v2si a)
> >  {
> > -  return (long long) a;
> > +  return (int64_t) a;
> >  }
> >  
> >  int main()
> >  {
> > -  union { long long ll; int i[2]; } endianness_test;
> > +  union { int64_t ll; int32_t i[2]; } endianness_test;
> >    endianness_test.ll = 1;
> > -  int little_endian = endianness_test.i[0];
> > +  int32_t little_endian = endianness_test.i[0];
> >    s64 = __ev_convert_s64 ((v2si){1,0xffffffff});
> >    if (s64 != (little_endian ? 0xffffffff00000001LL : 0x1ffffffffLL))
> >      abort ();
> 
>    I don't think this part was commented on yet. Is it ok?
> 
> 2007-08-05  Rask Ingemann Lambertsen  <rask@sygehus.dk>
> 
> 	* gcc.c-torture/execute/simd-4.c (__ev_convert_s64)(main): Use
> 	  int32_t for 32-bit integer. Use int64_t for 64-bit integer.

This is OK.

Janis


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]