about summary refs log tree commit diff
path: root/tests/ui/process-termination/process-termination-simple.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/process-termination/process-termination-simple.rs')
-rw-r--r--tests/ui/process-termination/process-termination-simple.rs13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/ui/process-termination/process-termination-simple.rs b/tests/ui/process-termination/process-termination-simple.rs
new file mode 100644
index 00000000000..8f2e5b94c3a
--- /dev/null
+++ b/tests/ui/process-termination/process-termination-simple.rs
@@ -0,0 +1,13 @@
+// program should terminate when std::process::exit is called from any thread
+
+// run-pass
+// ignore-emscripten no threads support
+
+use std::{process, thread};
+
+fn main() {
+    let h = thread::spawn(|| {
+        process::exit(0);
+    });
+    let _ = h.join();
+}