rewrite target-without-atomic-cas to rmake

This commit is contained in:
Oneirical 2024-07-04 11:37:16 -04:00
parent e45d72dee0
commit 0d85ef2857
5 changed files with 18 additions and 12 deletions

View File

@ -162,9 +162,6 @@ run-make/symbol-mangling-hashed/Makefile
run-make/symbol-visibility/Makefile run-make/symbol-visibility/Makefile
run-make/symbols-include-type-name/Makefile run-make/symbols-include-type-name/Makefile
run-make/sysroot-crates-are-unstable/Makefile run-make/sysroot-crates-are-unstable/Makefile
run-make/target-cpu-native/Makefile
run-make/target-specs/Makefile
run-make/target-without-atomic-cas/Makefile
run-make/test-benches/Makefile run-make/test-benches/Makefile
run-make/test-harness/Makefile run-make/test-harness/Makefile
run-make/thumb-none-cortex-m/Makefile run-make/thumb-none-cortex-m/Makefile

View File

@ -3,8 +3,6 @@
// warnings when used, and that binaries produced by it can also be successfully executed. // warnings when used, and that binaries produced by it can also be successfully executed.
// See https://github.com/rust-lang/rust/pull/23238 // See https://github.com/rust-lang/rust/pull/23238
// FIXME(Oneirical): only-linux only-x86_64
use run_make_support::{run, rustc}; use run_make_support::{run, rustc};
fn main() { fn main() {
@ -12,5 +10,5 @@ fn main() {
run("foo"); run("foo");
// There should be zero warnings emitted - the bug would cause "unknown CPU `native`" // There should be zero warnings emitted - the bug would cause "unknown CPU `native`"
// to be printed out. // to be printed out.
assert_eq!(out.len(), 0); assert!(out.is_empty());
} }

View File

@ -1,6 +1,6 @@
// Target-specific compilation in rustc used to have case-by-case peculiarities in 2014, // Target-specific compilation in rustc used to have case-by-case peculiarities in 2014,
// with the compiler having redundant target types and unspecific names. An overarching rework // with the compiler having redundant target types and unspecific names. An overarching rework
// in #161156 changed the way the target flag functions, and this test attempts compilation // in #16156 changed the way the target flag functions, and this test attempts compilation
// with the target flag's bundle of new features to check that compilation either succeeds while // with the target flag's bundle of new features to check that compilation either succeeds while
// using them correctly, or fails with the right error message when using them improperly. // using them correctly, or fails with the right error message when using them improperly.
// See https://github.com/rust-lang/rust/pull/16156 // See https://github.com/rust-lang/rust/pull/16156

View File

@ -1,5 +0,0 @@
include ../tools.mk
# The target used below doesn't support atomic CAS operations. Verify that's the case
all:
$(RUSTC) --print cfg --target thumbv6m-none-eabi | $(CGREP) -v 'target_has_atomic="ptr"'

View File

@ -0,0 +1,16 @@
// ARM Cortex-M are a class of processors supported by the rust compiler. However,
// they cannot support any atomic features, such as Arc. This test simply prints
// the configuration details of one Cortex target, and checks that the compiler
// does not falsely list atomic support.
// See https://github.com/rust-lang/rust/pull/36874
use run_make_support::rustc;
// The target used below doesn't support atomic CAS operations. Verify that's the case
fn main() {
rustc()
.print("cfg")
.target("thumbv6m-none-eabi")
.run()
.assert_stdout_not_contains(r#"target_has_atomic="ptr""#);
}