diff options
| author | bors <bors@rust-lang.org> | 2018-08-18 14:35:42 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2018-08-18 14:35:42 +0000 |
| commit | a3ad012e2d33680d40b325258c0da532d0a884f3 (patch) | |
| tree | 406f62e7d2674d407998b5b99a1ea13402270a27 /src/test/codegen | |
| parent | 7de3dea2b76786077ad51b31d167867e5ecdfdbc (diff) | |
| parent | dc02a6070f899b87249efa8c09bb2b90dbe94b0d (diff) | |
| download | rust-a3ad012e2d33680d40b325258c0da532d0a884f3.tar.gz rust-a3ad012e2d33680d40b325258c0da532d0a884f3.zip | |
Auto merge of #53286 - nagisa:cast-assumes, r=eddyb
Do not generate assumes for plain integer casts I gave up on making anything more elegant for now. r? @eddyb
Diffstat (limited to 'src/test/codegen')
| -rw-r--r-- | src/test/codegen/no-assumes-on-casts.rs | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/src/test/codegen/no-assumes-on-casts.rs b/src/test/codegen/no-assumes-on-casts.rs new file mode 100644 index 00000000000..a5a7d94a553 --- /dev/null +++ b/src/test/codegen/no-assumes-on-casts.rs @@ -0,0 +1,29 @@ +// Copyright 2018 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or +// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license +// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +#![crate_type = "lib"] + +// compile-flags: -Cno-prepopulate-passes + +// CHECK-LABEL: fna +#[no_mangle] +pub fn fna(a: i16) -> i32 { + a as i32 +// CHECK-NOT: assume +// CHECK: sext +} + +// CHECK-LABEL: fnb +#[no_mangle] +pub fn fnb(a: u16) -> u32 { + a as u32 +// CHECK-NOT: assume +// CHECK: zext +} |
