move uses of rust ABI in tests to cdecl or c-stack-cdecl as appr

Note: I found a bug in c-stack-cdecl which codes not permit such
native functions to be used as values.  I added an xfail-test
(c-stack-as-value) documenting it.
This commit is contained in:
Niko Matsakis 2011-10-21 15:31:19 -07:00 committed by Brian Anderson
parent f8de679c1e
commit 973a285371
10 changed files with 26 additions and 17 deletions

View file

@ -2,7 +2,7 @@
Can we bind native things?
*/
native "rust" mod rustrt {
native "cdecl" mod rustrt {
fn task_yield();
}

View file

@ -117,7 +117,7 @@ fn test_fn() {
assert (h1 >= h2);
}
native "rust" mod native_mod = "" {
native "cdecl" mod native_mod = "" {
fn do_gc();
fn unsupervise();
}

View file

@ -0,0 +1,9 @@
// xfail-test
native "c-stack-cdecl" mod rustrt {
fn unsupervise();
}
fn main() {
let _foo = rustrt::unsupervise;
}

View file

@ -4,13 +4,13 @@ const b: bool = false;
const b: bool = true;
#[cfg(bogus)]
native "rust" mod rustrt {
native "c-stack-cdecl" mod rustrt {
// This symbol doesn't exist and would be a link error if this
// module was translated
fn bogus();
}
native "rust" mod rustrt { }
native "c-stack-cdecl" mod rustrt { }
#[cfg(bogus)]
type t = int;
@ -79,7 +79,7 @@ fn test_in_fn_ctxt() {
}
mod test_native_items {
native "rust" mod rustrt {
native "c-stack-cdecl" mod rustrt {
#[cfg(bogus)]
fn vec_from_buf_shared<T>(ptr: *T, count: uint) -> [T];
fn vec_from_buf_shared<T>(ptr: *T, count: uint) -> [T];

View file

@ -3,7 +3,7 @@ mod spam {
fn eggs() { }
}
native "rust" mod rustrt {
native "c-stack-cdecl" mod rustrt {
import spam::{ham, eggs};
export ham;
export eggs;

View file

@ -5,10 +5,10 @@
use std;
import std::task;
native "rust" mod rustrt {
native "cdecl" mod rustrt {
fn task_yield();
}
fn yield_wrap(&&_i: ()) unsafe { rustrt::task_yield(); }
fn yield_wrap() { rustrt::task_yield(); }
fn main() { task::spawn((), yield_wrap); }

View file

@ -29,7 +29,7 @@ mod test_single_attr_outer {
mod mod1 { }
#[attr = "val"]
native "rust" mod rustrt { }
native "c-stack-cdecl" mod rustrt { }
#[attr = "val"]
type t = obj { };
@ -55,7 +55,7 @@ mod test_multi_attr_outer {
#[attr1 = "val"]
#[attr2 = "val"]
native "rust" mod rustrt { }
native "c-stack-cdecl" mod rustrt { }
#[attr1 = "val"]
#[attr2 = "val"]
@ -83,7 +83,7 @@ mod test_stmt_single_attr_outer {
}
#[attr = "val"]
native "rust" mod rustrt {
native "c-stack-cdecl" mod rustrt {
}
*/
@ -116,7 +116,7 @@ mod test_stmt_multi_attr_outer {
#[attr1 = "val"]
#[attr2 = "val"]
native "rust" mod rustrt {
native "c-stack-cdecl" mod rustrt {
}
*/
@ -182,7 +182,7 @@ mod test_other_forms {
}
mod test_native_items {
native "rust" mod rustrt {
native "c-stack-cdecl" mod rustrt {
#[attr];
#[attr]

View file

@ -10,7 +10,7 @@ native mod libc = target_libc {
fn free(int p) -> ();
}
native "rust" mod rustrt {
native "c-stack-cdecl" mod rustrt {
fn str_buf(str s) -> int;
}

View file

@ -1,7 +1,7 @@
// xfail-test
// -*- rust -*-
native "rust" mod rustrt {
native "c-stack-cdecl" mod rustrt {
fn str_buf(str s) -> int;
}

View file

@ -1,10 +1,10 @@
native "rust" mod rustrt {
native "c-stack-cdecl" mod rustrt {
fn unsupervise();
}
native "rust" mod bar = "" { }
native "c-stack-cdecl" mod bar = "" { }
native "cdecl" mod zed = "" { }