aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/rust/execute/torture/decl_macro4.rs
blob: e700e63161db7c1ae3c5f9fcd32c74ba9f0d6b70 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#![feature(decl_macro)]
pub macro add {
    ($e:expr) => {
        $e
    },
    ($h:expr, $($t:expr),*) => {
        $h + add!($($t),*)
    },
}

fn main() -> i32 {
    let a = add!(1, 2, 3);

    a - 6
}