Skip to content

Commit 0262de5

Browse files
committed
Auto merge of rust-lang#73099 - Dylan-DPC:rollup-7u8f3m4, r=Dylan-DPC
Rollup of 2 pull requests Successful merges: - rust-lang#72952 (run-make regression test for issue rust-lang#70924.) - rust-lang#72977 (Fix codegen tests for RISC-V) Failed merges: r? @ghost
2 parents f9fdf64 + 4dd5d5d commit 0262de5

17 files changed

+140
-41
lines changed

src/test/codegen/abi-main-signature-16bit-c-int.rs

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
// ignore-mips64
1111
// ignore-powerpc
1212
// ignore-powerpc64
13+
// ignore-riscv64
1314
// ignore-s390x
1415
// ignore-sparc
1516
// ignore-sparc64

src/test/codegen/abi-sysv64.rs

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
// ignore-arm
66
// ignore-aarch64
7+
// ignore-riscv64 sysv64 not supported
78

89
// compile-flags: -C no-prepopulate-passes
910

src/test/codegen/abi-x86-interrupt.rs

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
// ignore-arm
66
// ignore-aarch64
7+
// ignore-riscv64 x86-interrupt is not supported
78

89
// compile-flags: -C no-prepopulate-passes
910

src/test/codegen/call-llvm-intrinsics.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
// compile-flags: -C no-prepopulate-passes
22

3+
// ignore-riscv64
4+
35
#![feature(link_llvm_intrinsics)]
46
#![crate_type = "lib"]
57

src/test/codegen/catch-unwind.rs

+9
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
// compile-flags: -O
22

3+
// On x86 the closure is inlined in foo() producting something like
4+
// define i32 @foo() [...] {
5+
// tail call void @bar() [...]
6+
// ret i32 0
7+
// }
8+
// On riscv the closure is another function, placed before fn foo so CHECK can't
9+
// find it
10+
// ignore-riscv64 FIXME
11+
312
#![crate_type = "lib"]
413

