From 31bf7e1b51ebb932036dd632396cd98c1e115a6b Mon Sep 17 00:00:00 2001 From: Lokathor Date: Fri, 1 Feb 2019 18:55:38 -0700 Subject: [PATCH] const-int-wrapping.rs += wrapping_neg --- src/test/run-pass/const-int-wrapping.rs | 7 +++++-- 1 file 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 5ab712015dfc..fe001b625817 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(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)); }