Skip to content

Commit

Permalink
Repair several riscv64gc-unknown-linux-gnu codegen tests
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Hoverbear committed Jun 5, 2024
1 parent b21b74b commit 18f51e1
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 15 deletions.
2 changes: 1 addition & 1 deletion tests/codegen/riscv-abi/call-llvm-intrinsics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ pub fn do_call() {

unsafe {
// Ensure that we `call` LLVM intrinsics instead of trying to `invoke` them
// CHECK: store float 4.000000e+00, float* %{{.}}, align 4
// CHECK: store float 4.000000e+00, ptr %{{.}}, align 4
// CHECK: call float @llvm.sqrt.f32(float %{{.}}
sqrt(4.0);
}
Expand Down
22 changes: 14 additions & 8 deletions tests/codegen/riscv-abi/riscv64-lp64d-abi.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
//
//@ compile-flags: -C no-prepopulate-passes
//@ only-riscv64
//@ only-linux
//@ compile-flags: -O -C no-prepopulate-passes --target riscv64gc-unknown-linux-gnu
//@ needs-llvm-components: riscv

#![feature(no_core, lang_items)]
#![crate_type = "lib"]
#![no_std]
#![no_core]

#[lang="sized"] trait Sized { }
#[lang="freeze"] trait Freeze { }
#[lang="copy"] trait Copy { }

// 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)
// 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)
#[no_mangle]
pub extern "C" fn f_fpr_tracking(
a: f64,
Expand Down Expand Up @@ -144,7 +150,7 @@ pub extern "C" fn f_ret_double_int64_s() -> DoubleInt64 {
DoubleInt64 { f: 1., i: 2 }
}

// 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)
// 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)
#[no_mangle]
pub extern "C" fn f_double_int8_s_arg_insufficient_gprs(
a: i32,
Expand Down Expand Up @@ -250,11 +256,11 @@ pub struct IntDoubleInt {
c: i32,
}

// CHECK: define void @f_int_double_int_s_arg(%IntDoubleInt* {{.*}}%a)
// CHECK: define void @f_int_double_int_s_arg(ptr {{.*}} %a)
#[no_mangle]
pub extern "C" fn f_int_double_int_s_arg(a: IntDoubleInt) {}

// CHECK: define void @f_ret_int_double_int_s(%IntDoubleInt* {{.*}}sret
// CHECK: define void @f_ret_int_double_int_s(ptr {{.*}} sret([24 x i8]) align 8 dereferenceable(24) %_0)
#[no_mangle]
pub extern "C" fn f_ret_int_double_int_s() -> IntDoubleInt {
IntDoubleInt { a: 1, b: 2., c: 3 }
Expand Down
18 changes: 12 additions & 6 deletions tests/codegen/riscv-abi/riscv64-lp64f-lp64d-abi.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
//
//@ compile-flags: -C no-prepopulate-passes
//@ only-riscv64
//@ only-linux
//@ compile-flags: -O -C no-prepopulate-passes --target riscv64gc-unknown-linux-gnu
//@ needs-llvm-components: riscv

#![feature(no_core, lang_items)]
#![crate_type = "lib"]
#![no_std]
#![no_core]

#[lang="sized"] trait Sized { }
#[lang="freeze"] trait Freeze { }
#[lang="copy"] trait Copy { }

// 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)
// 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)
#[no_mangle]
pub extern "C" fn f_fpr_tracking(
a: f32,
Expand Down Expand Up @@ -128,7 +134,7 @@ pub extern "C" fn f_ret_float_int64_s() -> FloatInt64 {
FloatInt64 { f: 1., i: 2 }
}

// 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)
// 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)
#[no_mangle]
pub extern "C" fn f_float_int8_s_arg_insufficient_gprs(
a: i32,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
//@ build-pass
//@ only-linux
//@ ignore-riscv64 On this platform `-Csplit-debuginfo=unpacked` is unstable, see #120518
//
//@ compile-flags: -g --emit=llvm-ir -Csplit-debuginfo=unpacked
//
Expand Down

0 comments on commit 18f51e1

Please sign in to comment.