aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/rust/execute/torture/macros26.rs
blob: 30f0beef0d969879a45c915123831422b3d92b61 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
macro_rules! count_tt {
    ($t:tt) => { 1 };
    ($t:tt $($ts:tt)*) => { 1 + count_tt!($($ts)*) };
}

fn main() -> i32 {
    let count = count_tt!(1 2 let a = 15) + count_tt!(1 2 (let a = 15));
    //                    ^ ^ ^^^ ^ ^ ^^              ^ ^ ^^^^^^^^^^^^
    //                    6 token-trees               3 token-trees

    count - 9
}