about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--src/tools/miri/tests/many-seeds/tls-leak.rs13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/tools/miri/tests/many-seeds/tls-leak.rs b/src/tools/miri/tests/many-seeds/tls-leak.rs
new file mode 100644
index 00000000000..70a506958d1
--- /dev/null
+++ b/src/tools/miri/tests/many-seeds/tls-leak.rs
@@ -0,0 +1,13 @@
+//! Regression test for <https://github.com/rust-lang/rust/issues/123583>.
+use std::thread;
+
+pub(crate) fn with_thread_local() {
+    thread_local! { static X: Box<u8> = Box::new(0); }
+    X.with(|_x| {})
+}
+
+fn main() {
+    let j2 = thread::spawn(with_thread_local);
+    with_thread_local();
+    j2.join().unwrap();
+}