514
extern "C" {

src/test/codegen/fastcall-inreg.rs

+1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
// ignore-powerpc64le
1818
// ignore-powerpc
1919
// ignore-r600
20+
// ignore-riscv64
2021
// ignore-amdgcn
2122
// ignore-sparc
2223
// ignore-sparc64

src/test/codegen/repr-transparent-aggregates-1.rs

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
// ignore-mips64
88
// ignore-powerpc
99
// ignore-powerpc64
10+
// ignore-riscv64 see codegen/riscv-abi
1011
// ignore-windows
1112
// See repr-transparent.rs
1213

src/test/codegen/repr-transparent-aggregates-2.rs

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
// ignore-powerpc
77
// ignore-powerpc64
88
// ignore-powerpc64le
9+
// ignore-riscv64 see codegen/riscv-abi
910
// ignore-s390x
1011
// ignore-sparc
1112
// ignore-sparc64

src/test/codegen/repr-transparent.rs

+3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
// compile-flags: -C no-prepopulate-passes
22

3+
// ignore-riscv64 riscv64 has an i128 type used with test_Vector
4+
// see codegen/riscv-abi for riscv functiona call tests
5+
36
#![crate_type="lib"]
47
#![feature(repr_simd, transparent_unions)]
58

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
// compile-flags: -C no-prepopulate-passes
2+
3+
// only-riscv64
4+
5+
#![feature(link_llvm_intrinsics)]
6+
#![crate_type = "lib"]
7+
8+
struct A;
9+
10+
impl Drop for A {
11+
fn drop(&mut self) {
12+
println!("A");
13+
}
14+
}
15+
16+
extern {
17+
#[link_name = "llvm.sqrt.f32"]
18+
fn sqrt(x: f32) -> f32;
19+
}
20+
21+
pub fn do_call() {
22+
let _a = A;
23+
24+
unsafe {
25+
// Ensure that we `call` LLVM intrinsics instead of trying to `invoke` them
26+
// CHECK: store float 4.000000e+00, float* %{{.}}, align 4
27+
// CHECK: call float @llvm.sqrt.f32(float %{{.}}
28+
sqrt(4.0);
29+
}
30+
}

src/test/codegen/riscv-abi/riscv64-lp64-lp64f-lp64d-abi.rs

+7-7
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,12 @@ pub extern "C" fn f_scalar_4(x: i64) -> i64 {
3939
x
4040
}
4141

42-
// CHECK: define float @f_fp_scalar_1(float)
42+
// CHECK: define float @f_fp_scalar_1(float %0)
4343
#[no_mangle]
4444
pub extern "C" fn f_fp_scalar_1(x: f32) -> f32 {
4545
x
4646
}
47-
// CHECK: define double @f_fp_scalar_2(double)
47+
// CHECK: define double @f_fp_scalar_2(double %0)
4848
#[no_mangle]
4949
pub extern "C" fn f_fp_scalar_2(x: f64) -> f64 {
5050
x
@@ -67,7 +67,7 @@ pub struct Tiny {
6767
d: u16,
6868
}
6969

70-
// CHECK: define void @f_agg_tiny(i64)
70+
// CHECK: define void @f_agg_tiny(i64 %0)
7171
#[no_mangle]
7272
pub extern "C" fn f_agg_tiny(mut e: Tiny) {
7373
e.a += e.b;
@@ -86,7 +86,7 @@ pub struct Small {
8686
b: *mut i64,
8787
}
8888

89-
// CHECK: define void @f_agg_small([2 x i64])
89+
// CHECK: define void @f_agg_small([2 x i64] %0)
9090
#[no_mangle]
9191
pub extern "C" fn f_agg_small(mut x: Small) {
9292
x.a += unsafe { *x.b };
@@ -104,7 +104,7 @@ pub struct SmallAligned {
104104
a: i128,
105105
}
106106

107-
// CHECK: define void @f_agg_small_aligned(i128)
107+
// CHECK: define void @f_agg_small_aligned(i128 %0)
108108
#[no_mangle]
109109
pub extern "C" fn f_agg_small_aligned(mut x: SmallAligned) {
110110
x.a += x.a;
@@ -130,7 +130,7 @@ pub extern "C" fn f_agg_large_ret(i: i32, j: i8) -> Large {
130130
Large { a: 1, b: 2, c: 3, d: 4 }
131131
}
132132

133-
// CHECK: define void @f_scalar_stack_1(i64, [2 x i64], i128, %Large* {{.*}}%d, i8 zeroext %e, i8 signext %f, i8 %g, i8 %h)
133+
// CHECK: define void @f_scalar_stack_1(i64 %0, [2 x i64] %1, i128 %2, %Large* {{.*}}%d, i8 zeroext %e, i8 signext %f, i8 %g, i8 %h)
134134
#[no_mangle]
135135
pub extern "C" fn f_scalar_stack_1(
136136
a: Tiny,
@@ -144,7 +144,7 @@ pub extern "C" fn f_scalar_stack_1(
144144
) {
145145
}
146146

147-
// CHECK: define void @f_scalar_stack_2(%Large* {{.*}}sret{{.*}}, i64 %a, i128, i128, i64 %d, i8 zeroext %e, i8 %f, i8 %g)
147+
// CHECK: define void @f_scalar_stack_2(%Large* {{.*}}sret{{.*}} %0, i64 %a, i128 %1, i128 %2, i64 %d, i8 zeroext %e, i8 %f, i8 %g)
148148
#[no_mangle]
149149
pub extern "C" fn f_scalar_stack_2(
150150
a: u64,

src/test/codegen/riscv-abi/riscv64-lp64d-abi.rs

+17-17
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
// only-linux
55
#![crate_type = "lib"]
66

7-
// CHECK: define void @f_fpr_tracking(double, double, double, double, double, double, double, double, i8 zeroext %i)
7+
// CHECK: define void @f_fpr_tracking(double %0, double %1, double %2, double %3, double %4, double %5, double %6, double %7, i8 zeroext %i)
88
#[no_mangle]
99
pub extern "C" fn f_fpr_tracking(
1010
a: f64,
@@ -36,7 +36,7 @@ pub struct DoubleFloat {
3636
g: f32,
3737
}
3838

39-
// CHECK: define void @f_double_s_arg(double)
39+
// CHECK: define void @f_double_s_arg(double %0)
4040
#[no_mangle]
4141
pub extern "C" fn f_double_s_arg(a: Double) {}
4242

@@ -46,7 +46,7 @@ pub extern "C" fn f_ret_double_s() -> Double {
4646
Double { f: 1. }
4747
}
4848

49-
// CHECK: define void @f_double_double_s_arg({ double, double })
49+
// CHECK: define void @f_double_double_s_arg({ double, double } %0)
5050
#[no_mangle]
5151
pub extern "C" fn f_double_double_s_arg(a: DoubleDouble) {}
5252

@@ -56,7 +56,7 @@ pub extern "C" fn f_ret_double_double_s() -> DoubleDouble {
5656
DoubleDouble { f: 1., g: 2. }
5757
}
5858

59-
// CHECK: define void @f_double_float_s_arg({ double, float })
59+
// CHECK: define void @f_double_float_s_arg({ double, float } %0)
6060
#[no_mangle]
6161
pub extern "C" fn f_double_float_s_arg(a: DoubleFloat) {}
6262

@@ -66,7 +66,7 @@ pub extern "C" fn f_ret_double_float_s() -> DoubleFloat {
6666
DoubleFloat { f: 1., g: 2. }
6767
}
6868

69-
// CHECK: define void @f_double_double_s_arg_insufficient_fprs(double, double, double, double, double, double, double, [2 x i64])
69+
// CHECK: define void @f_double_double_s_arg_insufficient_fprs(double %0, double %1, double %2, double %3, double %4, double %5, double %6, [2 x i64] %7)
7070
#[no_mangle]
7171
pub extern "C" fn f_double_double_s_arg_insufficient_fprs(
7272
a: f64,
@@ -104,7 +104,7 @@ pub struct DoubleInt64 {
104104
i: i64,
105105
}
106106

107-
// CHECK: define void @f_double_int8_s_arg({ double, i8 })
107+
// CHECK: define void @f_double_int8_s_arg({ double, i8 } %0)
108108
#[no_mangle]
109109
pub extern "C" fn f_double_int8_s_arg(a: DoubleInt8) {}
110110

@@ -114,7 +114,7 @@ pub extern "C" fn f_ret_double_int8_s() -> DoubleInt8 {
114114
DoubleInt8 { f: 1., i: 2 }
115115
}
116116

117-
// CHECK: define void @f_double_int32_s_arg({ double, i32 })
117+
// CHECK: define void @f_double_int32_s_arg({ double, i32 } %0)
118118
#[no_mangle]
119119
pub extern "C" fn f_double_int32_s_arg(a: DoubleInt32) {}
120120

@@ -124,7 +124,7 @@ pub extern "C" fn f_ret_double_int32_s() -> DoubleInt32 {
124124
DoubleInt32 { f: 1., i: 2 }
125125
}
126126

127-
// CHECK: define void @f_double_uint8_s_arg({ double, i8 })
127+
// CHECK: define void @f_double_uint8_s_arg({ double, i8 } %0)
128128
#[no_mangle]
129129
pub extern "C" fn f_double_uint8_s_arg(a: DoubleUInt8) {}
130130

@@ -134,7 +134,7 @@ pub extern "C" fn f_ret_double_uint8_s() -> DoubleUInt8 {
134134
DoubleUInt8 { f: 1., i: 2 }
135135
}
136136

137-
// CHECK: define void @f_double_int64_s_arg({ double, i64 })
137+
// CHECK: define void @f_double_int64_s_arg({ double, i64 } %0)
138138
#[no_mangle]
139139
pub extern "C" fn f_double_int64_s_arg(a: DoubleInt64) {}
140140

@@ -144,7 +144,7 @@ pub extern "C" fn f_ret_double_int64_s() -> DoubleInt64 {
144144
DoubleInt64 { f: 1., i: 2 }
145145
}
146146

147-
// CHECK: define void @f_double_int8_s_arg_insufficient_gprs(i32 signext %a, i32 signext %b, i32 signext %c, i32 signext %d, i32 signext %e, i32 signext %f, i32 signext %g, i32 signext %h, [2 x i64])
147+
// CHECK: define void @f_double_int8_s_arg_insufficient_gprs(i32 signext %a, i32 signext %b, i32 signext %c, i32 signext %d, i32 signext %e, i32 signext %f, i32 signext %g, i32 signext %h, [2 x i64] %0)
148148
#[no_mangle]
149149
pub extern "C" fn f_double_int8_s_arg_insufficient_gprs(
150150
a: i32,
@@ -159,7 +159,7 @@ pub extern "C" fn f_double_int8_s_arg_insufficient_gprs(
159159
) {
160160
}
161161

162-
// CHECK: define void @f_struct_double_int8_insufficient_fprs(float, double, double, double, double, double, double, double, [2 x i64])
162+
// CHECK: define void @f_struct_double_int8_insufficient_fprs(float %0, double %1, double %2, double %3, double %4, double %5, double %6, double %7, [2 x i64] %8)
163163
#[no_mangle]
164164
pub extern "C" fn f_struct_double_int8_insufficient_fprs(
165165
a: f32,
@@ -179,7 +179,7 @@ pub struct DoubleArr1 {
179179
a: [f64; 1],
180180
}
181181

182-
// CHECK: define void @f_doublearr1_s_arg(double)
182+
// CHECK: define void @f_doublearr1_s_arg(double %0)
183183
#[no_mangle]
184184
pub extern "C" fn f_doublearr1_s_arg(a: DoubleArr1) {}
185185

@@ -194,7 +194,7 @@ pub struct DoubleArr2 {
194194
a: [f64; 2],
195195
}
196196

197-
// CHECK: define void @f_doublearr2_s_arg({ double, double })
197+
// CHECK: define void @f_doublearr2_s_arg({ double, double } %0)
198198
#[no_mangle]
199199
pub extern "C" fn f_doublearr2_s_arg(a: DoubleArr2) {}
200200

@@ -214,7 +214,7 @@ pub struct DoubleArr2Tricky1 {
214214
g: [Tricky1; 2],
215215
}
216216

217-
// CHECK: define void @f_doublearr2_tricky1_s_arg({ double, double })
217+
// CHECK: define void @f_doublearr2_tricky1_s_arg({ double, double } %0)
218218
#[no_mangle]
219219
pub extern "C" fn f_doublearr2_tricky1_s_arg(a: DoubleArr2Tricky1) {}
220220

@@ -233,7 +233,7 @@ pub struct DoubleArr2Tricky2 {
233233
g: [Tricky1; 2],
234234
}
235235

236-
// CHECK: define void @f_doublearr2_tricky2_s_arg({ double, double })
236+
// CHECK: define void @f_doublearr2_tricky2_s_arg({ double, double } %0)
237237
#[no_mangle]
238238
pub extern "C" fn f_doublearr2_tricky2_s_arg(a: DoubleArr2Tricky2) {}
239239

@@ -267,7 +267,7 @@ pub struct CharCharDouble {
267267
c: f64,
268268
}
269269

270-
// CHECK: define void @f_char_char_double_s_arg([2 x i64])
270+
// CHECK: define void @f_char_char_double_s_arg([2 x i64] %0)
271271
#[no_mangle]
272272
pub extern "C" fn f_char_char_double_s_arg(a: CharCharDouble) {}
273273

@@ -282,7 +282,7 @@ pub union DoubleU {
282282
a: f64,
283283
}
284284

285-
// CHECK: define void @f_double_u_arg(i64)
285+
// CHECK: define void @f_double_u_arg(i64 %0)
286286
#[no_mangle]
287287
pub extern "C" fn f_double_u_arg(a: DoubleU) {}
288288

0 commit comments

Comments
 (0)