From dc02a6070f899b87249efa8c09bb2b90dbe94b0d Mon Sep 17 00:00:00 2001 From: Simonas Kazlauskas Date: Sun, 12 Aug 2018 15:27:03 +0300 Subject: Do not generate assumes for plain integer casts --- src/test/codegen/no-assumes-on-casts.rs | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 src/test/codegen/no-assumes-on-casts.rs (limited to 'src/test/codegen') 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 or the MIT license +// , 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 +} -- cgit 1.4.1-3-g733a5