gcc/testsuite/rust/compile/macros/mbe/macro42.rs
raw| 1 | // { dg-additional-options "-w -frust-cfg=A" } |
| 2 | #![feature(rustc_attrs)] |
| 3 | |
| 4 | #[rustc_builtin_macro] |
| 5 | macro_rules! cfg { |
| 6 | () => {{}}; |
| 7 | } |
| 8 | |
| 9 | fn main() -> i32 { |
| 10 | let mut res = 0; |
| 11 | if cfg!(A) { |
| 12 | res = 1; |
| 13 | } |
| 14 | |
| 15 | if cfg!(A) { |
| 16 | res = 2; |
| 17 | } else { |
| 18 | res = 3; |
| 19 | } |
| 20 | |
| 21 | if cfg!(A) { |
| 22 | res = 4; |
| 23 | } else if cfg!(A) { |
| 24 | res = 5; |
| 25 | } |
| 26 | |
| 27 | let res = if cfg!(A) { |
| 28 | 6 |
| 29 | } else { |
| 30 | 7 |
| 31 | }; |
| 32 | |
| 33 | return res; |
| 34 | } |