Rollup merge of #77151 - rust-lang:LeSeulArtichaut-patch-1, r=pnkfelix

Add regression test for issue #76042

Originally posted in https://github.com/rust-lang/rust/issues/76042#issuecomment-683272710.
r? `@pnkfelix`
This commit is contained in:
Guillaume Gomez 2020-11-13 15:26:06 +01:00 committed by GitHub
commit c5a11ddec9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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!();
}
}