Skip to content

Commit d26a7c7

Browse files
test/cast_sizet_to_uint32: add int32_t (signed) cast case
Exercises the signed branch of the new SizeT \xE2\x86\x92 Int cast handling. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 3e947dd commit d26a7c7

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

test/cast_sizet_to_uint32/cast_sizet_to_uint32.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,10 @@ uint32_t sizet_to_u32(size_t n)
88
{
99
return (uint32_t) n;
1010
}
11+
12+
int32_t sizet_to_i32(size_t n)
13+
_requires((_specint) n <= INT32_MAX)
14+
_ensures((_specint) return == n)
15+
{
16+
return (int32_t) n;
17+
}

0 commit comments

Comments
 (0)