about summary refs log tree commit diff
path: root/tests/codegen-llvm
diff options
context:
space:
mode:
authorMatthias Krüger <476013+matthiaskrgr@users.noreply.github.com>2025-09-15 22:09:47 +0200
committerGitHub <noreply@github.com>2025-09-15 22:09:47 +0200
commitbcdb3eeeffe94fb0de01aa7527856e4c05a7e8f6 (patch)
tree1b76c9e8e382b252abd75ba8ec5522d7b48a953e /tests/codegen-llvm
parentf3fd3efe4f698ad9dc2ccd6b46a3b07e1bc911da (diff)
parentd80db5b814f594f2e1ecea2e375990287ba4d4df (diff)
downloadrust-bcdb3eeeffe94fb0de01aa7527856e4c05a7e8f6.tar.gz
rust-bcdb3eeeffe94fb0de01aa7527856e4c05a7e8f6.zip
Rollup merge of #146344 - Gelbpunkt:loongarch-codegen-llvm-test, r=Mark-Simulacrum
tests/codegen-llvm: Make rust-abi-arch-specific-adjustment portable

This test currently only runs on RISC-V and loongarch hosts, but assumes that the host target is the -gnu target. By using minicore, we can run this test on all host targets, regardless of architecture, as long as the LLVM components are built.
This also fixes this test on musl hosts of these architectures (though I've only tested on loongarch64-unknown-linux-musl).
Diffstat (limited to 'tests/codegen-llvm')
-rw-r--r--tests/codegen-llvm/rust-abi-arch-specific-adjustment.rs8
1 files changed, 6 insertions, 2 deletions
diff --git a/tests/codegen-llvm/rust-abi-arch-specific-adjustment.rs b/tests/codegen-llvm/rust-abi-arch-specific-adjustment.rs
index 561f081c700..ffff4b35994 100644
--- a/tests/codegen-llvm/rust-abi-arch-specific-adjustment.rs
+++ b/tests/codegen-llvm/rust-abi-arch-specific-adjustment.rs
@@ -1,15 +1,19 @@
+//@ add-core-stubs
 //@ compile-flags: -Copt-level=3 -C no-prepopulate-passes
 //@ revisions: riscv64 loongarch64
 
-//@[riscv64] only-riscv64
 //@[riscv64] compile-flags: --target riscv64gc-unknown-linux-gnu
 //@[riscv64] needs-llvm-components: riscv
 
-//@[loongarch64] only-loongarch64
 //@[loongarch64] compile-flags: --target loongarch64-unknown-linux-gnu
 //@[loongarch64] needs-llvm-components: loongarch
 
 #![crate_type = "lib"]
+#![feature(no_core)]
+#![no_core]
+
+extern crate minicore;
+use minicore::*;
 
 #[no_mangle]
 // riscv64:     define noundef i8 @arg_attr_u8(i8 noundef zeroext %x)