Expect :int_within_limits to fail when ptrdiff_t/*intmax_t differ in base type

The %t{d,u} (ptrdiff_t) tests fail for the following reasons:
- ptrdiff_t is by definition int32_t on !LP64 architectures and int64_t on
  LP64 architectures.
- intmax_t is by definition fixed to int64_t on all architectures.
- Some of the code in lib/libc/stdio/... is promoting ptrdiff_t to *intmax_t
  when parsing/representing the value.

PR:		191674
MFC after:	1 week
Sponsored by:	Dell EMC Isilon
This commit is contained in:
Enji Cooper 2017-02-07 05:39:00 +00:00
parent 1eca9a9a49
commit 9a41ce4a69
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=313379

View File

@ -111,6 +111,11 @@ ATF_TC_BODY(int_within_limits, tc)
testfmt("-1", "%jd", (intmax_t)-1);
testfmt(S_UINT64MAX, "%ju", UINT64_MAX);
if (sizeof(ptrdiff_t) != sizeof(uintmax_t))
atf_tc_expect_fail("the %%t qualifier is broken on 32-bit "
"platforms where there's a mismatch between ptrdiff_t and "
"uintmax_t's type width; bug # 191674");
testfmt("-1", "%td", (ptrdiff_t)-1);
testfmt(S_SIZEMAX, "%tu", (size_t)-1);