diff options
| author | Lokathor <zefria@gmail.com> | 2019-02-01 18:50:21 -0700 |
|---|---|---|
| committer | Lokathor <zefria@gmail.com> | 2019-02-01 18:50:21 -0700 |
| commit | 5256efb80002bfcdbef2c6f007e43935c7d11432 (patch) | |
| tree | 72d73126a00a2492ac3b004cc28736e5ad5b03fb /src/test | |
| parent | 481b354c9719a538b21547fcf06b8f65a43da604 (diff) | |
| download | rust-5256efb80002bfcdbef2c6f007e43935c7d11432.tar.gz rust-5256efb80002bfcdbef2c6f007e43935c7d11432.zip | |
const-int-overflowing.rs += overflowing_neg
Diffstat (limited to 'src/test')
| -rw-r--r-- | src/test/run-pass/const-int-overflowing.rs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/test/run-pass/const-int-overflowing.rs b/src/test/run-pass/const-int-overflowing.rs index 289b1236cf1..e8fd022e682 100644 --- a/src/test/run-pass/const-int-overflowing.rs +++ b/src/test/run-pass/const-int-overflowing.rs @@ -13,6 +13,9 @@ const SHL_B: (u32, bool) = 0x1u32.overflowing_shl(132); const SHR_A: (u32, bool) = 0x10u32.overflowing_shr(4); const SHR_B: (u32, bool) = 0x10u32.overflowing_shr(132); +const NEG_A: (u32, bool) = 0.overflowing_neg(); +const NEG_B: (u32, bool) = core::u32::MAX.overflowing_neg(); + fn ident<T>(ident: T) -> T { ident } @@ -32,4 +35,7 @@ fn main() { assert_eq!(SHR_A, ident((0x1, false))); assert_eq!(SHR_B, ident((0x1, true))); + + assert_eq!(NEG_A, ident((0, false))); + assert_eq!(NEG_B, ident((1, true))); } |
