aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/rust/execute/torture/macro-issue1426.rs
blob: 4fb6a29c8c1bf0a474ed3d3484a4be6b19dcdfc8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
macro_rules! stmt {
    ($s:stmt) => {
        $s
    };
    ($s:stmt, $($ss:stmt),*) => {
        $s;
        stmt!($($ss),*);
    };
}

pub fn test() -> i32 {
    stmt!(
        let a = 1
	// { dg-warning {unused name 'a'} {} { target *-*-* } .-1 }
    );
    stmt!(
        let b = 2,
        let c = 3,
        let d = 4,
        let e = 5,
        let f = b + c + d + e
    );

    f
}

fn main() -> i32 {
    test() - 14
}