Skip to content

Commit ae4ae16

Browse files
committed
Repair several riscv64gc-unknown-linux-gnu codegen tests
Fix tests/codegen/riscv-abi/call-llvm-intrinsics.rs Fix tests/codegen/riscv-abi/riscv64-lp64d-abi.rs Fix tests/codegen/riscv-abi/riscv64-lp64f-lp64d-abi.rs On riscv64gc ignore tests/ui/debuginfo/debuginfo-emit-llvm-ir-and-split-debuginfo.rs Make tests/codegen/riscv-abi/riscv64-lp64d-abi.rs no_core Make tests/codegen/riscv-abi/riscv64-lp64f-lp64d-abi.rs no_core Set -O for tests/codegen/riscv-abi/riscv64-lp64d-abi.rs Set -O for tests/codegen/riscv-abi/riscv64-lp64f-lp64d-abi.rs
1 parent db8aca4 commit ae4ae16

File tree

4 files changed

+34
-15
lines changed

4 files changed

+34
-15
lines changed

tests/codegen/riscv-abi/call-llvm-intrinsics.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ pub fn do_call() {
2323

2424
unsafe {
2525
// Ensure that we `call` LLVM intrinsics instead of trying to `invoke` them
26-
// CHECK: store float 4.000000e+00, float* %{{.}}, align 4
26+
// CHECK: store float 4.000000e+00, ptr %{{.}}, align 4
2727
// CHECK: call float @llvm.sqrt.f32(float %{{.}}
2828
sqrt(4.0);
2929
}

tests/codegen/riscv-abi/riscv64-lp64d-abi.rs

+17-8
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,19 @@
1-
//
2-
//@ compile-flags: -C no-prepopulate-passes
3-
//@ only-riscv64
4-
//@ only-linux
1+
//@ compile-flags: -O -C no-prepopulate-passes --target riscv64gc-unknown-linux-gnu
2+
//@ needs-llvm-components: riscv
3+
4+
#![feature(no_core, lang_items)]
55
#![crate_type = "lib"]
6+
#![no_std]
7+
#![no_core]
8+
9+
#[lang = "sized"]
10+
trait Sized {}
11+
#[lang = "freeze"]
12+
trait Freeze {}
13+
#[lang = "copy"]
14+
trait Copy {}
615

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)
16+
// CHECK: define void @f_fpr_tracking(double %0, double %1, double %2, double %3, double %4, double %5, double %6, double %7, i8 noundef zeroext %i)
817
#[no_mangle]
918
pub extern "C" fn f_fpr_tracking(
1019
a: f64,
@@ -144,7 +153,7 @@ pub extern "C" fn f_ret_double_int64_s() -> DoubleInt64 {
144153
DoubleInt64 { f: 1., i: 2 }
145154
}
146155

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)
156+
// CHECK: define void @f_double_int8_s_arg_insufficient_gprs(i32 noundef signext %a, i32 noundef signext %b, i32 noundef signext %c, i32 noundef signext %d, i32 noundef signext %e, i32 noundef signext %f, i32 noundef signext %g, i32 noundef signext %h, [2 x i64] %0)
148157
#[no_mangle]
149158
pub extern "C" fn f_double_int8_s_arg_insufficient_gprs(
150159
a: i32,
@@ -250,11 +259,11 @@ pub struct IntDoubleInt {
250259
c: i32,
251260
}
252261

253-
// CHECK: define void @f_int_double_int_s_arg(%IntDoubleInt* {{.*}}%a)
262+
// CHECK: define void @f_int_double_int_s_arg(ptr {{.*}} %a)
254263
#[no_mangle]
255264
pub extern "C" fn f_int_double_int_s_arg(a: IntDoubleInt) {}
256265

257-
// CHECK: define void @f_ret_int_double_int_s(%IntDoubleInt* {{.*}}sret
266+
// CHECK: define void @f_ret_int_double_int_s(ptr {{.*}} sret([24 x i8]) align 8 dereferenceable(24) %_0)
258267
#[no_mangle]
259268
pub extern "C" fn f_ret_int_double_int_s() -> IntDoubleInt {
260269
IntDoubleInt { a: 1, b: 2., c: 3 }

tests/codegen/riscv-abi/riscv64-lp64f-lp64d-abi.rs

+15-6
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,19 @@
1-
//
2-
//@ compile-flags: -C no-prepopulate-passes
3-
//@ only-riscv64
4-
//@ only-linux
1+
//@ compile-flags: -O -C no-prepopulate-passes --target riscv64gc-unknown-linux-gnu
2+
//@ needs-llvm-components: riscv
3+
4+
#![feature(no_core, lang_items)]
55
#![crate_type = "lib"]
6+
#![no_std]
7+
#![no_core]
8+
9+
#[lang = "sized"]
10+
trait Sized {}
11+
#[lang = "freeze"]
12+
trait Freeze {}
13+
#[lang = "copy"]
14+
trait Copy {}
615

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)
16+
// CHECK: define void @f_fpr_tracking(float %0, float %1, float %2, float %3, float %4, float %5, float %6, float %7, i8 noundef zeroext %i)
817
#[no_mangle]
918
pub extern "C" fn f_fpr_tracking(
1019
a: f32,
@@ -128,7 +137,7 @@ pub extern "C" fn f_ret_float_int64_s() -> FloatInt64 {
128137
FloatInt64 { f: 1., i: 2 }
129138
}
130139

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)
140+
// CHECK: define void @f_float_int8_s_arg_insufficient_gprs(i32 noundef signext %a, i32 noundef signext %b, i32 noundef signext %c, i32 noundef signext %d, i32 noundef signext %e, i32 noundef signext %f, i32 noundef signext %g, i32 noundef signext %h, i64 %0)
132141
#[no_mangle]
133142
pub extern "C" fn f_float_int8_s_arg_insufficient_gprs(
134143
a: i32,

tests/ui/debuginfo/debuginfo-emit-llvm-ir-and-split-debuginfo.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
//@ build-pass
22
//@ only-linux
3+
//@ ignore-riscv64 On this platform `-Csplit-debuginfo=unpacked` is unstable, see #120518
34
//
45
//@ compile-flags: -g --emit=llvm-ir -Csplit-debuginfo=unpacked
56
//

0 commit comments

Comments
 (0)