aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/rust/execute/torture/macros27.rs
blob: d515bb278a0bc6505ef7dd05764da83cf7d0c509 (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
// { dg-additional-options "-frust-cfg=A" }

macro_rules! attr {
    (#[$attr:meta] $s:stmt) => {
        #[$attr]
        $s;
    };
}

fn main() -> i32 {
    let mut a = 0;

    attr! {
    #[cfg(A)]
        a = 3
    };

    attr! {
    #[cfg(B)]
        a = 40
    };

    a - 3
}