Commit 0b0b0750 by Richard Henderson

New.

From-SVN: r54630
parent 52689a98
/* PR c/6677 */
/* Verify that GCC doesn't perform illegal simplifications
when folding constants. */
#include <limits.h>
extern void abort (void);
extern void exit (int);
int main (void)
{
int i;
signed char j;
unsigned char k;
i = SCHAR_MAX;
j = ((signed char) (i << 1)) / 2;
if (j != -1)
abort();
j = ((signed char) (i * 2)) / 2;
if (j != -1)
abort();
i = UCHAR_MAX;
k = ((unsigned char) (i << 1)) / 2;
if (k != UCHAR_MAX/2)
abort();
k = ((unsigned char) (i * 2)) / 2;
if (k != UCHAR_MAX/2)
abort();
exit(0);
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment