aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/rust/compile/macro6.rs
blob: 0ca35ba688848e37c3bf7c5752fdb50a9164f400 (plain)
1
2
3
4
5
6
7
8
9
10
11
macro_rules! zero_or_one {
    ($($a:literal)?) => { // { dg-error "invalid amount of matches for macro invocation. Expected between 0 and 1, got 2" }
        f();
    }
}

fn main() {
    zero_or_one!();
    zero_or_one!(14);
    zero_or_one!(125 12 "gcc"); // { dg-error "Failed to match any rule within macro" }
}