Skip to content

Commit 3521e30

Browse files
committed
math/test: Add strtol test for 2147483648, 2147483647 and -2147483648,
Check boundary condition signed 32-bit values. Signed-off-by: Keith Packard <[email protected]>
1 parent 53c2103 commit 3521e30

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

newlib/libm/test/iconv_vec.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -308,6 +308,9 @@ int_type ints[]={
308308
{__LINE__,0xffffffc5, 5, 0,0xffffffb7, 5, 0,0xffffff8d, 5, 0,0xffffffc5, 5, 0,0xffffff47, 5, 0, " -073", },
309309
{__LINE__,0xfffffff9, 4, 0,0xfffffff9, 4, 0,0xfffffff9, 4, 0,0xfffffff9, 4, 0,0xfffffff9, 4, 0, " -07", },
310310
{__LINE__,0xfc12cdae,12, 0,0xe9c0f1ee,12, 0,0x80000000,12,34,0xfc12cdae,12, 0,0x80000000,12,34, " -0373231122", },
311+
{__LINE__,0x0000233c, 6, 0,0x7fffffff,11,34,0x7fffffff,11,34,0x7fffffff,11,34,0x7fffffff,11,34, " 2147483648", },
312+
{__LINE__,0x0000233c, 6, 0,0x7fffffff,11, 0,0x7fffffff,11,34,0x7fffffff,11, 0,0x7fffffff,11,34, " 2147483647", },
313+
{__LINE__,0xffffdcc4, 7, 0,0x80000000,12, 0,0x80000000,12,34,0x80000000,12, 0,0x80000000,12,34, " -2147483648", },
311314
#endif
312315
#if TEST_PART == 2 || TEST_PART == -1
313316
{__LINE__,0xffffffe1, 5, 0,0xffffffdb, 5, 0,0xffffffc9, 5, 0,0xffffffe1, 5, 0,0xffffffab, 5, 0, " -037w", },

0 commit comments

Comments
 (0)