about summary refs log tree commit diff
path: root/src/test/ui/threads-sendsync/spawn2.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2019-07-27 19:27:36 +0000
committerbors <bors@rust-lang.org>2019-07-27 19:27:36 +0000
commitc798dffac9dc8c82374db48f5b474690cc6e9686 (patch)
tree42d3f81ee0df278440f33b6ac0f6a37dae32fa32 /src/test/ui/threads-sendsync/spawn2.rs
parenta5e7bb3e2bae3e8d31c10de66e91cdcea42a97df (diff)
parentf1c8673ae7584e0c1e53c554ba61b7bf831edf90 (diff)
Auto merge of #63029 - petrochenkov:rpass, r=Centril
Move run-pass tests to ui

This is the second attempt at doing https://github.com/rust-lang/rust/pull/53994 (which was previously reverted in https://github.com/rust-lang/rust/pull/54530).

The issue with inability to run the test suite in a faster way (https://github.com/rust-lang/rust/issues/54047) that motivated the revert was recently addressed by https://github.com/rust-lang/rust/pull/61755.

r? @Centril
Diffstat (limited to 'src/test/ui/threads-sendsync/spawn2.rs')
-rw-r--r--src/test/ui/threads-sendsync/spawn2.rs31
1 files changed, 31 insertions, 0 deletions
diff --git a/src/test/ui/threads-sendsync/spawn2.rs b/src/test/ui/threads-sendsync/spawn2.rs
new file mode 100644
index 00000000000..83e066aef96
--- /dev/null
+++ b/src/test/ui/threads-sendsync/spawn2.rs
@@ -0,0 +1,31 @@
+// run-pass
+// ignore-emscripten no threads support
+
+use std::thread;
+
+pub fn main() {
+    let t = thread::spawn(move|| child((10, 20, 30, 40, 50, 60, 70, 80, 90)) );
+    t.join().ok().unwrap(); // forget Err value, since it doesn't implement Debug
+}
+
+fn child(args: (isize, isize, isize, isize, isize, isize, isize, isize, isize)) {
+    let (i1, i2, i3, i4, i5, i6, i7, i8, i9) = args;
+    println!("{}", i1);
+    println!("{}", i2);
+    println!("{}", i3);
+    println!("{}", i4);
+    println!("{}", i5);
+    println!("{}", i6);
+    println!("{}", i7);
+    println!("{}", i8);
+    println!("{}", i9);
+    assert_eq!(i1, 10);
+    assert_eq!(i2, 20);
+    assert_eq!(i3, 30);
+    assert_eq!(i4, 40);
+    assert_eq!(i5, 50);
+    assert_eq!(i6, 60);
+    assert_eq!(i7, 70);
+    assert_eq!(i8, 80);
+    assert_eq!(i9, 90);
+}