diff options
Diffstat (limited to 'src/test')
| -rw-r--r-- | src/test/run-pass/auxiliary/allocator-dummy.rs | 21 | ||||
| -rw-r--r-- | src/test/run-pass/getopts_ref.rs | 28 | ||||
| -rw-r--r-- | src/test/run-pass/smallest-hello-world.rs | 1 |
3 files changed, 15 insertions, 35 deletions
diff --git a/src/test/run-pass/auxiliary/allocator-dummy.rs b/src/test/run-pass/auxiliary/allocator-dummy.rs index 1133ace275b..a54233535a4 100644 --- a/src/test/run-pass/auxiliary/allocator-dummy.rs +++ b/src/test/run-pass/auxiliary/allocator-dummy.rs @@ -10,33 +10,40 @@ // no-prefer-dynamic -#![feature(allocator, core_intrinsics, libc)] +#![feature(allocator, core_intrinsics)] #![allocator] #![crate_type = "rlib"] #![no_std] -extern crate libc; - pub static mut HITS: usize = 0; +type size_t = usize; + +extern { + fn malloc(size: usize) -> *mut u8; + fn free(ptr: *mut u8); + fn calloc(size: usize, amt: usize) -> *mut u8; + fn realloc(ptr: *mut u8, size: usize) -> *mut u8; +} + #[no_mangle] pub extern fn __rust_allocate(size: usize, align: usize) -> *mut u8 { unsafe { HITS += 1; - libc::malloc(size as libc::size_t) as *mut u8 + malloc(size as size_t) as *mut u8 } } #[no_mangle] pub extern fn __rust_allocate_zeroed(size: usize, _align: usize) -> *mut u8 { - unsafe { libc::calloc(size as libc::size_t, 1) as *mut u8 } + unsafe { calloc(size as size_t, 1) as *mut u8 } } #[no_mangle] pub extern fn __rust_deallocate(ptr: *mut u8, old_size: usize, align: usize) { unsafe { HITS += 1; - libc::free(ptr as *mut _) + free(ptr as *mut _) } } @@ -44,7 +51,7 @@ pub extern fn __rust_deallocate(ptr: *mut u8, old_size: usize, align: usize) { pub extern fn __rust_reallocate(ptr: *mut u8, old_size: usize, size: usize, align: usize) -> *mut u8 { unsafe { - libc::realloc(ptr as *mut _, size as libc::size_t) as *mut u8 + realloc(ptr as *mut _, size as size_t) as *mut u8 } } diff --git a/src/test/run-pass/getopts_ref.rs b/src/test/run-pass/getopts_ref.rs deleted file mode 100644 index 90726c21fac..00000000000 --- a/src/test/run-pass/getopts_ref.rs +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or -// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license -// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - - -#![feature(rustc_private)] - -extern crate getopts; - -use getopts::{optopt, getopts}; - -pub fn main() { - let args = Vec::new(); - let opts = vec![optopt("b", "", "something", "SMTHNG")]; - - match getopts(&args, &opts) { - Ok(ref m) => - assert!(!m.opt_present("b")), - Err(ref f) => panic!("{}", *f) - }; - -} diff --git a/src/test/run-pass/smallest-hello-world.rs b/src/test/run-pass/smallest-hello-world.rs index a27d45ea17d..053ee8ee42e 100644 --- a/src/test/run-pass/smallest-hello-world.rs +++ b/src/test/run-pass/smallest-hello-world.rs @@ -11,6 +11,7 @@ // Smallest "hello world" with a libc runtime // pretty-expanded FIXME #23616 +// ignore-windows #![feature(intrinsics, lang_items, start, no_core, alloc_system)] #![no_core] |
