diff options
| author | Erik Desjardins <erikdesjardins@users.noreply.github.com> | 2022-02-12 12:28:19 -0500 |
|---|---|---|
| committer | Erik Desjardins <erikdesjardins@users.noreply.github.com> | 2022-02-12 12:28:19 -0500 |
| commit | 401307759aaf6f1e49c8a2c840a76ae41ec1f865 (patch) | |
| tree | 476b23d1a6855e7e566faa6dbb0fd79c387d25ab | |
| parent | ae877003ec0d1941992a86996630df947582990e (diff) | |
| download | rust-401307759aaf6f1e49c8a2c840a76ae41ec1f865.tar.gz rust-401307759aaf6f1e49c8a2c840a76ae41ec1f865.zip | |
make fastcall-inreg and riscv64-lp64-lp64f-lp64d-abi tests able to run on any host platform (with the right llvm components)
| -rw-r--r-- | src/test/codegen/fastcall-inreg.rs | 53 | ||||
| -rw-r--r-- | src/test/codegen/riscv-abi/riscv64-lp64-lp64f-lp64d-abi.rs | 24 |
2 files changed, 21 insertions, 56 deletions
diff --git a/src/test/codegen/fastcall-inreg.rs b/src/test/codegen/fastcall-inreg.rs index d8e5856822e..ec7a6791592 100644 --- a/src/test/codegen/fastcall-inreg.rs +++ b/src/test/codegen/fastcall-inreg.rs @@ -2,52 +2,17 @@ // as "inreg" like the C/C++ compilers for the platforms. // x86 only. -// ignore-aarch64 -// ignore-aarch64_be -// ignore-arm -// ignore-armeb -// ignore-avr -// ignore-bpfel -// ignore-bpfeb -// ignore-hexagon -// ignore-mips -// ignore-mips64 -// ignore-msp430 -// ignore-powerpc64 -// ignore-powerpc64le -// ignore-powerpc -// ignore-r600 -// ignore-riscv64 -// ignore-amdgcn -// ignore-sparc -// ignore-sparc64 -// ignore-sparcv9 -// ignore-sparcel -// ignore-s390x -// ignore-tce -// ignore-thumb -// ignore-thumbeb -// ignore-x86_64 -// ignore-xcore -// ignore-nvptx -// ignore-nvptx64 -// ignore-le32 -// ignore-le64 -// ignore-amdil -// ignore-amdil64 -// ignore-hsail -// ignore-hsail64 -// ignore-spir -// ignore-spir64 -// ignore-kalimba -// ignore-shave -// ignore-wasm32 -// ignore-wasm64 -// ignore-emscripten - -// compile-flags: -C no-prepopulate-passes +// compile-flags: --target i686-unknown-linux-gnu -C no-prepopulate-passes +// needs-llvm-components: x86 #![crate_type = "lib"] +#![no_core] +#![feature(no_core, lang_items)] + +#[lang = "sized"] +trait Sized {} +#[lang = "copy"] +trait Copy {} pub mod tests { // CHECK: @f1(i32 inreg %_1, i32 inreg %_2, i32 %_3) diff --git a/src/test/codegen/riscv-abi/riscv64-lp64-lp64f-lp64d-abi.rs b/src/test/codegen/riscv-abi/riscv64-lp64-lp64f-lp64d-abi.rs index 8593a035787..c67406ea693 100644 --- a/src/test/codegen/riscv-abi/riscv64-lp64-lp64f-lp64d-abi.rs +++ b/src/test/codegen/riscv-abi/riscv64-lp64-lp64f-lp64d-abi.rs @@ -1,10 +1,16 @@ -// -// compile-flags: -C no-prepopulate-passes -// only-riscv64 -// only-linux +// compile-flags: --target riscv64gc-unknown-linux-gnu -C no-prepopulate-passes +// needs-llvm-components: riscv + #![crate_type = "lib"] +#![no_core] +#![feature(no_core, lang_items)] #![allow(improper_ctypes)] +#[lang = "sized"] +trait Sized {} +#[lang = "copy"] +trait Copy {} + // CHECK: define void @f_void() #[no_mangle] pub extern "C" fn f_void() {} @@ -70,8 +76,6 @@ pub struct Tiny { // CHECK: define void @f_agg_tiny(i64 %0) #[no_mangle] pub extern "C" fn f_agg_tiny(mut e: Tiny) { - e.a += e.b; - e.c += e.d; } // CHECK: define i64 @f_agg_tiny_ret() @@ -89,14 +93,12 @@ pub struct Small { // CHECK: define void @f_agg_small([2 x i64] %0) #[no_mangle] pub extern "C" fn f_agg_small(mut x: Small) { - x.a += unsafe { *x.b }; - x.b = &mut x.a; } // CHECK: define [2 x i64] @f_agg_small_ret() #[no_mangle] pub extern "C" fn f_agg_small_ret() -> Small { - Small { a: 1, b: core::ptr::null_mut() } + Small { a: 1, b: 0 as *mut _ } } #[repr(C)] @@ -107,7 +109,6 @@ pub struct SmallAligned { // CHECK: define void @f_agg_small_aligned(i128 %0) #[no_mangle] pub extern "C" fn f_agg_small_aligned(mut x: SmallAligned) { - x.a += x.a; } #[repr(C)] @@ -121,7 +122,6 @@ pub struct Large { // CHECK: define void @f_agg_large(%Large* {{.*}}%x) #[no_mangle] pub extern "C" fn f_agg_large(mut x: Large) { - x.a = x.b + x.c + x.d; } // CHECK: define void @f_agg_large_ret(%Large* {{.*}}sret{{.*}}, i32 signext %i, i8 signext %j) @@ -172,7 +172,7 @@ pub unsafe extern "C" fn f_va_caller() { 4.0f64, 5.0f64, Tiny { a: 1, b: 2, c: 3, d: 4 }, - Small { a: 10, b: core::ptr::null_mut() }, + Small { a: 10, b: 0 as *mut _ }, SmallAligned { a: 11 }, Large { a: 12, b: 13, c: 14, d: 15 }, ); |
