File tree 1 file changed +33
-0
lines changed
1 file changed +33
-0
lines changed Original file line number Diff line number Diff line change
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, float)
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, double)
29
+ #[ inline( never) ]
30
+ #[ no_mangle]
31
+ pub fn add_newtype_f64 ( a : F64 , b : F64 ) -> F64 {
32
+ F64 ( a. 0 + b. 0 )
33
+ }
You can’t perform that action at this time.
0 commit comments