| 1 |
// { dg-additional-options "-w" } |
| 2 |
// { dg-output "outer\r*\ninner\r*\n" } |
| 3 |
extern "C" { |
| 4 |
fn printf(s: *const i8, ...); |
| 5 |
} |
| 6 |
|
| 7 |
fn machin() { |
| 8 |
unsafe { |
| 9 |
let a = "outer\n\0"; |
| 10 |
let b = a as *const str; |
| 11 |
let c = b as *const i8; |
| 12 |
|
| 13 |
printf(c, 123); |
| 14 |
} |
| 15 |
} |
| 16 |
|
| 17 |
fn bidule() { |
| 18 |
fn machin() { |
| 19 |
unsafe { |
| 20 |
let a = "inner\n\0"; |
| 21 |
let b = a as *const str; |
| 22 |
let c = b as *const i8; |
| 23 |
|
| 24 |
printf(c, 123); |
| 25 |
} |
| 26 |
} |
| 27 |
|
| 28 |
self::machin(); |
| 29 |
machin(); |
| 30 |
} |
| 31 |
|
| 32 |
fn main() -> i32 { |
| 33 |
bidule(); |
| 34 |
|
| 35 |
0 |
| 36 |
} |