aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/rust/compile/macro17.rs
blob: b50afbece41fbe753fb204f8673c84aba6d714c9 (plain)
1
2
3
4
5
6
7
8
9
10
macro_rules! rep {
    ($a:literal) => { $a };
    ($a:literal $(, $e:literal)*) => {
        $a + rep!(0 $(, $e)*) // { dg-error "reached recursion limit" }
    }
}

fn main() -> i32 {
    rep!(1, 2)
}