Skip to content

Commit 5256efb

Browse files
committed
const-int-overflowing.rs += overflowing_neg
1 parent 481b354 commit 5256efb

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/test/run-pass/const-int-overflowing.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ const SHL_B: (u32, bool) = 0x1u32.overflowing_shl(132);
1313
const SHR_A: (u32, bool) = 0x10u32.overflowing_shr(4);
1414
const SHR_B: (u32, bool) = 0x10u32.overflowing_shr(132);
1515

16+
const NEG_A: (u32, bool) = 0.overflowing_neg();
17+
const NEG_B: (u32, bool) = core::u32::MAX.overflowing_neg();
18+
1619
fn ident<T>(ident: T) -> T {
1720
ident
1821
}
@@ -32,4 +35,7 @@ fn main() {
3235

3336
assert_eq!(SHR_A, ident((0x1, false)));
3437
assert_eq!(SHR_B, ident((0x1, true)));
38+
39+
assert_eq!(NEG_A, ident((0, false)));
40+
assert_eq!(NEG_B, ident((1, true)));
3541
}

0 commit comments

Comments
 (0)