]> git.lizzy.rs Git - rust.git/blob - src/test/codegen/issue-32031.rs
Auto merge of #45721 - nikomatsakis:hir-tree, r=arielb1
[rust.git] / src / test / codegen / issue-32031.rs
1 // Copyright 2016 The Rust Project Developers. See the COPYRIGHT
2 // file at the top-level directory of this distribution and at
3 // http://rust-lang.org/COPYRIGHT.
4 //
5 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8 // option. This file may not be copied, modified, or distributed
9 // except according to those terms.
10
11 // compile-flags: -C no-prepopulate-passes
12
13 #![crate_type = "lib"]
14
15 #[no_mangle]
16 pub struct F32(f32);
17
18 // CHECK: define float @add_newtype_f32(float %a, float %b)
19 #[inline(never)]
20 #[no_mangle]
21 pub fn add_newtype_f32(a: F32, b: F32) -> F32 {
22     F32(a.0 + b.0)
23 }
24
25 #[no_mangle]
26 pub struct F64(f64);
27
28 // CHECK: define double @add_newtype_f64(double %a, double %b)
29 #[inline(never)]
30 #[no_mangle]
31 pub fn add_newtype_f64(a: F64, b: F64) -> F64 {
32     F64(a.0 + b.0)
33 }