Debian Codegraph @

gcc/testsuite/rust/execute/torture/macros8.rs

raw
1 // { dg-output "zo1\r*\nzo1\r*\n" }
2 extern "C" {
3 fn printf(s: *const i8, ...);
4 }
5
6 fn f() {
7 let r_s = "zo1\n\0";
8 let s_p = r_s as *const str;
9 let c_p = s_p as *const i8;
10
11 unsafe {
12 printf(c_p);
13 }
14 }
15
16 macro_rules! zero_or_one {
17 ($($a:expr)?) => {
18 f();
19 };
20 }
21
22 fn main() -> i32 {
23 zero_or_one!();
24 zero_or_one!(f());
25
26 0
27 }