Debian Codegraph @

gcc/testsuite/rust/execute/torture/macros30.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 mut x = concat!("x");
21 x = concat!("y");
22 if x == "y" {
23 print(1);
24 }
25
26 0
27 }