Skip to content

Commit abc57ab

Browse files
authored
Auto merge of #34241 - dsprenkels:issue-32031-test, r=eddyb
add a test case for issue #32031 I propose a test case to finish the fix for issue #32031. Please review this commit thoroughly, as I have never written a codegen test before. r? @eddyb
2 parents a76698b + 688840f commit abc57ab

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

Diff for: src/test/codegen/issue-32031.rs

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
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+
}

0 commit comments

Comments
 (0)