Skip to content

Commit c4cc557

Browse files
test case
1 parent 3ee8097 commit c4cc557

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

libc/test/src/__support/big_int_test.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1067,4 +1067,12 @@ TEST(LlvmLibcUIntClassTest, SignedOtherWordTypeCastTests) {
10671067
ASSERT_TRUE(bigger_back_plus_a + bigger_back_minus_a == zero_96);
10681068
}
10691069

1070+
TEST(LlvmLibcUIntClassTest, MixedSignednessOtherWordTypeCastTests) {
1071+
using LL_UInt96 = BigInt<96, false, uint32_t>;
1072+
LL_UInt96 x = -123;
1073+
// ensure that -123 gets extended, even though the input type is signed while
1074+
// the BigInt is unsigned.
1075+
ASSERT_EQ(int64_t(x), -123LL);
1076+
}
1077+
10701078
} // namespace LIBC_NAMESPACE_DECL

0 commit comments

Comments
 (0)