2017-10-21 23:40:19 +00:00
|
|
|
/* 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");
|
|
|
|
}
|