]> git.lizzy.rs Git - rust.git/commitdiff
move uses of rust ABI in tests to cdecl or c-stack-cdecl as appr
authorNiko Matsakis <niko@alum.mit.edu>
Fri, 21 Oct 2011 22:31:19 +0000 (15:31 -0700)
committerBrian Anderson <banderson@mozilla.com>
Mon, 24 Oct 2011 23:06:18 +0000 (16:06 -0700)
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.

src/test/run-pass/bind-native.rs
src/test/run-pass/binops.rs
src/test/run-pass/c-stack-as-value.rs [new file with mode: 0644]
src/test/run-pass/conditional-compile.rs
src/test/run-pass/import-from-native.rs
src/test/run-pass/issue-506.rs
src/test/run-pass/item-attributes.rs
src/test/run-pass/native-mod.rc
src/test/run-pass/native.rc
src/test/run-pass/native2.rs

index ef0cbd32437f3610c4f7bd511b799531936b01a2..d011071ccd2d5f457b626f1657446991e95d46a1 100644 (file)
@@ -2,7 +2,7 @@
 Can we bind native things?
 */
 
-native "rust" mod rustrt {
+native "cdecl" mod rustrt {
     fn task_yield();
 }
 
index 0a76fbe62b9c2fc2f27a1f3de0b7439b6f7e8f6e..2505c17b6d0fba5cd2bdc68910e14ec0aab8e6e2 100644 (file)
@@ -117,7 +117,7 @@ fn h(i: int) { }
     assert (h1 >= h2);
 }
 
-native "rust" mod native_mod = "" {
+native "cdecl" mod native_mod = "" {
     fn do_gc();
     fn unsupervise();
 }
diff --git a/src/test/run-pass/c-stack-as-value.rs b/src/test/run-pass/c-stack-as-value.rs
new file mode 100644 (file)
index 0000000..0b412e2
--- /dev/null
@@ -0,0 +1,9 @@
+// xfail-test
+
+native "c-stack-cdecl" mod rustrt {
+    fn unsupervise();
+}
+
+fn main() {
+    let _foo = rustrt::unsupervise;
+}
index 5ee6d2eaeeebf2a60ca14ca4281daa45140c24a8..a8b65e52ef912ebe7d439074e53f018cf37d19c7 100644 (file)
@@ -4,13 +4,13 @@
 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 f() { }
 }
 
 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];
index b8837692c0754ef459b2f05e9b49f8f49b7f7ed5..2d8888e81dd0e2015762050b30495bf07633ceb5 100644 (file)
@@ -3,7 +3,7 @@ fn ham() { }
     fn eggs() { }
 }
 
-native "rust" mod rustrt {
+native "c-stack-cdecl" mod rustrt {
     import spam::{ham, eggs};
     export ham;
     export eggs;
index a1df60b4245a1f39626c824eac4d36ae14a1ea55..ded303995bec76e9f419b468aed62a4dee429a57 100644 (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); }
index 3701d2290597082b4db8ff3ed43f64ea255d36d7..2960b9f5ecd00739b4ed5ec2abfbded7d6060a82 100644 (file)
@@ -29,7 +29,7 @@ fn f() { }
     mod mod1 { }
 
     #[attr = "val"]
-    native "rust" mod rustrt { }
+    native "c-stack-cdecl" mod rustrt { }
 
     #[attr = "val"]
     type t = obj { };
@@ -55,7 +55,7 @@ mod mod1 { }
 
     #[attr1 = "val"]
     #[attr2 = "val"]
-    native "rust" mod rustrt { }
+    native "c-stack-cdecl" mod rustrt { }
 
     #[attr1 = "val"]
     #[attr2 = "val"]
@@ -83,7 +83,7 @@ mod mod1 {
         }
 
         #[attr = "val"]
-        native "rust" mod rustrt {
+        native "c-stack-cdecl" mod rustrt {
         }
         */
 
@@ -116,7 +116,7 @@ mod mod1 {
 
         #[attr1 = "val"]
         #[attr2 = "val"]
-        native "rust" mod rustrt {
+        native "c-stack-cdecl" mod rustrt {
         }
         */
 
@@ -182,7 +182,7 @@ fn f() { }
 }
 
 mod test_native_items {
-    native "rust" mod rustrt {
+    native "c-stack-cdecl" mod rustrt {
         #[attr];
 
         #[attr]
index 73912355ef8ed094d57808a698472b8d28017617..793273b1a09cda5204dd2205b54a1103619dd23a 100644 (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;
 }
 
index 599ee9e7f2428d3a003bfa63eae782e4d220a7a3..6b16987bf9b5e0dd9e38f95fb3de96386789a41f 100644 (file)
@@ -1,7 +1,7 @@
 // xfail-test
 // -*- rust -*-
 
-native "rust" mod rustrt {
+native "c-stack-cdecl" mod rustrt {
   fn str_buf(str s) -> int;
 }
 
index c0340387cfe9ca30a763246dbd8a58dba61c39cb..10dd045028da11de7114f4f74f87afa8174da748 100644 (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 = "" { }