Merge pull request #1 from phil-opp/cargo_test_support

Fix testing
This commit is contained in:
Philipp Oppermann
2015-09-15 14:54:58 +02:00
2 changed files with 10 additions and 5 deletions

View File

@@ -13,7 +13,7 @@
; limitations under the License.
global long_mode_start
extern main
extern rust_main
section .text
bits 64
@@ -21,7 +21,7 @@ long_mode_start:
call setup_SSE
; call rust main
call main
call rust_main
.os_returned:
; rust main returned, print `OS returned!`
mov rax, 0x4f724f204f534f4f

View File

@@ -21,7 +21,7 @@ extern crate rlibc;
use core::intrinsics::offset;
#[no_mangle]
pub extern fn main() {
pub extern fn rust_main() {
// ATTENTION: we have a very small stack and no guard page
let x = ["Hello", " ", "World", "!"];
let screen_pointer = 0xb8000 as *const u16;
@@ -37,5 +37,10 @@ pub extern fn main() {
loop{}
}
#[lang = "eh_personality"] extern fn eh_personality() {}
#[lang = "panic_fmt"] extern fn panic_fmt() -> ! {loop{}}
#[cfg(not(test))]
#[lang = "eh_personality"]
extern fn eh_personality() {}
#[cfg(not(test))]
#[lang = "panic_fmt"]
extern fn panic_fmt() -> ! {loop{}}