rust/tests/ui/macros/macro-with-attrs1.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

14 lines
203 B
Rust
Raw Normal View History

//@ run-pass
//@ compile-flags: --cfg foo --check-cfg=cfg(foo)
2011-07-27 12:48:34 +00:00
#[cfg(foo)]
2015-01-25 21:05:03 +00:00
macro_rules! foo { () => (1) }
#[cfg(not(foo))]
2015-01-25 21:05:03 +00:00
macro_rules! foo { () => (2) }
pub fn main() {
2015-01-25 21:05:03 +00:00
assert_eq!(foo!(), 1);
}