Fix tests
This commit is contained in:
parent
ecf0a1eea3
commit
ec44cfdfb4
7 changed files with 22 additions and 6 deletions
|
|
@ -138,6 +138,14 @@ impl Mul for u8 {
|
|||
}
|
||||
}
|
||||
|
||||
impl Mul for i32 {
|
||||
type Output = Self;
|
||||
|
||||
fn mul(self, rhs: Self) -> Self::Output {
|
||||
self * rhs
|
||||
}
|
||||
}
|
||||
|
||||
impl Mul for usize {
|
||||
type Output = Self;
|
||||
|
||||
|
|
@ -248,6 +256,14 @@ impl Sub for i16 {
|
|||
}
|
||||
}
|
||||
|
||||
impl Sub for i32 {
|
||||
type Output = Self;
|
||||
|
||||
fn sub(self, rhs: Self) -> Self {
|
||||
self - rhs
|
||||
}
|
||||
}
|
||||
|
||||
#[lang = "rem"]
|
||||
pub trait Rem<RHS = Self> {
|
||||
type Output;
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
// Run-time:
|
||||
// status: signal
|
||||
|
||||
#![feature(no_core, start)]
|
||||
#![feature(no_core)]
|
||||
#![no_std]
|
||||
#![no_core]
|
||||
#![no_main]
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
// Run-time:
|
||||
// status: signal
|
||||
|
||||
#![feature(no_core, start)]
|
||||
#![feature(no_core)]
|
||||
#![no_std]
|
||||
#![no_core]
|
||||
#![no_main]
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ fn inc(num: isize) -> isize {
|
|||
}
|
||||
|
||||
#[no_mangle]
|
||||
extern "C" fn main(mut argc: i32, _argv: *const *const u8) -> i32 {
|
||||
extern "C" fn main(mut argc: isize, _argv: *const *const u8) -> i32 {
|
||||
argc = inc(argc);
|
||||
unsafe {
|
||||
libc::printf(b"%ld\n\0" as *const u8 as *const i8, argc);
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ extern crate mini_core;
|
|||
use mini_core::*;
|
||||
|
||||
#[no_mangle]
|
||||
extern "C" fn main(argc: i32, _argv: *const *const u8) -> i32 {
|
||||
extern "C" fn main(argc: isize, _argv: *const *const u8) -> i32 {
|
||||
let string = "Arg: %d\n\0";
|
||||
let mut closure = || unsafe {
|
||||
libc::printf(string as *const str as *const i8, argc);
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ fn update_num(num: &mut isize) {
|
|||
}
|
||||
|
||||
#[no_mangle]
|
||||
extern "C" fn main(argc: i32, _argv: *const *const u8) -> i32 {
|
||||
extern "C" fn main(mut argc: isize, _argv: *const *const u8) -> i32 {
|
||||
let mut test = test(argc);
|
||||
unsafe {
|
||||
libc::printf(b"%ld\n\0" as *const u8 as *const i8, test.field);
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ static mut TEST2: Test = Test { field: 14 };
|
|||
static mut WITH_REF: WithRef = WithRef { refe: unsafe { &TEST } };
|
||||
|
||||
#[no_mangle]
|
||||
extern "C" fn main(argc: i32, _argv: *const *const u8) -> i32 {
|
||||
extern "C" fn main(argc: isize, _argv: *const *const u8) -> i32 {
|
||||
unsafe {
|
||||
libc::printf(b"%ld\n\0" as *const u8 as *const i8, CONSTANT);
|
||||
libc::printf(b"%ld\n\0" as *const u8 as *const i8, TEST2.field);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue