ORCA-C/Tests/Deviance/D2.7.1.2.CC

27 lines
1010 B
Plaintext
Raw Normal View History

/* Deviance Test 2.7.1.2: Ensure long integer constant overflows are */
/* caught as errors */
main ()
{
long a;
a = 2147483648;
a = -2147483648L;
a = 0xFFFFFFFF2;
a = 0x800000001;
a = 047777777777L;
/* octal number with more than 255 characters */
a = 000000000000000000000000000000000000000000000000000000000000\
0000000000000000000000000000000000000000000000000000000000000000000\
0000000000000000000000000000000000000000000000000000000000000000000\
00000000000000000000000000000000000000000000000000000000000003;
/* hex number with more than 255 characters */
a = 0x0000000000000000000000000000000000000000000000000000000000\
0000000000000000000000000000000000000000000000000000000000000000000\
0000000000000000000000000000000000000000000000000000000000000000000\
00000000000000000000000000000000000000000000000000000000000003FF0110;
printf ("Failed Deviance Test 2.7.1.2\n");
}