]> git.proxmox.com Git - rustc.git/blob - src/test/ui/cfg/cfg-macros-foo.rs
New upstream version 1.50.0+dfsg1
[rustc.git] / src / test / ui / cfg / cfg-macros-foo.rs
1 // run-pass
2 // compile-flags: --cfg foo
3
4 // check that cfg correctly chooses between the macro impls (see also
5 // cfg-macros-notfoo.rs)
6
7
8 #[cfg(foo)]
9 #[macro_use]
10 mod foo {
11 macro_rules! bar {
12 () => { true }
13 }
14 }
15
16 #[cfg(not(foo))]
17 #[macro_use]
18 mod foo {
19 macro_rules! bar {
20 () => { false }
21 }
22 }
23
24 pub fn main() {
25 assert!(bar!())
26 }