Skip to content

Commit

Permalink
workaround bugs in pretty-printer so that we can pass check-stage2-pr…
Browse files Browse the repository at this point in the history
…etty-rpass.
  • Loading branch information
pnkfelix committed Mar 21, 2015
1 parent 61ff823 commit 5e47c66
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions src/test/run-pass/shift-near-oflo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,18 @@ fn test_left_shift() {

macro_rules! tests {
($iN:ty, $uN:ty, $max_rhs:expr, $expect_i:expr, $expect_u:expr) => { {
let x = 1 as $iN << id(0);
let x = (1 as $iN) << id(0);
assert_eq!(x, 1);
let x = 1 as $uN << id(0);
let x = (1 as $uN) << id(0);
assert_eq!(x, 1);
let x = 1 as $iN << id($max_rhs);
let x = (1 as $iN) << id($max_rhs);
assert_eq!(x, $expect_i);
let x = 1 as $uN << id($max_rhs);
let x = (1 as $uN) << id($max_rhs);
assert_eq!(x, $expect_u);
// high-order bits on LHS are silently discarded without panic.
let x = 3 as $iN << id($max_rhs);
let x = (3 as $iN) << id($max_rhs);
assert_eq!(x, $expect_i);
let x = 3 as $uN << id($max_rhs);
let x = (3 as $uN) << id($max_rhs);
assert_eq!(x, $expect_u);
} }
}
Expand Down Expand Up @@ -71,23 +71,23 @@ fn test_right_shift() {
($iN:ty, $uN:ty, $max_rhs:expr,
$signbit_i:expr, $highbit_i:expr, $highbit_u:expr) =>
{ {
let x = 1 as $iN >> id(0);
let x = (1 as $iN) >> id(0);
assert_eq!(x, 1);
let x = 1 as $uN >> id(0);
let x = (1 as $uN) >> id(0);
assert_eq!(x, 1);
let x = $highbit_i >> id($max_rhs-1);
let x = ($highbit_i) >> id($max_rhs-1);
assert_eq!(x, 1);
let x = $highbit_u >> id($max_rhs);
let x = ($highbit_u) >> id($max_rhs);
assert_eq!(x, 1);
// sign-bit is carried by arithmetic right shift
let x = $signbit_i >> id($max_rhs);
let x = ($signbit_i) >> id($max_rhs);
assert_eq!(x, -1);
// low-order bits on LHS are silently discarded without panic.
let x = $highbit_i + 1 >> id($max_rhs-1);
let x = ($highbit_i + 1) >> id($max_rhs-1);
assert_eq!(x, 1);
let x = $highbit_u + 1 >> id($max_rhs);
let x = ($highbit_u + 1) >> id($max_rhs);
assert_eq!(x, 1);
let x = $signbit_i + 1 >> id($max_rhs);
let x = ($signbit_i + 1) >> id($max_rhs);
assert_eq!(x, -1);
} }
}
Expand Down

0 comments on commit 5e47c66

Please sign in to comment.