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