add test for issue #1174

This commit is contained in:
Niko Matsakis 2011-11-18 16:15:03 -08:00
parent 9fa44a41e6
commit 12a67af81d

View File

@ -0,0 +1,16 @@
// From #1174:
use std;
#[link_name = ""]
native mod libc {
fn printf(s: *u8, a: int); /* A tenuous definition. */
}
fn main() {
let b = std::str::bytes("%d\n");
let b8 = unsafe { std::vec::unsafe::to_ptr(b) };
libc::printf(b8, 4);
let a = bind libc::printf(b8, 5);
a(); /* core dump */
}