2019-08-05 10:53:55 -05:00
|
|
|
// ignore-macos
|
|
|
|
// ignore-windows
|
|
|
|
|
2019-06-13 03:58:35 -05:00
|
|
|
#![feature(lang_items, link_args, start, libc)]
|
2019-06-17 10:36:42 -05:00
|
|
|
#![link_args = "-nostartfiles"]
|
2019-06-13 03:58:35 -05:00
|
|
|
#![no_std]
|
|
|
|
|
|
|
|
use core::panic::PanicInfo;
|
|
|
|
use core::sync::atomic::{AtomicUsize, Ordering};
|
|
|
|
|
|
|
|
static N: AtomicUsize = AtomicUsize::new(0);
|
|
|
|
|
|
|
|
#[warn(clippy::main_recursion)]
|
|
|
|
#[start]
|
|
|
|
fn main(argc: isize, argv: *const *const u8) -> isize {
|
|
|
|
let x = N.load(Ordering::Relaxed);
|
|
|
|
N.store(x + 1, Ordering::Relaxed);
|
|
|
|
|
|
|
|
if x < 3 {
|
|
|
|
main(argc, argv);
|
|
|
|
}
|
|
|
|
|
|
|
|
0
|
|
|
|
}
|
|
|
|
|
|
|
|
#[allow(clippy::empty_loop)]
|
|
|
|
#[panic_handler]
|
|
|
|
fn panic(_info: &PanicInfo) -> ! {
|
|
|
|
loop {}
|
|
|
|
}
|
|
|
|
|
|
|
|
#[lang = "eh_personality"]
|
2019-06-17 10:36:42 -05:00
|
|
|
extern "C" fn eh_personality() {}
|