Import Debian changes 20180207-1
[hcoop/debian/mlton.git] / regression / thread0.sml
1 open MLton.Thread
2
3 val _ =
4 if 13 = 1 + switch(fn t => prepare (t, 12))
5 then print "1 succeeded\n"
6 else ()
7
8 val _ =
9 if 13 = 1 + switch(fn t =>
10 prepare (new(fn () => switch(fn _ => prepare (t, 12))), ()))
11 then print "2 succeeded\n"
12 else ()
13
14 val _ =
15 if 13 = switch(fn t => prepare (prepend(t, fn n => n + 1), 12))
16 then print "3 succeeded\n"
17 else ()
18
19 val _ =
20 if 13 = switch(fn t =>
21 prepare (new(fn () =>
22 let val t = prepend(t, fn n => n + 1)
23 in switch(fn _ => prepare (t, 12))
24 end),
25 ()))
26 then print "4 succeeded\n"
27 else ()