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]

New testcase


Hi,

I would like to add the following testcase to 
gcc/testsuite/gcc.c-torture/execute directory. This testcase fails 
when compiled with -O2. The signed value is not casted to unsigned 
value while comparing and leads to wrong result.

Thanks
Chandra

void    main(void)
{
    int         is = -32768 ;
    unsigned int    iu = 0 ;
    unsigned int    ua ;

    ua = ( iu >= is ) ? iu : is ;

    if( ua == is )
      exit (0);

    abort ();
}




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