test: Update tests and import the prelude in some more places.

This commit is contained in:
Patrick Walton 2013-05-21 17:24:31 -07:00
parent 1be40be613
commit ee52865c88
29 changed files with 66 additions and 43 deletions

View file

@ -15,9 +15,7 @@
pub mod rustrt {
pub extern {
pub fn rust_dbg_call(cb: extern "C" fn(data: libc::uintptr_t)
-> libc::uintptr_t,
data: libc::uintptr_t)
pub fn rust_dbg_call(cb: *u8, data: libc::uintptr_t)
-> libc::uintptr_t;
}
}

View file

@ -10,7 +10,7 @@
extern fn foo() {}
static x: extern "C" fn() = foo;
static x: *u8 = foo;
static y: *libc::c_void = x as *libc::c_void;
static a: &'static int = &10;
static b: *int = a as *int;

View file

@ -13,7 +13,7 @@
extern mod cci_const;
use cci_const::bar;
static foo: extern "C" fn() = bar;
static foo: *u8 = bar;
pub fn main() {
assert_eq!(foo, cci_const::bar);

View file

@ -10,7 +10,7 @@
extern fn foopy() {}
static f: extern "C" fn() = foopy;
static f: *u8 = foopy;
static s: S = S { f: foopy };
struct S {

View file

@ -10,9 +10,7 @@
mod rustrt {
pub extern {
pub fn rust_dbg_call(cb: extern "C" fn(data: libc::uintptr_t)
-> libc::uintptr_t,
data: libc::uintptr_t)
pub fn rust_dbg_call(cb: *u8, data: libc::uintptr_t)
-> libc::uintptr_t;
}
}

View file

@ -10,9 +10,7 @@
mod rustrt {
pub extern {
pub fn rust_dbg_call(cb: extern "C" fn(data: libc::uintptr_t)
-> libc::uintptr_t,
data: libc::uintptr_t)
pub fn rust_dbg_call(cb: *u8, data: libc::uintptr_t)
-> libc::uintptr_t;
}
}

View file

@ -14,9 +14,7 @@
mod rustrt {
pub extern {
pub fn rust_dbg_call(cb: extern "C" fn(data: libc::uintptr_t)
-> libc::uintptr_t,
data: libc::uintptr_t)
pub fn rust_dbg_call(cb: *u8, data: libc::uintptr_t)
-> libc::uintptr_t;
}
}

View file

@ -10,9 +10,7 @@
mod rustrt {
pub extern {
pub fn rust_dbg_call(cb: extern "C" fn(data: libc::uintptr_t)
-> libc::uintptr_t,
data: libc::uintptr_t)
pub fn rust_dbg_call(cb: *u8, data: libc::uintptr_t)
-> libc::uintptr_t;
}
}

View file

@ -13,9 +13,7 @@
mod rustrt {
pub extern {
pub fn rust_dbg_call(cb: extern "C" fn(data: libc::uintptr_t)
-> libc::uintptr_t,
data: libc::uintptr_t)
pub fn rust_dbg_call(cb: *u8, data: libc::uintptr_t)
-> libc::uintptr_t;
}
}

View file

@ -15,10 +15,10 @@ extern fn g() {
}
pub fn main() {
// extern functions are extern function types
let a: extern "C" fn() = f;
let b: extern "C" fn() = f;
let c: extern "C" fn() = g;
// extern functions are *u8 types
let a: *u8 = f;
let b: *u8 = f;
let c: *u8 = g;
assert_eq!(a, b);
assert!(a != c);

View file

@ -10,9 +10,7 @@
mod rustrt {
pub extern {
pub fn rust_dbg_call(cb: extern "C" fn(data: libc::uintptr_t)
-> libc::uintptr_t,
data: libc::uintptr_t)
pub fn rust_dbg_call(cb: *u8, data: libc::uintptr_t)
-> libc::uintptr_t;
}
}

View file

@ -1,9 +1,7 @@
use std::unstable::run_in_bare_thread;
extern {
pub fn rust_dbg_call(cb: extern "C" fn(libc::uintptr_t)
-> libc::uintptr_t,
data: libc::uintptr_t) -> libc::uintptr_t;
pub fn rust_dbg_call(cb: *u8, data: libc::uintptr_t) -> libc::uintptr_t;
}
pub fn main() {