Skip to content

Commit 3f4f23a

Browse files
committed
Use is_windows_msvc instead of is_msvc in run-make tests
1 parent 87a4121 commit 3f4f23a

File tree

22 files changed

+57
-53
lines changed

22 files changed

+57
-53
lines changed

tests/run-make/archive-duplicate-names/rmake.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
//@ ignore-cross-compile
77
// Reason: the compiled binary is executed
88

9-
use run_make_support::{cc, is_msvc, llvm_ar, rfs, run, rustc};
9+
use run_make_support::{cc, is_windows_msvc, llvm_ar, rfs, run, rustc};
1010

1111
fn main() {
1212
rfs::create_dir("a");
@@ -15,7 +15,7 @@ fn main() {
1515
compile_obj_force_foo("b", "bar");
1616
let mut ar = llvm_ar();
1717
ar.obj_to_ar().arg("libfoo.a");
18-
if is_msvc() {
18+
if is_windows_msvc() {
1919
ar.arg("a/foo.obj").arg("b/foo.obj").run();
2020
} else {
2121
ar.arg("a/foo.o").arg("b/foo.o").run();
@@ -27,9 +27,9 @@ fn main() {
2727

2828
#[track_caller]
2929
pub fn compile_obj_force_foo(dir: &str, lib_name: &str) {
30-
let obj_file = if is_msvc() { format!("{dir}/foo") } else { format!("{dir}/foo.o") };
30+
let obj_file = if is_windows_msvc() { format!("{dir}/foo") } else { format!("{dir}/foo.o") };
3131
let src = format!("{lib_name}.c");
32-
if is_msvc() {
32+
if is_windows_msvc() {
3333
cc().arg("-c").out_exe(&obj_file).input(src).run();
3434
} else {
3535
cc().arg("-v").arg("-c").out_exe(&obj_file).input(src).run();

tests/run-make/c-link-to-rust-dylib/rmake.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,14 @@
33

44
//@ ignore-cross-compile
55

6-
use run_make_support::{cc, cwd, dynamic_lib_extension, is_msvc, rfs, run, run_fail, rustc};
6+
use run_make_support::{
7+
cc, cwd, dynamic_lib_extension, is_windows_msvc, rfs, run, run_fail, rustc,
8+
};
79

810
fn main() {
911
rustc().input("foo.rs").run();
1012

11-
if is_msvc() {
13+
if is_windows_msvc() {
1214
let lib = "foo.dll.lib";
1315

1416
cc().input("bar.c").arg(lib).out_exe("bar").run();

tests/run-make/c-unwind-abi-catch-lib-panic/rmake.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@
88
//@ needs-unwind
99
// Reason: this test exercises unwinding a panic
1010

11-
use run_make_support::{cc, is_msvc, llvm_ar, run, rustc, static_lib_name};
11+
use run_make_support::{cc, is_windows_msvc, llvm_ar, run, rustc, static_lib_name};
1212

1313
fn main() {
1414
// Compile `add.c` into an object file.
15-
if is_msvc() {
15+
if is_windows_msvc() {
1616
cc().arg("-c").out_exe("add").input("add.c").run();
1717
} else {
1818
cc().arg("-v").arg("-c").out_exe("add.o").input("add.c").run();
@@ -24,7 +24,7 @@ fn main() {
2424
rustc().emit("obj").input("panic.rs").run();
2525

2626
// Now, create an archive using these two objects.
27-
if is_msvc() {
27+
if is_windows_msvc() {
2828
llvm_ar().obj_to_ar().args(&[&static_lib_name("add"), "add.obj", "panic.o"]).run();
2929
} else {
3030
llvm_ar().obj_to_ar().args(&[&static_lib_name("add"), "add.o", "panic.o"]).run();

tests/run-make/cdylib-dylib-linkage/rmake.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
use run_make_support::{
1111
bin_name, cc, dynamic_lib_extension, dynamic_lib_name, filename_contains, has_extension,
12-
has_prefix, has_suffix, is_msvc, msvc_import_dynamic_lib_name, path, run, rustc,
12+
has_prefix, has_suffix, is_windows_msvc, msvc_import_dynamic_lib_name, path, run, rustc,
1313
shallow_find_files, target,
1414
};
1515

@@ -19,7 +19,7 @@ fn main() {
1919
let sysroot = rustc().print("sysroot").run().stdout_utf8();
2020
let sysroot = sysroot.trim();
2121
let target_sysroot = path(sysroot).join("lib/rustlib").join(target()).join("lib");
22-
if is_msvc() {
22+
if is_windows_msvc() {
2323
let mut libs = shallow_find_files(&target_sysroot, |path| {
2424
has_prefix(path, "libstd-") && has_suffix(path, ".dll.lib")
2525
});

tests/run-make/cdylib/rmake.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@
1010

1111
//@ ignore-cross-compile
1212

13-
use run_make_support::{cc, cwd, dynamic_lib_name, is_msvc, rfs, run, rustc};
13+
use run_make_support::{cc, cwd, dynamic_lib_name, is_windows_msvc, rfs, run, rustc};
1414

1515
fn main() {
1616
rustc().input("bar.rs").run();
1717
rustc().input("foo.rs").run();
1818

19-
if is_msvc() {
19+
if is_windows_msvc() {
2020
cc().input("foo.c").arg("foo.dll.lib").out_exe("foo").run();
2121
} else {
2222
cc().input("foo.c").arg("-lfoo").library_search_path(cwd()).output("foo").run();

tests/run-make/compiler-rt-works-on-mingw/rmake.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
//@ only-windows-gnu
77

8-
use run_make_support::{cxx, is_msvc, llvm_ar, run, rustc, static_lib_name};
8+
use run_make_support::{cxx, llvm_ar, run, rustc, static_lib_name};
99

1010
fn main() {
1111
cxx().input("foo.cpp").arg("-c").out_exe("foo.o").run();

tests/run-make/link-args-order/rmake.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@
66
// checks that linker arguments remain intact and in the order they were originally passed in.
77
// See https://github.com/rust-lang/rust/pull/70665
88

9-
use run_make_support::{is_msvc, rustc};
9+
use run_make_support::{is_windows_msvc, rustc};
1010

1111
fn main() {
12-
let linker = if is_msvc() { "msvc" } else { "ld" };
12+
let linker = if is_windows_msvc() { "msvc" } else { "ld" };
1313

1414
rustc()
1515
.input("empty.rs")

tests/run-make/link-dedup/rmake.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
use std::fmt::Write;
1111

12-
use run_make_support::{is_msvc, rustc, target};
12+
use run_make_support::{is_windows_msvc, rustc, target};
1313

1414
fn main() {
1515
rustc().input("depa.rs").run();
@@ -32,7 +32,7 @@ fn main() {
3232
fn needle_from_libs(libs: &[&str]) -> String {
3333
let mut needle = String::new();
3434
for lib in libs {
35-
if is_msvc() {
35+
if is_windows_msvc() {
3636
needle.write_fmt(format_args!(r#""{lib}.lib" "#)).unwrap();
3737
} else if target().contains("wasm") {
3838
needle.write_fmt(format_args!(r#""-l" "{lib}" "#)).unwrap();

tests/run-make/native-link-modifier-bundle/rmake.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
// Reason: cross-compilation fails to export native symbols
2121

2222
use run_make_support::{
23-
build_native_static_lib, dynamic_lib_name, is_msvc, llvm_nm, rust_lib_name, rustc,
23+
build_native_static_lib, dynamic_lib_name, is_windows_msvc, llvm_nm, rust_lib_name, rustc,
2424
static_lib_name,
2525
};
2626

@@ -60,7 +60,7 @@ fn main() {
6060
.assert_stdout_contains_regex("U _*native_func");
6161

6262
// This part of the test does not function on Windows MSVC - no symbols are printed.
63-
if !is_msvc() {
63+
if !is_windows_msvc() {
6464
// Build a cdylib, `native-staticlib` will not appear on the linker line because it was
6565
// bundled previously. The cdylib will contain the `native_func` symbol in the end.
6666
rustc()

tests/run-make/native-link-modifier-whole-archive/rmake.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@
1010
// Reason: compiling C++ code does not work well when cross-compiling
1111
// plus, the compiled binary is executed
1212

13-
use run_make_support::{cxx, is_msvc, llvm_ar, run, run_with_args, rustc, static_lib_name};
13+
use run_make_support::{cxx, is_windows_msvc, llvm_ar, run, run_with_args, rustc, static_lib_name};
1414

1515
fn main() {
1616
let mut cxx = cxx();
17-
if is_msvc() {
17+
if is_windows_msvc() {
1818
cxx.arg("-EHs");
1919
}
2020
cxx.input("c_static_lib_with_constructor.cpp")
@@ -24,7 +24,7 @@ fn main() {
2424

2525
let mut llvm_ar = llvm_ar();
2626
llvm_ar.obj_to_ar();
27-
if is_msvc() {
27+
if is_windows_msvc() {
2828
llvm_ar
2929
.output_input(
3030
static_lib_name("c_static_lib_with_constructor"),

0 commit comments

Comments
 (0)