Skip to content

Commit 31bf7e1

Browse files
committed
const-int-wrapping.rs += wrapping_neg
1 parent 5256efb commit 31bf7e1

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

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

+5-2
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ const SHL_B: u32 = 1u32.wrapping_shl(128);
1313
const SHR_A: u32 = 128u32.wrapping_shr(7);
1414
const SHR_B: u32 = 128u32.wrapping_shr(128);
1515

16+
const NEG_A: u32 = 5u32.wrapping_neg();
17+
const NEG_B: u32 = 1234567890u32.wrapping_neg();
18+
1619
fn ident<T>(ident: T) -> T {
1720
ident
1821
}
@@ -30,6 +33,6 @@ fn main() {
3033
assert_eq!(SHL_A, ident(128));
3134
assert_eq!(SHL_B, ident(1));
3235

33-
assert_eq!(SHR_A, ident(1));
34-
assert_eq!(SHR_B, ident(128));
36+
assert_eq!(SHR_A, ident(4294967291));
37+
assert_eq!(SHR_B, ident(3060399406));
3538
}

0 commit comments

Comments
 (0)