Skip to content

Commit cae9d48

Browse files
committed
Adjust tests for x86 "Rust" ABI changes
1 parent 0f643c4 commit cae9d48

File tree

4 files changed

+34
-8
lines changed

4 files changed

+34
-8
lines changed

tests/codegen/float/f128.rs

+9-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
// 32-bit x86 returns `f32` and `f64` differently to avoid the x87 stack.
2+
//@ revisions: x86 other
3+
//@[x86] only-x86
4+
//@[other] ignore-x86
5+
16
// Verify that our intrinsics generate the correct LLVM calls for f128
27

38
#![crate_type = "lib"]
@@ -138,14 +143,16 @@ pub fn f128_as_f16(a: f128) -> f16 {
138143
a as f16
139144
}
140145

141-
// CHECK-LABEL: float @f128_as_f32(
146+
// other-LABEL: float @f128_as_f32(
147+
// x86-LABEL: i32 @f128_as_f32(
142148
#[no_mangle]
143149
pub fn f128_as_f32(a: f128) -> f32 {
144150
// CHECK: fptrunc fp128 %{{.+}} to float
145151
a as f32
146152
}
147153

148-
// CHECK-LABEL: double @f128_as_f64(
154+
// other-LABEL: double @f128_as_f64(
155+
// x86-LABEL: void @f128_as_f64(
149156
#[no_mangle]
150157
pub fn f128_as_f64(a: f128) -> f64 {
151158
// CHECK: fptrunc fp128 %{{.+}} to double

tests/codegen/float/f16.rs

+9-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
// 32-bit x86 returns `f32` and `f64` differently to avoid the x87 stack.
2+
//@ revisions: x86 other
3+
//@[x86] only-x86
4+
//@[other] ignore-x86
5+
16
// Verify that our intrinsics generate the correct LLVM calls for f16
27

38
#![crate_type = "lib"]
@@ -140,14 +145,16 @@ pub fn f16_as_self(a: f16) -> f16 {
140145
a as f16
141146
}
142147

143-
// CHECK-LABEL: float @f16_as_f32(
148+
// other-LABEL: float @f16_as_f32(
149+
// x86-LABEL: i32 @f16_as_f32(
144150
#[no_mangle]
145151
pub fn f16_as_f32(a: f16) -> f32 {
146152
// CHECK: fpext half %{{.+}} to float
147153
a as f32
148154
}
149155

150-
// CHECK-LABEL: double @f16_as_f64(
156+
// other-LABEL: double @f16_as_f64(
157+
// x86-LABEL: void @f16_as_f64(
151158
#[no_mangle]
152159
pub fn f16_as_f64(a: f16) -> f64 {
153160
// CHECK: fpext half %{{.+}} to double

tests/codegen/issues/issue-32031.rs

+8-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,16 @@
11
//@ compile-flags: -C no-prepopulate-passes -Copt-level=0
2+
// 32-bit x86 returns `f32` and `f64` differently to avoid the x87 stack.
3+
//@ revisions: x86 other
4+
//@[x86] only-x86
5+
//@[other] ignore-x86
26

37
#![crate_type = "lib"]
48

59
#[no_mangle]
610
pub struct F32(f32);
711

8-
// CHECK: define{{.*}}float @add_newtype_f32(float %a, float %b)
12+
// other: define{{.*}}float @add_newtype_f32(float %a, float %b)
13+
// x86: define{{.*}}i32 @add_newtype_f32(float %a, float %b)
914
#[inline(never)]
1015
#[no_mangle]
1116
pub fn add_newtype_f32(a: F32, b: F32) -> F32 {
@@ -15,7 +20,8 @@ pub fn add_newtype_f32(a: F32, b: F32) -> F32 {
1520
#[no_mangle]
1621
pub struct F64(f64);
1722

18-
// CHECK: define{{.*}}double @add_newtype_f64(double %a, double %b)
23+
// other: define{{.*}}double @add_newtype_f64(double %a, double %b)
24+
// x86: define{{.*}}void @add_newtype_f64(ptr{{.*}}sret([8 x i8]){{.*}}%_0, double %a, double %b)
1925
#[inline(never)]
2026
#[no_mangle]
2127
pub fn add_newtype_f64(a: F64, b: F64) -> F64 {

tests/codegen/union-abi.rs

+8-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
//@ ignore-emscripten vectors passed directly
22
//@ compile-flags: -O -C no-prepopulate-passes
3+
// 32-bit x86 returns `f32` differently to avoid the x87 stack.
4+
//@ revisions: x86 other
5+
//@[x86] only-x86
6+
//@[other] ignore-x86
37

48
// This test that using union forward the abi of the inner type, as
59
// discussed in #54668
@@ -67,7 +71,8 @@ pub union UnionF32 {
6771
a: f32,
6872
}
6973

70-
// CHECK: define {{(dso_local )?}}float @test_UnionF32(float %_1)
74+
// other: define {{(dso_local )?}}float @test_UnionF32(float %_1)
75+
// x86: define {{(dso_local )?}}i32 @test_UnionF32(float %_1)
7176
#[no_mangle]
7277
pub fn test_UnionF32(_: UnionF32) -> UnionF32 {
7378
loop {}
@@ -78,7 +83,8 @@ pub union UnionF32F32 {
7883
b: f32,
7984
}
8085

81-
// CHECK: define {{(dso_local )?}}float @test_UnionF32F32(float %_1)
86+
// other: define {{(dso_local )?}}float @test_UnionF32F32(float %_1)
87+
// x86: define {{(dso_local )?}}i32 @test_UnionF32F32(float %_1)
8288
#[no_mangle]
8389
pub fn test_UnionF32F32(_: UnionF32F32) -> UnionF32F32 {
8490
loop {}

0 commit comments

Comments
 (0)