Skip to content

Commit 5e47c66

Browse files
committed
workaround bugs in pretty-printer so that we can pass check-stage2-pretty-rpass.
1 parent 61ff823 commit 5e47c66

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

src/test/run-pass/shift-near-oflo.rs

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -26,18 +26,18 @@ fn test_left_shift() {
2626

2727
macro_rules! tests {
2828
($iN:ty, $uN:ty, $max_rhs:expr, $expect_i:expr, $expect_u:expr) => { {
29-
let x = 1 as $iN << id(0);
29+
let x = (1 as $iN) << id(0);
3030
assert_eq!(x, 1);
31-
let x = 1 as $uN << id(0);
31+
let x = (1 as $uN) << id(0);
3232
assert_eq!(x, 1);
33-
let x = 1 as $iN << id($max_rhs);
33+
let x = (1 as $iN) << id($max_rhs);
3434
assert_eq!(x, $expect_i);
35-
let x = 1 as $uN << id($max_rhs);
35+
let x = (1 as $uN) << id($max_rhs);
3636
assert_eq!(x, $expect_u);
3737
// high-order bits on LHS are silently discarded without panic.
38-
let x = 3 as $iN << id($max_rhs);
38+
let x = (3 as $iN) << id($max_rhs);
3939
assert_eq!(x, $expect_i);
40-
let x = 3 as $uN << id($max_rhs);
40+
let x = (3 as $uN) << id($max_rhs);
4141
assert_eq!(x, $expect_u);
4242
} }
4343
}
@@ -71,23 +71,23 @@ fn test_right_shift() {
7171
($iN:ty, $uN:ty, $max_rhs:expr,
7272
$signbit_i:expr, $highbit_i:expr, $highbit_u:expr) =>
7373
{ {
74-
let x = 1 as $iN >> id(0);
74+
let x = (1 as $iN) >> id(0);
7575
assert_eq!(x, 1);
76-
let x = 1 as $uN >> id(0);
76+
let x = (1 as $uN) >> id(0);
7777
assert_eq!(x, 1);
78-
let x = $highbit_i >> id($max_rhs-1);
78+
let x = ($highbit_i) >> id($max_rhs-1);
7979
assert_eq!(x, 1);
80-
let x = $highbit_u >> id($max_rhs);
80+
let x = ($highbit_u) >> id($max_rhs);
8181
assert_eq!(x, 1);
8282
// sign-bit is carried by arithmetic right shift
83-
let x = $signbit_i >> id($max_rhs);
83+
let x = ($signbit_i) >> id($max_rhs);
8484
assert_eq!(x, -1);
8585
// low-order bits on LHS are silently discarded without panic.
86-
let x = $highbit_i + 1 >> id($max_rhs-1);
86+
let x = ($highbit_i + 1) >> id($max_rhs-1);
8787
assert_eq!(x, 1);
88-
let x = $highbit_u + 1 >> id($max_rhs);
88+
let x = ($highbit_u + 1) >> id($max_rhs);
8989
assert_eq!(x, 1);
90-
let x = $signbit_i + 1 >> id($max_rhs);
90+
let x = ($signbit_i + 1) >> id($max_rhs);
9191
assert_eq!(x, -1);
9292
} }
9393
}

0 commit comments

Comments
 (0)