#![warn(missing_docs)]
#![allow(unsafe_code)]
use link_section::{
section, Ref, TypedMovableSection, TypedMutableSection, TypedReferenceSection, TypedSection,
};
#[section(typed)]
pub static EMPTY_TYPED: TypedSection<u32>;
#[section(mutable)]
pub static EMPTY_MUTABLE: TypedMutableSection<u32>;
#[section(movable)]
pub static EMPTY_MOVABLE: TypedMovableSection<u32>;
#[section(reference)]
pub static EMPTY_REFERENCE: TypedReferenceSection<Ref<u32>>;
pub fn main() {
assert!(EMPTY_TYPED.is_empty(), "typed");
assert_eq!(EMPTY_TYPED.as_slice(), &[] as &[u32]);
assert!(EMPTY_MUTABLE.is_empty(), "mutable");
assert!(EMPTY_MOVABLE.is_empty(), "movable");
unsafe { EMPTY_MOVABLE.sort_unstable() };
assert!(EMPTY_MOVABLE.is_empty(), "movable after sort");
assert!(EMPTY_REFERENCE.is_empty(), "reference");
eprintln!("OK: all empty sections linked and report empty");
}