adjust and un-xfail
This commit is contained in:
parent
c1be673e76
commit
fdebd1e2ef
21
src/test/run-pass/bind-native-fn.rs
Normal file
21
src/test/run-pass/bind-native-fn.rs
Normal file
@ -0,0 +1,21 @@
|
||||
// From #1174:
|
||||
// xfail-test bots are crashing on this on x86_64
|
||||
|
||||
use std;
|
||||
import std::str;
|
||||
import std::ctypes::*;
|
||||
|
||||
#[link_name = ""]
|
||||
native mod libc {
|
||||
fn write(fd: c_int, buf: *u8, nbyte: size_t);
|
||||
}
|
||||
|
||||
fn main() {
|
||||
let s = "hello world\n";
|
||||
let b = str::bytes(s);
|
||||
let l = str::byte_len(s);
|
||||
let b8 = unsafe { std::vec::unsafe::to_ptr(b) };
|
||||
libc::write(0i32, b8, l);
|
||||
let a = bind libc::write(0i32, _, _);
|
||||
a(b8, l);
|
||||
}
|
@ -1,17 +0,0 @@
|
||||
// From #1174:
|
||||
// xfail-test bots are crashing on this on x86_64
|
||||
|
||||
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 */
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user