From ae4ae1685c9fcdfd834736c6cbcd58ba13b3e8b9 Mon Sep 17 00:00:00 2001 From: Ana Hobden Date: Thu, 16 May 2024 13:10:17 -0700 Subject: [PATCH] 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 --- .../codegen/riscv-abi/call-llvm-intrinsics.rs | 2 +- tests/codegen/riscv-abi/riscv64-lp64d-abi.rs | 25 +++++++++++++------ .../riscv-abi/riscv64-lp64f-lp64d-abi.rs | 21 +++++++++++----- ...uginfo-emit-llvm-ir-and-split-debuginfo.rs | 1 + 4 files changed, 34 insertions(+), 15 deletions(-) diff --git a/tests/codegen/riscv-abi/call-llvm-intrinsics.rs b/tests/codegen/riscv-abi/call-llvm-intrinsics.rs index c3f795e885760..e72a649a530a8 100644 --- a/tests/codegen/riscv-abi/call-llvm-intrinsics.rs +++ b/tests/codegen/riscv-abi/call-llvm-intrinsics.rs @@ -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); } diff --git a/tests/codegen/riscv-abi/riscv64-lp64d-abi.rs b/tests/codegen/riscv-abi/riscv64-lp64d-abi.rs index 060d91a2696aa..bcd9b0eae71d4 100644 --- a/tests/codegen/riscv-abi/riscv64-lp64d-abi.rs +++ b/tests/codegen/riscv-abi/riscv64-lp64d-abi.rs @@ -1,10 +1,19 @@ -// -//@ 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, @@ -144,7 +153,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, @@ -250,11 +259,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 } diff --git a/tests/codegen/riscv-abi/riscv64-lp64f-lp64d-abi.rs b/tests/codegen/riscv-abi/riscv64-lp64f-lp64d-abi.rs index 3d0512817f7c4..27018d2e6d203 100644 --- a/tests/codegen/riscv-abi/riscv64-lp64f-lp64d-abi.rs +++ b/tests/codegen/riscv-abi/riscv64-lp64f-lp64d-abi.rs @@ -1,10 +1,19 @@ -// -//@ 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, @@ -128,7 +137,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, diff --git a/tests/ui/debuginfo/debuginfo-emit-llvm-ir-and-split-debuginfo.rs b/tests/ui/debuginfo/debuginfo-emit-llvm-ir-and-split-debuginfo.rs index 8611796501643..3322660d1a853 100644 --- a/tests/ui/debuginfo/debuginfo-emit-llvm-ir-and-split-debuginfo.rs +++ b/tests/ui/debuginfo/debuginfo-emit-llvm-ir-and-split-debuginfo.rs @@ -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 //