Skip to content

Commit c872dcf

Browse files
committed
test: codegen: riscv64-abi: print value numbers for unnamed func args
LLVM 10 includes a009a60 which will print value numbers for unnamed func args. Update these tests to be in line with the referenced clang tests.
1 parent 95e9768 commit c872dcf

File tree

3 files changed

+41
-41
lines changed

3 files changed

+41
-41
lines changed

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

src/test/codegen/riscv-abi/riscv64-lp64f-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(float, float, float, float, float, float, float, float, i8 zeroext %i)
7+
// CHECK: define void @f_fpr_tracking(float %0, float %1, float %2, float %3, float %4, float %5, float %6, float %7, i8 zeroext %i)
88
#[no_mangle]
99
pub extern "C" fn f_fpr_tracking(
1010
a: f32,
@@ -30,7 +30,7 @@ pub struct FloatFloat {
3030
g: f32,
3131
}
3232

33-
// CHECK: define void @f_float_s_arg(float)
33+
// CHECK: define void @f_float_s_arg(float %0)
3434
#[no_mangle]
3535
pub extern "C" fn f_float_s_arg(a: Float) {}
3636

@@ -40,7 +40,7 @@ pub extern "C" fn f_ret_float_s() -> Float {
4040
Float { f: 1. }
4141
}
4242

43-
// CHECK: define void @f_float_float_s_arg({ float, float })
43+
// CHECK: define void @f_float_float_s_arg({ float, float } %0)
4444
#[no_mangle]
4545
pub extern "C" fn f_float_float_s_arg(a: FloatFloat) {}
4646

@@ -50,7 +50,7 @@ pub extern "C" fn f_ret_float_float_s() -> FloatFloat {
5050
FloatFloat { f: 1., g: 2. }
5151
}
5252

53-
// CHECK: define void @f_float_float_s_arg_insufficient_fprs(float, float, float, float, float, float, float, i64)
53+
// CHECK: define void @f_float_float_s_arg_insufficient_fprs(float %0, float %1, float %2, float %3, float %4, float %5, float %6, i64 %7)
5454
#[no_mangle]
5555
pub extern "C" fn f_float_float_s_arg_insufficient_fprs(
5656
a: f32,
@@ -88,7 +88,7 @@ pub struct FloatInt64 {
8888
i: i64,
8989
}
9090

91-
// CHECK: define void @f_float_int8_s_arg({ float, i8 })
91+
// CHECK: define void @f_float_int8_s_arg({ float, i8 } %0)
9292
#[no_mangle]
9393
pub extern "C" fn f_float_int8_s_arg(a: FloatInt8) {}
9494

@@ -98,7 +98,7 @@ pub extern "C" fn f_ret_float_int8_s() -> FloatInt8 {
9898
FloatInt8 { f: 1., i: 2 }
9999
}
100100

101-
// CHECK: define void @f_float_int32_s_arg({ float, i32 })
101+
// CHECK: define void @f_float_int32_s_arg({ float, i32 } %0)
102102
#[no_mangle]
103103
pub extern "C" fn f_float_int32_s_arg(a: FloatInt32) {}
104104

@@ -108,7 +108,7 @@ pub extern "C" fn f_ret_float_int32_s() -> FloatInt32 {
108108
FloatInt32 { f: 1., i: 2 }
109109
}
110110

111-
// CHECK: define void @f_float_uint8_s_arg({ float, i8 })
111+
// CHECK: define void @f_float_uint8_s_arg({ float, i8 } %0)
112112
#[no_mangle]
113113
pub extern "C" fn f_float_uint8_s_arg(a: FloatUInt8) {}
114114

@@ -118,7 +118,7 @@ pub extern "C" fn f_ret_float_uint8_s() -> FloatUInt8 {
118118
FloatUInt8 { f: 1., i: 2 }
119119
}
120120

121-
// CHECK: define void @f_float_int64_s_arg({ float, i64 })
121+
// CHECK: define void @f_float_int64_s_arg({ float, i64 } %0)
122122
#[no_mangle]
123123
pub extern "C" fn f_float_int64_s_arg(a: FloatInt64) {}
124124

@@ -128,7 +128,7 @@ pub extern "C" fn f_ret_float_int64_s() -> FloatInt64 {
128128
FloatInt64 { f: 1., i: 2 }
129129
}
130130

131-
// CHECK: define void @f_float_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, i64)
131+
// CHECK: define void @f_float_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, i64 %0)
132132
#[no_mangle]
133133
pub extern "C" fn f_float_int8_s_arg_insufficient_gprs(
134134
a: i32,
@@ -143,7 +143,7 @@ pub extern "C" fn f_float_int8_s_arg_insufficient_gprs(
143143
) {
144144
}
145145

146-
// CHECK: define void @f_struct_float_int8_insufficient_fprs(float, float, float, float, float, float, float, float, i64)
146+
// CHECK: define void @f_struct_float_int8_insufficient_fprs(float %0, float %1, float %2, float %3, float %4, float %5, float %6, float %7, i64 %8)
147147
#[no_mangle]
148148
pub extern "C" fn f_struct_float_int8_insufficient_fprs(
149149
a: f32,
@@ -163,7 +163,7 @@ pub struct FloatArr1 {
163163
a: [f32; 1],
164164
}
165165

166-
// CHECK: define void @f_floatarr1_s_arg(float)
166+
// CHECK: define void @f_floatarr1_s_arg(float %0)
167167
#[no_mangle]
168168
pub extern "C" fn f_floatarr1_s_arg(a: FloatArr1) {}
169169

@@ -178,7 +178,7 @@ pub struct FloatArr2 {
178178
a: [f32; 2],
179179
}
180180

181-
// CHECK: define void @f_floatarr2_s_arg({ float, float })
181+
// CHECK: define void @f_floatarr2_s_arg({ float, float } %0)
182182
#[no_mangle]
183183
pub extern "C" fn f_floatarr2_s_arg(a: FloatArr2) {}
184184

@@ -198,7 +198,7 @@ pub struct FloatArr2Tricky1 {
198198
g: [Tricky1; 2],
199199
}
200200

201-
// CHECK: define void @f_floatarr2_tricky1_s_arg({ float, float })
201+
// CHECK: define void @f_floatarr2_tricky1_s_arg({ float, float } %0)
202202
#[no_mangle]
203203
pub extern "C" fn f_floatarr2_tricky1_s_arg(a: FloatArr2Tricky1) {}
204204

@@ -217,7 +217,7 @@ pub struct FloatArr2Tricky2 {
217217
g: [Tricky1; 2],
218218
}
219219

220-
// CHECK: define void @f_floatarr2_tricky2_s_arg({ float, float })
220+
// CHECK: define void @f_floatarr2_tricky2_s_arg({ float, float } %0)
221221
#[no_mangle]
222222
pub extern "C" fn f_floatarr2_tricky2_s_arg(a: FloatArr2Tricky2) {}
223223

@@ -234,7 +234,7 @@ pub struct IntFloatInt {
234234
c: i32,
235235
}
236236

237-
// CHECK: define void @f_int_float_int_s_arg([2 x i64])
237+
// CHECK: define void @f_int_float_int_s_arg([2 x i64] %0)
238238
#[no_mangle]
239239
pub extern "C" fn f_int_float_int_s_arg(a: IntFloatInt) {}
240240

@@ -251,7 +251,7 @@ pub struct CharCharFloat {
251251
c: f32,
252252
}
253253

254-
// CHECK: define void @f_char_char_float_s_arg(i64)
254+
// CHECK: define void @f_char_char_float_s_arg(i64 %0)
255255
#[no_mangle]
256256
pub extern "C" fn f_char_char_float_s_arg(a: CharCharFloat) {}
257257

@@ -266,7 +266,7 @@ pub union FloatU {
266266
a: f32,
267267
}
268268

269-
// CHECK: define void @f_float_u_arg(i64)
269+
// CHECK: define void @f_float_u_arg(i64 %0)
270270
#[no_mangle]
271271
pub extern "C" fn f_float_u_arg(a: FloatU) {}
272272

0 commit comments

Comments
 (0)