gcc/testsuite/rust/execute/torture/macros29.rs
raw| 1 | // { dg-output "1\r*\n" } |
| 2 | #![feature(rustc_attrs)] |
| 3 | |
| 4 | #[rustc_builtin_macro] |
| 5 | macro_rules! concat { |
| 6 | () => {{}}; |
| 7 | } |
| 8 | |
| 9 | extern "C" { |
| 10 | fn printf(fmt: *const i8, ...); |
| 11 | } |
| 12 | |
| 13 | fn print(s: u32) { |
| 14 | unsafe { |
| 15 | printf("%u\n\0" as *const str as *const i8, s); |
| 16 | } |
| 17 | } |
| 18 | |
| 19 | fn main() -> i32 { |
| 20 | let res = concat!("test2") == "test3"; |
| 21 | if !res { |
| 22 | print(1); |
| 23 | } |
| 24 | |
| 25 | 0 |
| 26 | } |