Skip to content

Commit

Permalink
Auto merge of rust-lang#128807 - ChrisDenton:bloat, r=<try>
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
bors committed Aug 8, 2024
2 parents 86e7875 + 06d09ad commit 5811814
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
3 changes: 2 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,8 @@
use core::fmt;
use core::fmt::Write;

#[link(name = "c")]
#[cfg_attr(not(target_env = "msvc"), link(name = "c"))]
#[cfg_attr(target_env = "msvc", link(name = "libcmt"))]
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 5811814

Please sign in to comment.