2018-08-30 14:18:55 +02:00
|
|
|
//@ run-pass
|
2024-04-07 00:33:37 +02:00
|
|
|
//@ compile-flags: --cfg foo --check-cfg=cfg(foo)
|
2011-07-27 14:48:34 +02:00
|
|
|
|
2015-03-22 13:13:15 -07:00
|
|
|
|
2013-10-07 15:40:46 -07:00
|
|
|
#[cfg(foo)]
|
2015-01-25 22:05:03 +01:00
|
|
|
macro_rules! foo { () => (1) }
|
2013-10-07 15:40:46 -07:00
|
|
|
|
|
|
|
#[cfg(not(foo))]
|
2015-01-25 22:05:03 +01:00
|
|
|
macro_rules! foo { () => (2) }
|
2013-10-07 15:40:46 -07:00
|
|
|
|
2014-01-03 15:30:54 -08:00
|
|
|
pub fn main() {
|
2015-01-25 22:05:03 +01:00
|
|
|
assert_eq!(foo!(), 1);
|
2013-10-07 15:40:46 -07:00
|
|
|
}
|