Home
last modified time | relevance | path

Searched refs:CheckedInt (Results 1 – 2 of 2) sorted by relevance

/llvm-project-15.0.7/llvm/unittests/ADT/
H A DSequenceTest.cpp25 using detail::CheckedInt;
51 EXPECT_EQ(CheckedInt::from(Min).template to<T>(), Min); in TYPED_TEST()
52 EXPECT_EQ(CheckedInt::from(Max).template to<T>(), Max); in TYPED_TEST()
56 const CheckedInt Actual = CheckedInt::from(Expected); in TYPED_TEST()
79 EXPECT_DEATH(CheckedInt::from(-1).to<uint8_t>(), "Out of bounds"); in TEST()
80 EXPECT_DEATH(CheckedInt::from(256).to<uint8_t>(), "Out of bounds"); in TEST()
82 EXPECT_DEATH(CheckedInt::from(INTMAX_MAX) + 1, "Out of bounds"); in TEST()
83 EXPECT_DEATH(CheckedInt::from(INTMAX_MIN) + -1, "Out of bounds"); in TEST()
84 EXPECT_DEATH(CheckedInt::from(INTMAX_MIN) - CheckedInt::from(INTMAX_MAX), in TEST()
257 EXPECT_EQ(CheckedInt::from(A).to<UntypedEnum>(), A); in TEST()
[all …]
/llvm-project-15.0.7/llvm/include/llvm/ADT/
H A DSequence.h127 struct CheckedInt { struct
131 static CheckedInt from(Integral FromValue) { in from() argument
134 CheckedInt Result; in from()
142 static CheckedInt from(Enum FromValue) { in from() argument
148 bool operator==(const CheckedInt &O) const { return Value == O.Value; }
151 CheckedInt operator+(intmax_t Offset) const {
152 CheckedInt Result; argument
158 intmax_t operator-(CheckedInt Other) const {
197 explicit SafeIntIterator(T Value) : SI(CheckedInt::from<T>(Value)) {} in SafeIntIterator() argument
245 SafeIntIterator(const CheckedInt &SI) : SI(SI) {} in SafeIntIterator()
[all …]