From 7a906e1af71684138702a85fe114def61f21379d Mon Sep 17 00:00:00 2001 From: Ben Kimock Date: Thu, 18 Apr 2024 17:49:07 -0400 Subject: [PATCH] Port stdout-during-shutdown --- ...down.rs => stdout-during-shutdown-unix.rs} | 1 + ...=> stdout-during-shutdown-unix.run.stdout} | 0 .../runtime/stdout-during-shutdown-windows.rs | 20 +++++++++++++++++++ .../stdout-during-shutdown-windows.run.stdout | 1 + 4 files changed, 22 insertions(+) rename tests/ui/runtime/{stdout-during-shutdown.rs => stdout-during-shutdown-unix.rs} (97%) rename tests/ui/runtime/{stdout-during-shutdown.run.stdout => stdout-during-shutdown-unix.run.stdout} (100%) create mode 100644 tests/ui/runtime/stdout-during-shutdown-windows.rs create mode 100644 tests/ui/runtime/stdout-during-shutdown-windows.run.stdout diff --git a/tests/ui/runtime/stdout-during-shutdown.rs b/tests/ui/runtime/stdout-during-shutdown-unix.rs similarity index 97% rename from tests/ui/runtime/stdout-during-shutdown.rs rename to tests/ui/runtime/stdout-during-shutdown-unix.rs index 8549f5d8eb6..8e0f1d371ae 100644 --- a/tests/ui/runtime/stdout-during-shutdown.rs +++ b/tests/ui/runtime/stdout-during-shutdown-unix.rs @@ -1,6 +1,7 @@ //@ run-pass //@ check-run-results //@ ignore-emscripten +//@ only-unix // Emscripten doesn't flush its own stdout buffers on exit, which would fail // this test. So this test is disabled on this platform. diff --git a/tests/ui/runtime/stdout-during-shutdown.run.stdout b/tests/ui/runtime/stdout-during-shutdown-unix.run.stdout similarity index 100% rename from tests/ui/runtime/stdout-during-shutdown.run.stdout rename to tests/ui/runtime/stdout-during-shutdown-unix.run.stdout diff --git a/tests/ui/runtime/stdout-during-shutdown-windows.rs b/tests/ui/runtime/stdout-during-shutdown-windows.rs new file mode 100644 index 00000000000..4644965b154 --- /dev/null +++ b/tests/ui/runtime/stdout-during-shutdown-windows.rs @@ -0,0 +1,20 @@ +//@ run-pass +//@ check-run-results +//@ only-windows + +struct Bye; + +impl Drop for Bye { + fn drop(&mut self) { + print!(", world!"); + } +} + +fn main() { + thread_local!{ + static BYE: Bye = Bye; + } + BYE.with(|_| { + print!("hello"); + }); +} diff --git a/tests/ui/runtime/stdout-during-shutdown-windows.run.stdout b/tests/ui/runtime/stdout-during-shutdown-windows.run.stdout new file mode 100644 index 00000000000..30f51a3fba5 --- /dev/null +++ b/tests/ui/runtime/stdout-during-shutdown-windows.run.stdout @@ -0,0 +1 @@ +hello, world! \ No newline at end of file