about summary refs log tree commit diff
path: root/tests/ui/threads-sendsync/yield2.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/threads-sendsync/yield2.rs')
-rw-r--r--tests/ui/threads-sendsync/yield2.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/ui/threads-sendsync/yield2.rs b/tests/ui/threads-sendsync/yield2.rs
new file mode 100644
index 00000000000..376faab0c48
--- /dev/null
+++ b/tests/ui/threads-sendsync/yield2.rs
@@ -0,0 +1,8 @@
+// run-pass
+
+use std::thread;
+
+pub fn main() {
+    let mut i: isize = 0;
+    while i < 100 { i = i + 1; println!("{}", i); thread::yield_now(); }
+}