about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--src/test/run-pass/const-int-wrapping.rs7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/test/run-pass/const-int-wrapping.rs b/src/test/run-pass/const-int-wrapping.rs
index 5ab712015df..fe001b62581 100644
--- a/src/test/run-pass/const-int-wrapping.rs
+++ b/src/test/run-pass/const-int-wrapping.rs
@@ -13,6 +13,9 @@ const SHL_B: u32 = 1u32.wrapping_shl(128);
 const SHR_A: u32 = 128u32.wrapping_shr(7);
 const SHR_B: u32 = 128u32.wrapping_shr(128);
 
+const NEG_A: u32 = 5u32.wrapping_neg();
+const NEG_B: u32 = 1234567890u32.wrapping_neg();
+
 fn ident<T>(ident: T) -> T {
     ident
 }
@@ -30,6 +33,6 @@ fn main() {
     assert_eq!(SHL_A, ident(128));
     assert_eq!(SHL_B, ident(1));
 
-    assert_eq!(SHR_A, ident(1));
-    assert_eq!(SHR_B, ident(128));
+    assert_eq!(SHR_A, ident(4294967291));
+    assert_eq!(SHR_B, ident(3060399406));
 }