Skip to content

Commit

Permalink
Rollup merge of rust-lang#128807 - ChrisDenton:bloat, r=jieyouxu
Browse files Browse the repository at this point in the history
run-make: run fmt-write-bloat on Windows

The trouble here is that libc doesn't exist on Windows. Well it kinda does but it isn't called that so we substitute a name that works. Ideally finding necessary libs for the platform would be done at a higher level but until then this should work.

try-job: x86_64-msvc
try-job: i686-msvc
  • Loading branch information
matthiaskrgr authored Aug 8, 2024
2 parents f536b4e + 67518d0 commit dc5b289
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
4 changes: 3 additions & 1 deletion tests/run-make/fmt-write-bloat/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
use core::fmt;
use core::fmt::Write;

#[link(name = "c")]
#[cfg_attr(not(target_env = "msvc"), link(name = "c"))]
#[cfg_attr(all(target_env = "msvc", target_feature = "crt-static"), link(name = "libcmt"))]
#[cfg_attr(all(target_env = "msvc", not(target_feature = "crt-static")), link(name = "msvcrt"))]
extern "C" {}

struct Dummy;
Expand Down
7 changes: 2 additions & 5 deletions tests/run-make/fmt-write-bloat/rmake.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,11 @@
//! `NO_DEBUG_ASSERTIONS=1`). If debug assertions are disabled, then we can check for the absence of
//! additional `usize` formatting and padding related symbols.

// Reason: This test is `ignore-windows` because the `no_std` test (using `#[link(name = "c")])`
// doesn't link on windows.
//@ ignore-windows
//@ ignore-cross-compile

use run_make_support::env::no_debug_assertions;
use run_make_support::rustc;
use run_make_support::symbols::any_symbol_contains;
use run_make_support::{bin_name, rustc};

fn main() {
rustc().input("main.rs").opt().run();
Expand All @@ -33,5 +30,5 @@ fn main() {
// otherwise, add them to the list of symbols to deny.
panic_syms.extend_from_slice(&["panicking", "panic_fmt", "pad_integral", "Display"]);
}
assert!(!any_symbol_contains("main", &panic_syms));
assert!(!any_symbol_contains(&bin_name("main"), &panic_syms));
}

0 comments on commit dc5b289

Please sign in to comment.