summaryrefslogtreecommitdiffstats
path: root/src/test/ui/cfg/cfg-macros-foo.rs
blob: 8b112c7961b891f25ac7112bf18102f195045d33 (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
// run-pass
// compile-flags: --cfg foo

// check that cfg correctly chooses between the macro impls (see also
// cfg-macros-notfoo.rs)


#[cfg(foo)]
#[macro_use]
mod foo {
    macro_rules! bar {
        () => { true }
    }
}

#[cfg(not(foo))]
#[macro_use]
mod foo {
    macro_rules! bar {
        () => { false }
    }
}

pub fn main() {
    assert!(bar!())
}