1 // This test case tests whether we can handle code bases that contain a high
2 // number of closures, something that needs special handling in the MingGW
4 // See https://github.com/rust-lang/rust/issues/34793 for more information.
6 // Make sure we don't optimize anything away:
7 // compile-flags: -C no-prepopulate-passes -Cpasses=name-anon-globals
9 // Expand something exponentially
10 macro_rules! go_bacterial {
11 ($mac:ident) => ($mac!());
12 ($mac:ident 1 $($t:tt)*) => (
13 go_bacterial!($mac $($t)*);
14 go_bacterial!($mac $($t)*);
18 macro_rules! mk_closure {
19 () => ((move || {})())
27 go_bacterial!(mk_closure 1 1 1 1);
35 // Make 2^12 functions, each containing 16 closures,
36 // resulting in 2^16 closures overall.
37 go_bacterial!(mk_fn 1 1 1 1 1 1 1 1 1 1 1 1);