Skip to content

Commit 58fb508

Browse files
committed
Auto merge of rust-lang#127877 - Rejyr:migrate-print-rmake, r=jieyouxu
Migrate `print-target-list` to `rmake` and `print-calling-convention` to ui-test Part of rust-lang#121876. r? `@jieyouxu` try-job: x86_64-gnu-llvm-18 try-job: test-various try-job: armhf-gnu try-job: aarch64-apple try-job: i686-mingw try-job: x86_64-msvc
2 parents b389b0a + 36cf385 commit 58fb508

File tree

10 files changed

+61
-25
lines changed

10 files changed

+61
-25
lines changed

src/tools/tidy/src/allowed_run_make_makefiles.txt

-2
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@ run-make/no-alloc-shim/Makefile
2323
run-make/pdb-buildinfo-cl-cmd/Makefile
2424
run-make/pgo-gen-lto/Makefile
2525
run-make/pgo-indirect-call-promotion/Makefile
26-
run-make/print-calling-conventions/Makefile
27-
run-make/print-target-list/Makefile
2826
run-make/raw-dylib-alt-calling-convention/Makefile
2927
run-make/raw-dylib-c/Makefile
3028
run-make/redundant-libs/Makefile

tests/run-make/print-calling-conventions/Makefile

-4
This file was deleted.

tests/run-make/print-cfg/rmake.rs

+1-4
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
//! It also checks that some targets have the correct set cfgs.
77
88
use std::collections::HashSet;
9-
use std::ffi::OsString;
109
use std::iter::FromIterator;
1110
use std::path::PathBuf;
1211

@@ -91,10 +90,8 @@ fn check(PrintCfg { target, includes, disallow }: PrintCfg) {
9190
// --print=cfg=PATH
9291
{
9392
let tmp_path = PathBuf::from(format!("{target}.cfg"));
94-
let mut print_arg = OsString::from("--print=cfg=");
95-
print_arg.push(tmp_path.as_os_str());
9693

97-
rustc().target(target).arg(print_arg).run();
94+
rustc().target(target).print(&format!("cfg={}", tmp_path.display())).run();
9895

9996
let output = rfs::read_to_string(&tmp_path);
10097

tests/run-make/print-check-cfg/rmake.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ fn main() {
8787

8888
fn check(CheckCfg { args, contains }: CheckCfg) {
8989
let output =
90-
rustc().input("lib.rs").arg("-Zunstable-options").arg("--print=check-cfg").args(args).run();
90+
rustc().input("lib.rs").arg("-Zunstable-options").print("check-cfg").args(args).run();
9191

9292
let stdout = output.stdout_utf8();
9393

tests/run-make/print-target-list/Makefile

-8
This file was deleted.
+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
// Checks that all the targets returned by `rustc --print target-list` are valid
2+
// target specifications
3+
4+
use run_make_support::bare_rustc;
5+
6+
// FIXME(127877): certain experimental targets fail with creating a 'LLVM TargetMachine'
7+
// in CI, so we skip them
8+
const EXPERIMENTAL_TARGETS: &[&str] = &["avr", "m68k", "csky", "xtensa"];
9+
10+
fn main() {
11+
let targets = bare_rustc().print("target-list").run().stdout_utf8();
12+
13+
for target in targets.lines() {
14+
// skip experimental targets that would otherwise fail
15+
if EXPERIMENTAL_TARGETS.iter().any(|experimental| target.contains(experimental)) {
16+
continue;
17+
}
18+
19+
bare_rustc().target(target).print("sysroot").run();
20+
}
21+
}

tests/run-make/print-to-output/rmake.rs

+1-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
//! This checks the output of some `--print` options when
22
//! output to a file (instead of stdout)
33
4-
use std::ffi::OsString;
54
use std::path::PathBuf;
65

76
use run_make_support::{rfs, rustc, target};
@@ -44,10 +43,8 @@ fn check(args: Option) {
4443
// --print={option}=PATH
4544
let output = {
4645
let tmp_path = PathBuf::from(format!("{}.txt", args.option));
47-
let mut print_arg = OsString::from(format!("--print={}=", args.option));
48-
print_arg.push(tmp_path.as_os_str());
4946

50-
rustc().target(args.target).arg(print_arg).run();
47+
rustc().target(args.target).print(&format!("{}={}", args.option, tmp_path.display())).run();
5148

5249
rfs::read_to_string(&tmp_path)
5350
};

tests/run-make/rustdoc-scrape-examples-macros/rmake.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@ fn main() {
1111
let dylib_name = rustc()
1212
.crate_name(proc_crate_name)
1313
.crate_type("dylib")
14-
.arg("--print")
15-
.arg("file-names")
14+
.print("file-names")
1615
.arg("-")
1716
.run()
1817
.stdout_utf8();

tests/ui/print-calling-conventions.rs

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
//@ compile-flags: --print calling-conventions
2+
//@ build-pass
+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
C
2+
C-cmse-nonsecure-call
3+
C-unwind
4+
Rust
5+
aapcs
6+
aapcs-unwind
7+
avr-interrupt
8+
avr-non-blocking-interrupt
9+
cdecl
10+
cdecl-unwind
11+
efiapi
12+
fastcall
13+
fastcall-unwind
14+
msp430-interrupt
15+
ptx-kernel
16+
riscv-interrupt-m
17+
riscv-interrupt-s
18+
rust-call
19+
rust-cold
20+
rust-intrinsic
21+
stdcall
22+
stdcall-unwind
23+
system
24+
system-unwind
25+
sysv64
26+
sysv64-unwind
27+
thiscall
28+
thiscall-unwind
29+
unadjusted
30+
vectorcall
31+
vectorcall-unwind
32+
win64
33+
win64-unwind
34+
x86-interrupt

0 commit comments

Comments
 (0)