- converted s_test_schlib shifts of -1 to equivalent shifts of 1 to

avoid undefined left-shift behavior on negative numbers.
    prim5.c

original commit: 7427dda85c1ae43f1e3c8f8749a578d50764fdfd
This commit is contained in:
Kent Dybvig 2016-04-26 18:48:07 -04:00
parent 6765641be0
commit 75dbd90b1b
2 changed files with 5 additions and 2 deletions

3
LOG
View File

@ -36,3 +36,6 @@
zlib and nanopass, since they are logically part of the git clone.
It does run make distclean in zlib.
makefiles/Makefile.in
- converted s_test_schlib shifts of -1 to equivalent shifts of 1 to
avoid undefined left-shift behavior on negative numbers.
prim5.c

View File

@ -1686,8 +1686,8 @@ static void s_test_schlib() {
INT test = 0;
I32 n1 = 0x73215609;
I64 n2 = n1 * 37;
I32 n3 = (I32)-1<<31;
I64 n4 = (I64)-1<<63;
I32 n3 = (I32)1<<31;
I64 n4 = (I64)1<<63;
I32 n5 = -1;
SCHLIBTEST(Sinteger_value(Sinteger(n1)) == n1)