2023-04-20 14:37:15 +00:00
|
|
|
//@compile-flags: -Clink-arg=-nostartfiles
|
2023-04-20 15:19:36 +00:00
|
|
|
//@ignore-target-apple
|
2019-08-05 17:53:55 +02:00
|
|
|
|
2021-04-03 20:20:18 +03:00
|
|
|
#![feature(lang_items, start, libc)]
|
2019-06-13 10:58:35 +02:00
|
|
|
#![no_std]
|
|
|
|
|
|
|
|
use core::panic::PanicInfo;
|
|
|
|
use core::sync::atomic::{AtomicUsize, Ordering};
|
|
|
|
|
|
|
|
static N: AtomicUsize = AtomicUsize::new(0);
|
|
|
|
|
|
|
|
#[warn(clippy::main_recursion)]
|
|
|
|
#[start]
|
2022-02-13 04:43:27 +09:00
|
|
|
fn main(_argc: isize, _argv: *const *const u8) -> isize {
|
2019-06-13 10:58:35 +02:00
|
|
|
let x = N.load(Ordering::Relaxed);
|
|
|
|
N.store(x + 1, Ordering::Relaxed);
|
|
|
|
|
|
|
|
if x < 3 {
|
2022-02-13 04:43:27 +09:00
|
|
|
main(_argc, _argv);
|
2019-06-13 10:58:35 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
0
|
|
|
|
}
|
|
|
|
|
|
|
|
#[allow(clippy::empty_loop)]
|
|
|
|
#[panic_handler]
|
|
|
|
fn panic(_info: &PanicInfo) -> ! {
|
|
|
|
loop {}
|
|
|
|
}
|
|
|
|
|
|
|
|
#[lang = "eh_personality"]
|
2019-06-17 17:36:42 +02:00
|
|
|
extern "C" fn eh_personality() {}
|