Skip to content

Commit

Permalink
Rollup merge of rust-lang#77151 - rust-lang:LeSeulArtichaut-patch-1, …
Browse files Browse the repository at this point in the history
…r=pnkfelix

Add regression test for issue rust-lang#76042

Originally posted in rust-lang#76042 (comment).
r? `@pnkfelix`
  • Loading branch information
GuillaumeGomez committed Nov 13, 2020
2 parents 2c4df6b + e8bda8d commit c5a11dd
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/test/ui/issues/issue-76042.rs
@@ -0,0 +1,16 @@
// run-pass
// compile-flags: -Coverflow-checks=off -Ccodegen-units=1 -Copt-level=0

fn foo(a: i128, b: i128, s: u32) -> (i128, i128) {
if s == 128 {
(0, 0)
} else {
(b >> s, a >> s)
}
}
fn main() {
let r = foo(0, 8, 1);
if r.0 != 4 {
panic!();
}
}

0 comments on commit c5a11dd

Please sign in to comment.