aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/rust/compile/macro42.rs
blob: b3fbf6d6eb9b10760c0ce2049453015343f5c7ec (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
30
31
32
33
34
// { dg-additional-options "-w -frust-cfg=A" }
#![feature(rustc_attrs)]

#[rustc_builtin_macro]
macro_rules! cfg {
    () => {{}};
}

fn main() -> i32 {
    let mut res = 0;
    if cfg!(A) {
        res = 1;
    }

    if cfg!(A) {
        res = 2;
    } else {
        res = 3;
    }

    if cfg!(A) {
        res = 4;
    } else if cfg!(A) {
        res = 5;
    }

    let res = if cfg!(A) {
        6
    } else {
        7
    };

    return res;
}