1#![feature(thread_local)]
2#![feature(linkage)]
3
4use std::sync::atomic::{AtomicBool, Ordering};
5
6use twizzler_rt_abi::Result;
7
8#[secgate::gatecall]
9pub fn test_thread_local_call_count() -> Result<usize> {}
10
11#[secgate::gatecall]
12pub fn test_global_call_count() -> Result<usize> {}
13
14#[secgate::gatecall]
15pub fn test_internal_panic(catch_it: bool) -> Result<usize> {}
16
17#[secgate::gatecall]
18pub fn test_was_ctor_run() -> Result<bool> {}
19
20#[secgate::gatecall]
21pub fn dynamic_test(x: u32) -> Result<u32> {}
22
23static WAS_CTOR_RUN: AtomicBool = AtomicBool::new(false);
24
25#[used]
26#[doc(hidden)]
27#[allow(non_upper_case_globals)]
28#[link_section = ".init_array"]
29static ___cons_test___ctor: unsafe extern "C" fn() = {
30 #[allow(non_snake_case)]
31 #[link_section = ".text.startup"]
32 unsafe extern "C" fn ___cons_test___ctor() {
33 cons_test()
34 }
35 ___cons_test___ctor
36};
37unsafe fn cons_test() {
38 WAS_CTOR_RUN.store(true, Ordering::SeqCst);
39}